I'm trying to get WiFi working. I have several of the little 8266 modules with the 8-pin header, and a little "motherboard" it plugs into, which provides 3.3V power, and 5V-3.3V level shifters for the Rx/Tx signals. Basically identical to these:
https://www.ebay.com/itm/ESP-01S-ESP8266-Serial-Wi-Fi-Wireless-Module-ESP-01-Adapter-for-Arduino/201711916394?hash=item2ef6f7956a:g:4ZYAAOSwHMJYIHFW
So far, little joy. I can receive serial data from the ESP with no problem (at 115200 BAUD). When I power up the ESP, it spits out a bunch of garbage, then "ready" and a newline. But I get no response whatsoever to anything I type in. I've tried several 8266 modules, and they all behave the same.
Any idea what the problem might be? Is "ready" the correct power-on message I should be seeing? Is it possible these modules don't have the correct firmware loaded on them? I'm really stumped at this point.
Regards,
Ray L.
Delta_G:
Depends entirely on what code is loaded on them. There is a boards set for them in the Arduino IDE. I tend to just assume they don't have what I want on them and load my own code from the get go. Loading code on them is a little tricky, you have to ground one of the GPIO pins and reset it at the same time to put it in programming mode. There's plenty of information around on it.
Here's an example that I use with my track-bot to send commands over a TCP socket. At least you can see the basics of setting up the chip to connect to WiFi. Note that it is in .h and .cpp form instead of .ino because I usually write from Eclipse that way. GitHub - delta-G/RobotWifi_ESP07: Code for the ESP8266 chip handling the comms on DiscoBot
I'm gong to give programming a try tomorrow. I've downloaded an app to do it, and just need to cobble up a way of pulling reset and GPIO0 down.
So the IDE will do the programming?
Thanks!
Regards,
Ray L.
Assuming it has AT command firmware loaded, you may have to configure your terminal program to send CR and LF. Or try CR or LF for line endings.
The problem is not line endings - I've tried all combinations. I believe it simply does not have proper firmware loaded, as it come up with "ready", not "Ok" when reset. I'm going to re-FLASH one of them this AM.
Regards,
Ray L.
I have the same modules and support boards. The symptom you describe happened to me when I flashed it with the incorrect firmware image. When I finally identified the right firmware and reflashed it, everything worked perfectly.
aarg:
I have the same modules and support boards. The symptom you describe happened to me when I flashed it with the incorrect firmware image. When I finally identified the right firmware and reflashed it, everything worked perfectly.
Which firmware did you use?
Regards,
Ray L.
RayLivingston:
Which firmware did you use?
Regards,
Ray L.
Okay, I looked back and it was a NodeMCU that I had that problem with... sorry. Expressif doesn't make it very easy to decipher the information that matches models with firmware. It's a pain. I guess I was lucky to get modules that had the right firmware from the vendor.
I used AT_v0.51_on_ESP8266_NONOS_SDK_V1.5.0 and then flashed based on a good guess of the Flash size, using the tables in the read.me file in that bundle. It might work for you.
Delta_G:
Forget all that AT command stuff.
I disagree. While it is really cool that the ESP can run standalone, there are reasons why it might not be the best choice in all situations. The ESP runs a protocol stack that can grab control at any time and delay processing. The ESP does not have as many pins, and none of them are 5V. It consumes more power than an AVR. There are software compatibility issues with the Arduino build, many sketches would require major changes to run. Many ESP boards lack the full complement of timer controllable pins that many of the Arduino boards have. You can argue the fine points, but the ESP is not a drop in replacement for an Arduino.
Delta_G:
Re: #2
Yeah you can program with the IDE. Just use the boards Manager to download the boards package for ESP8266. You need a USB to Serial adapter that works at 3.3V. Hook it up to Rx and Tx pins. When I get home later I'll give you some links that helped me a lot. It may be a couple of days. If you get into it and get lost PM me and remind me to post them. The problem is that there is a bunch of stuff that's just not documented well. Once you find it, programming those guys is pretty easy. Forget all that AT command stuff.
I understand the programming process, but I don't see where the firmware comes from when using the IDE. All I see if Arduino example apps that USE the 8266, not the actual firmware for the 8266 or how to tell the IDE to download it.
I have an Expressif app for doing it. I believe I have the correct firmware. I will be making an adaptor that will let me pull GPIO0 and RST low as required.
Regards,
Ray L.
@aarg
You are right, but you could leave all the connectivity activities to the esp8266 and then just pass an array of variables back and forth to the avr.
For example, if you are hosting a webpage or doing a lot of data fetches (mqqt or weather fot example l) it makes no sense to use at commands
Qdeathstar:
@aarg
You are right, but you could leave all the connectivity activities to the esp8266 and then just pass an array of variables back and forth to the avr.
For example, if you are hosting a webpage or doing a lot of data fetches (mqqt or weather fot example l) it makes no sense to use at commands
Can we please stay on-topic! I just want to figure out how to FLASH these things with the correct firmware to do AT commands. Nothing more.
I am about ready to take my 5-pound hammer to the whole pile of these things! I've looked at probably a dozen or more websites that claim to describe how to program these things. Every bloody one of them links to a DIFFERENT download tool. Only a few of them link to actual firmware, ALL DIFFERENT! Not ONE of them gives clear, concise instructions on DOING the actual download. Most of the tools require downloading SEVERAL different pieces of firmware: boot loader, application, default settings, and other things, and each requires a path to a binary file, and a FLASH offset at which that file gets programmed. I've managed to get only one set of firmware to download properly, and it seems to do exacly the same thing the original firmware does - prints "ready", then nothing.
Such a simple thing, why has nobody actually documented the process properly?
Regards,
Ray L.
Finallly! Oddly, at least part of the problem was line-endings, though I can't explain why. I was using PuTTY, and had it configured so it SHOULD have been sending CR+LF, but apparently wasn't. I used SerialMonitor, and now it's working. I've used PuTTY before with the CR+LF option and never had a problem, so I'm mystified why it doesn't work with these things. It doesn't make a lot of sense. But I now have working AT commands, using firmware that I FLASHed myself.
Regards,
Ray L.
Ray, that is fine. Sounds like potentially an xy problem however. Hence the discussion.
Like, all you want to do is hardware debounce a switch. Why, software debounce is more efficient. All you want to do is use at commands. Why, letting the esp8266 control comms is more efficient. *sometimes.
That link, which I looked at several days ago, seems to give a decent overview of the 8266, but is really sketchy on exactly HOW to re-FLASH one to be used with AT commands and the WiFiEsp library, which is all I need for the moment. It answers some questions, and creates about an equal number of new questions. I do have an adaptor board that provides power, a serial I/F-USB, and all the necessary pull-ups and switches to put the ESP into programming mode. That is the setup I used to put the latest Expressif stack in there yesterday.
In the 8266 board package, I see lots of sketches that USE the 8266, but nothing that is, to me at least, obviously the basic AT-driven stack that normally comes pre-programmed into boards like the ESP-01. That is why I went with the Expressif stack - it was the only thing I could find that provided the functionality I'm looking for right now. And it does appear to work, at least as far as being able to come up as a station or access point, and connect to other devices. Though I have yet successfully communicate using UDP. See my other thread on this topic - I have a dead-simple UDP sketch that simply does not work,
I do plan on doing another project very soon that will run entirely on the ESP, so I will have to figure out how to put my own application code in there, but that's not what I need right this minute. That will be used for the eventual "access point" I'll be building, and will run on a NODEMCU, rather than an ESP-01, as I need the extra I/O. Right now, I'm just trying to get all the station-side code working on the ESP-01s.
Regards,
Ray L.