Okay, problem solved.
I had inadvertently given a wrong password for my router, and the module would keep on trying to log on continuously.
Used the AT+CWQAP, re-defined my SSID and password, and it works as it should.
Okay, problem solved.
I had inadvertently given a wrong password for my router, and the module would keep on trying to log on continuously.
Used the AT+CWQAP, re-defined my SSID and password, and it works as it should.
Not trying to be pushy, but I wonder if you have had any success, Henrik?
I ran into a wall after getting the basic comms working (connecting to my router). Of course, the fact that I know nothing about TCP or HTML doesnt help, either.
Although, the module is now connected to the router (i can ping it remotely), I cant see it thru the browser.
Hi,
No, I haven't worked on it, don't know what to do with them.... :-)
Simply getting them connected to your Wifi doesn't mean you can "browse to them" - there's a little more to it than that (but not much really). Unfortunatley I don't remember off the top of my head and I don't have access to my notes right now.
What exactly is it you want to do?
I'll see if I can get something simple cobbled together tonight perhaps.
Well, for starters, I would like to connect a pic to the 8266's UART outputting some data, and expect it to be seen in the browser. And then, perhaps, feed in data into the browser, to be read by the pic?
Hi,
OK, this was and is a bit frustrating, trying to get this going on a PIC with only one USART. Anyway, this seems to work OK but it's meant ONLY as a startingpoint, I do NOT claim this to be the proper way of doing it.
Initially I did have HSERIN type stuff instead of the PAUSE statments but sometimes it just locked up and without any means of seeing what actually happened it got a bit a frustrating and I'm running out of time right now. So again, this does seem to work but it's not very robust nor elegant. When I get more time I'll rig something up with another PIC or get a bitbanged UART going for debugging purposes.
Oh, and since there is no connection back to the PC there's no way to see what IP the module gets assigned by the accesspoint so I used my accesspoints web interface to find that out. I found that if I did a "manual test run" first, ie using a serial terminal, it usually gets assigned the same IP number after that.
As I said, not elegant....
Code:dummy VAR BYTE Hits VAR BYTE Main: ' Issue a module reset HSEROUT["AT+RST", 13, 10] ' Module should respond with a bunch of data and finally 'ready' HSERIN[WAIT ("ready"), dummy] ' Set the mode, module may respond differently depending on if it's ' already IN the current mode so we simply delay (not good practise). HSEROUT["AT+CWMODE=3", 13, 10] PAUSE 100 ' Join the accesspoint, module should respond with 'OK' ' Replave mynetwork and password with actual SSID and password HSEROUT["AT+CWJAP=", 34, "mynetwork", 34, "," ,34, "password", 34, 13, 10] HSERIN[WAIT ("OK"), Dummy] ' Allow multiple connections, module should respond with 'OK' HSEROUT["AT+CIPMUX=1", 13, 10] HSERIN[WAIT ("OK"), Dummy] ' Open port 80 (normal port for HTTP), module should respond with 'OK' HSEROUT["AT+CIPSERVER=1,80", 13, 10] HSERIN[WAIT ("OK"), Dummy] ' Here we need to wait for a client to connect and request data. ' When that happens the module will outout the HTTP header on the ' UART, we'll trig on the GET keyword. HSERIN[WAIT("GET"), Dummy] Hits = Hits + 1 ' Prepare to send 33 bytes HSEROUT["AT+CIPSEND=0,33", 13, 10] PAUSE 100 ' Send the actual data HSEROUT["<TITLE>PBP ESP8266 demo</TITLE>", 13, 10] PAUSE 100 ' Prepare to send 30 bytes HSEROUT["AT+CIPSEND=0,30", 13, 10] PAUSE 100 ' Send the actual data HSEROUT["<H1>Testing the ESP8266</H1>", 13, 10] PAUSE 100 ' Prepare to send 22 bytes HSEROUT["AT+CIPSEND=0,22", 13, 10] PAUSE 100 ' Send the actual data HSEROUT["<H3>Cool stuff!</H3>", 13, 10] PAUSE 100 ' Prepare to send 18 bytes HSEROUT["AT+CIPSEND=0,18", 13, 10] PAUSE 100 ' Send the actual data HSEROUT["Page visits: ",DEC3 Hits, 13, 10] PAUSE 100 ' Now disconnect HSEROUT["AT+CIPCLOSE=0", 13, 10] PAUSE 1000 Goto Main
Henrik, thanks a lot for sharing your work. It looks very interesting indeed.
I'm away from my base till mid next week. Cant wait to get back and give it a try.
I'll report my experience soon as I get back.
Regards.
Bookmarks