Chat freely about anything...

User avatar
By zacnotes
#12641 Hey all-
This is actually the last thing i typed - i realized that this post was quite wordy. Hopefully someone googling info will find some of it useful. If you care not about all that, skip to the bottom.

I received my first couple of units today, and have had good luck getting connected and settings adjusted, and pushing things from wifi to the unit. First task was installing the v0.20_14_11_28 (here: http://www.electrodragon.com/w/ESP8266, visit the "more documents on google drive" link at the bottom) firmware. I must say that it took me a bit of searching to get it done. In the interest of all who seek knowledge about getting started, I am going to list a few of my more important discoveries that I found through difficult web search. If any of you have better methods or more info on any of this, please speak up for the good of all.

So you are aware where I am headed, the end of this post will discuss my current hurdle, getting the Server mode to work (respond to GET requests) in Station mode.

First thing I struggled with was the ESP8266 not responding to AT commands. It would respond with a 'ready' message after a restart as long as my serial interface was currently attached to the right COM port (and it started at 9600 baud), but i could get no response from the unit at any sending. My problem turned out to be the FTDI cable i was using. I tried my arduino as an FTDI cable (this site http://www.zoobab.com/use-the-arduino-as-a-serial-adaptor was useful in the setup) and suddenly, comms worked fine.

Second struggle: Firmware is in vast abundance for this thing, and the instruction for how to install it is just as varied, and sometimes lacking enough info. the latest firmware that seemed reliable and utilized the AT command structure was the one I mentioned at the top. In my struggle to communicate with the unit at the beginning, i had downloaded most every tool excepting the putty option. The LuaLoader (http://benlo.com/esp8266/) seemed to be well designed, and I might follow the firmware option (and the alternate command structure) there at some point if I can't muddle through the AT commands fast enough for my liking. This is one of the things i didn't see enough comprehensive info on. Some firmware versions will undo all you know about how to connect to the unit. Regardless, the LuaLoader was the way to go. at the tools tab, there is an option to download a flasher (NodeMCU) that is in english, and it worked well for me. Next lack of info: everything says "flash the .bin file" which is a relatively straightforward process, but the firmware i downloaded came with numerous bin files, not just one. Which bin file to flash? I followed the first part of the path of 'ByHackAWay' at this post: http://www.esp8266.com/viewtopic.php?p=8071#p8071. I did not continue past the blank.bin file, as the firmware i had downloaded did not include any of the others, and it appeared he was attempting to get different functionality than i was looking for. (this is one of the points i may go back to check out if i can't get further with my current issue, there were one or two other .bin files in the download that I did not use.) It occurs to me now that flashing all of the bin files may address my issue, but here we run into another 'lack of info' hurdle. Each additional bin file appears to require a specific memory address to install it to. Having followed 'ByHackAWay's method, I do not have any clue as to what address to send the other bin files to. Perhaps the answer is in the size of the file, and how much space it will take up before you hit the next memory block? I don't know, it will take some more googling.

Having updated the firmware, I jumped straight into the settings, using the LuaLoader program. It handles new line and carriage returns by setting, and it was the last serial interface i used when i got things talking. Perhaps some are better, but this one seems sufficient at the moment.
I set CWMUX=1 (multi-connect), CWMODE=1 (Station mode, 2=AP and 3= both), started the server with CIPSERVER=1,80(1 is start server, 80 is the port #)
I found the IP it was connected to with CIFSR (i actually set the IP first, then let DCHP assign it after i ran into the troubles i describe below)
The moment was at hand. Browser address=ip of the ESP8266 and.... no response on the terminal.
I banged my head against that for a while, then set it to AP mode, restarted the server (don't forget to CWMUX=1 after AT+RST!), configured it to operate as a DHCP server with CWDHCP=2,0, and pointed my laptop at the new access point. finding the address of the ESP again, I launched the browser and pointed it at the ESP. This time, the terminal went nuts. all kinds of info was tossed at me. Through some trial and error, i was able to send info back to the browser, even going as far as building some of the webpage I intend on hosting on it, all from the terminal line in real time.
But, i want it to reside on my network, not switch to a new one every time
before i describe the hurdle for those that skipped this long-winded post, one more item i will bring up: occasionally, the LuaLoader decides it isn't communicating with the ESP anymore, and automatically switches the baud to 9600. This appears to be associated with a random reset of the ESP, because after i change back to 115200 (came with the firmware) the unit shows CWMUX=0.


For those that skipped down here: Thank you for taking the time to look at my request for info:
I can get the ESP to talk to a browser when it is in AP mode + Server mode, but i cannot get it to connect to a browser in Station mode + Server mode. Is it currently impossible, is it a firmware bug, will some additional bin files correct my issue?

Thanks all for comments!