ESP8266 Firmware ESP_BV2_ob

As this is essentially a serial device the following commands are available when a serial connection is made.

Commands can be entered on either side; serial connection or TCP connection. Both have the same method. To initiate a command (rather than just send text) the exact sequence is required.

<enter>+++<command name>[optional parameters]<enter>

As can be seen above the command +++ sequence will only be accepted as that if it is at the beginning of a new line (the enter key). The command sequence is ended with the enter key

Each of the following command needs to be preceded with the above prefix. In general sending the command without any parameters returns the current state. This will also indicate the format for changing. Separate elements of a command with a space or comma.

(default values in brackets)

NOTES

[1] This is for when the device is connected to another serial device that has a reset line, for example a ByPic microcontroller. It is so that it can re-set the connected device. Check with the actual device for the GPIO line, it is normally 4 but could be different.

[2] The IP address requires 3 IP values, <address><router address><mask>. It will only take effect if mode is set to 1. Entering 0 for the IP address will activate DHCP and so the router will give the device an IP address.

[3] Set mode to 1 first otherwise command will be ignored

[4] Authorisation mode: 0=Open, 1=WEP, 2=WPA_PSK, 3=WPA2_PSK, 4=WPA_WPA2_PSK

[5] This only applies to devices where the I2C is available, for example the BV107, see below

[6] ** Setting must be done in decimal ** Current system flag values:

Default:  11111011 (0xfb)

Bit 0: When set to 1 this will allow set up from the browser.
Bit 1: Verbose mode when set - outputs more information about what is going on
Bit 2: Debug, outputs even more information but mostly to the serial end.
Bit 3: Suppress all but Ack (*) and Nack(!) output for confirmation
 

[7]

tosend: Fills a buffer with text to send to a host, for example to get results from Google use tosend 'GET / HTTP/1.0\r\n\r\n' The text needs placing in single quotes.

send: Sends the text in the buffer to a host, so for example send www.google.com 80 The host and port need to be specified, the host can also be an IP address.

I2C Command for this Firmware

The breakout board has an I2C port incorporated. This will only work with the surface mount type of ESP8266 as that has the GPIO 14 that is used for the clock line. The command format follows the BV4221 syntax and uses single letters to manipulate the bus. The I2C commands are as follows:

Writing

The I2C command must begin with the address and any numbers that follow will be sent to the bus. So for example if we have a device that has an address (8 bit address) of 0x7a and we which to send 34,35 and 26 to the device connected to the bus then the following sequence would be required:

The address is specified in decimal or hex at the command itself, all I2C sequences must end in the 'p' command.

Reading

There are two common options for read. when using an 8 bit address, even addresses are write and odd addresses are read. Normally devices are specified by their write address. If as above the address is 0x7a, then the read address would be 0x7b. To read form this device the following sequence is required.

<ret> is either carriage return, line feed or both.

More often than not, most devices require a write before read, the EEPROM address on a memory for example. Where this is the case the following can be implemented.

In the above, the write address is used to send a command first, after that 'r' is used which re-starts the I2C bus and send the read address. It is then just a matter of reading the number of bytes required.

 

History: