lbenson
Senior Member
I have gotten a wifi-to-serial module, the HLK-RM04, to work with a picaxe. The device is available from DX.com for $16.30US ( http://dx.com/p/hi-link-hlk-rm04-serial-port-ethernet-wi-fi-adapter-module-blue-black-214540 ). It's also available on Aliexpress, as is a test board for $7.80US ( http://www.aliexpress.com/item/Free-shipping-Serial-wifi-module-HLK-RM04-test-board/1129436621.html ). I didn't use the test board.
The device has 28 pins with a 2mm pitch, so it's not breadboard friendly. The data sheet is here: http://www.hlktech.com/uploadfile/2013042218402981701.pdf
The user manual is here: http://www.hlktech.net/inc/lib/download/download.php?DId=19
Only 4 of the 28 pins are needed--5V, 0V, Rx, and Tx (pins 1, 2, 20, and 21). The module takes 5 volts, but the I/Os need 3.3 volts, so I took advantage of another pin, pin 4 (which provides up to 300mA at 3.3V) to power the picaxe at 3.3V. I used a 3-pin row of turned header pins to link pins 1, 2, and 4 to the breadboard, bending pin 3 up out of the way and bending the other pins to fit the .1-inch breadboard pitch. Similarly, I used a 2-pin header to connect TX and RX to the breadboard, bending pins 20 and 21 as needed.
Configuration is done wirelessly, by connecting your PC wifi to the module's AP and taking your browser to http://192.168.16.254/ser2net.asp.
I changed the configuration as shown in the image below. I set the device to an ip on my network, 192.168.1.106, and set it up as a wifi client with a connection to an unencrypted test router (Omnibus9). Once you do this and hit <Apply>, you will lose your connection and have to reconnect using the ip you provided. I set the bit rate at 4800,8,n,1, and the Network Mode as "Server". I didn't know what "Remote Server Domain/IP" was supposed to do, so I changed it to a non-existant device in my network range.
Note that if you mangle the wifi connection and can't access the board, the manual shows how to ground a pin to reset to the factory configuration.
I used the following code on a 14M2:
This blinks an led, and writes to pin b.5 about once every 6 seconds. Serin on pin b.4 times out after 3 seconds if nothing is received.
I connected to the device from a PC using putty, with designated IP and port, with a setting type of "raw". I could see the message from the picaxe every 6 seconds, and when I typed a two-digit number and hit <enter>, I got a message back of, for instance, "received: 23". This worked even if I waited through several incoming messages before hitting <enter>. It is probably possible for the incoming timing to be such that the picaxe would miss a character, but a message from the picaxe could be used as a "Clear-to-Send" signal, and a response within 3 seconds should be received reliably.
The module has a connector for attaching an antenna, but I just used the onboard antenna. I had no problem connecting to my router about 20 feet away.
So it looks like a nice device, though with complications in wiring it up. A similar but easier-to-use and less expensive device (quantity 10) appears to be the TLG10UA03. I've ordered several, and will write about them when I receive and have tested them.
The device has 28 pins with a 2mm pitch, so it's not breadboard friendly. The data sheet is here: http://www.hlktech.com/uploadfile/2013042218402981701.pdf
The user manual is here: http://www.hlktech.net/inc/lib/download/download.php?DId=19
Only 4 of the 28 pins are needed--5V, 0V, Rx, and Tx (pins 1, 2, 20, and 21). The module takes 5 volts, but the I/Os need 3.3 volts, so I took advantage of another pin, pin 4 (which provides up to 300mA at 3.3V) to power the picaxe at 3.3V. I used a 3-pin row of turned header pins to link pins 1, 2, and 4 to the breadboard, bending pin 3 up out of the way and bending the other pins to fit the .1-inch breadboard pitch. Similarly, I used a 2-pin header to connect TX and RX to the breadboard, bending pins 20 and 21 as needed.
Configuration is done wirelessly, by connecting your PC wifi to the module's AP and taking your browser to http://192.168.16.254/ser2net.asp.
I changed the configuration as shown in the image below. I set the device to an ip on my network, 192.168.1.106, and set it up as a wifi client with a connection to an unencrypted test router (Omnibus9). Once you do this and hit <Apply>, you will lose your connection and have to reconnect using the ip you provided. I set the bit rate at 4800,8,n,1, and the Network Mode as "Server". I didn't know what "Remote Server Domain/IP" was supposed to do, so I changed it to a non-existant device in my network range.
Note that if you mangle the wifi connection and can't access the board, the manual shows how to ground a pin to reset to the factory configuration.
I used the following code on a 14M2:
Code:
'14wifi48.BAS blinks an led; test for programming success
#picaxe 14M2
#no_data
symbol LED=b.0
start:
pause 1000
readtemp b.1,b13
sertxd ("14wifi48 ",#b13,13,10)
main:
high LED
pause 350
low LED
pause 350
high LED
pause 125
low LED
pause 125
high LED
pause 1000
low LED
pause 350
serout b.5, t4800_4,("serout pin 5 ", #w6,cr,lf)
serin [3000, skip], b.4, t4800_4, b10,b11 '
serout b.5, t4800_4,("received: ", b10, b11,cr,lf)
sertxd ("received: ", b10, b11,cr,lf)
skip:
inc w6
sertxd (#w6," ")
goto main
I connected to the device from a PC using putty, with designated IP and port, with a setting type of "raw". I could see the message from the picaxe every 6 seconds, and when I typed a two-digit number and hit <enter>, I got a message back of, for instance, "received: 23". This worked even if I waited through several incoming messages before hitting <enter>. It is probably possible for the incoming timing to be such that the picaxe would miss a character, but a message from the picaxe could be used as a "Clear-to-Send" signal, and a response within 3 seconds should be received reliably.
The module has a connector for attaching an antenna, but I just used the onboard antenna. I had no problem connecting to my router about 20 feet away.
So it looks like a nice device, though with complications in wiring it up. A similar but easier-to-use and less expensive device (quantity 10) appears to be the TLG10UA03. I've ordered several, and will write about them when I receive and have tested them.
Attachments
-
68.3 KB Views: 89
Last edited: