I am trying to set up my WiFly GSX RN-131C module to send data to a local webserver running on my laptop. No Arduinos involved at the moment- just the WiFly module connected to maybe some temperature sensors outside or something like that. Part of the reason for this project is that I wanted to learn more about HTTP, TCP and Servers and I certainly have done so in the last couple of weeks but I have hit a brick wall.
I have successfully set up servers on my laptop and connected the WiFly via my wireless router. By the way I found a really interesting little server for windows called Tinyweb http://www.ritlabs.com/en/products/tinyweb/- I had problems getting it working but it is really small and requires very little resources.
The problem is specifically with the GET request as described in “13. Using HTML client feature” of the WiFly GSX manual. The server just does not respond to the request from the WiFly.
The WiFly connects fine and I get “listen on 2000” so we can assume that I’ve set up the wlan commands correctly. The rest of the commands I give the WiFly (via the UART) are:
set ip proto 18
set ip host 192.168.1.67 (laptop local address)
set ip remote 80
set com remote GET$/cgi-bin/test.cmd?DATA=
set q sensor 0xff
set sys auto 10
set option format 7
save
reboot
Essentially it’s copying out of the manual but changing parameters so it connects to my local server rather than http://www.something.com
test.cmd is a collection of simple DOS commands to create a directory which would indicate that it has been run. I am not even trying to get the data out of the request yet. Don’t laugh but I intend to use a QBASIC program to extract the data.
I wonder if it’s something to do with the fact that the WiFly only adds \n to the end of the GET request rather than \r\n. I downloaded a protocol analyser and noticed that GET requests from a browser end in \r\n and the WiFly GET request ends in \n.
The other reason I wonder this is that if I forget about the sensors and autoconnection (set sys auto 0) and simply use the command…
set com remote GET$/
when I type the command open I get HTML back from the server through the UART but only after I send a \r from the UART (i.e. type return on the keyboard of the computer connected via serial port to the UART for programming the WiFly).
I am starting to wander if anyone has ever successfully achieved sending data via HTTP from the WiFly on its own or is everyone using it with an Arduino? Is it actually impossible? Of course the more likely explanation is the one piece of information that is missing from my brain. Can anyone help?