For this setup the ESP-01 version was used. You can find it on ebay for a very low price. The pinput for the module is
|VCC||Connect +3.3V here. Need a source that can supply >200mA so most USB ↔ serial adapters qill not do the job.|
|GND||Connect to ground. If you use an external power source and an USB ↔ serial adapter remember to connect GND on the two together.|
|TXD||Transmit data. Connect to receive data|
|RXD||Receive data. Connect to transmit data|
|RST||Restart module if grounded. You can leave unconnected|
|CH_PD||Active high chip select. Connect to +3.3V|
|GPIO0||If grounded on startup modules enters flash mode. Can be left unconnected.|
|GPIO2||Should be tied to +3.3V at start up.|
For my test setup I use +3.3V from the Odessa module as I am building some test code for it and using a cheap 3.3V USB ↔ serial TTL converter. As usual the test setup is kind of messy (as it should be)
As I did this setup on windows, finding a terminal program that send CRLF as line endings, which ESP8266 expects, was the hardest problem I encountered in setting up this. At last I used putty and terminated my lines with ctrl+m/ctrl+j manually.
So to test the module open up a terminal program with all handshake turned off. My modules was at 9600 baud but it looks like they can be on 57600 and 115200 also.
First check that you get a response from the module
Common problems is setting rx/tx the wrong way, using the wrong baudrate, have a power source that delivers to little current.
If this works. Start by resetting the module with
note that the command should be in uppercase even if the AT does not have to. So AT+rst does not work.
Now make sure that the module act both as an access point and a connecting unit. You do this by setting mode=3
Modes are 1=Sta, 2=AP, 3=both.
You can check the current mode with
Some say one needs to reset the module after this. I don't know if that really is needed. But if you get into problems do that.
Now you can list the access points you have with
which gives you a list of available access points.
To connect to one you first enable multiple channels with
Then join one access point with
Yes both enclosed in “rabbitears”.
You can verify that you are connected with
Now connect to an active VSCP daemon with
you will see the welcome message when connected
Send user name with
AT+CIPSEND=4,12<CR><LF> user admin<CR><LF>
Send password with
AT+CIPSEND=4,13<CR><LF> pass secret<CR><LF>
you should see that you are logged in at this point.
Get the interface list from the daemon with
AT+CIPSEND=4,16<CR><LF> interface list<CR><LF>
Enter the receive loop so you receive all events coming in to the daemon
Quit the receive loop with
Close the session with the VSCP daemon with
By now I think you understand how this is working. Can't be easier. In multichannel mode you can have several channels open so you can have one channel that sends and one that receive events. Also note that the module remembers the access point you connected to and the credentials so on next restart it will connect automatically.
I will provide a sample for this using the Odessa module that connect CAN4VSCP and a VSCP daemon using wifi. Later I hope I would be able to provide a low cost CAN4VSCP module that do this as well.