![]() |
Forum Index : Microcontroller and PC projects : Micromite and the ESP8266
Page 1 of 2 ![]() ![]() |
|||||
Author | Message | ||||
Gizmo![]() Admin Group ![]() Joined: 05/06/2004 Location: AustraliaPosts: 5119 |
I seam to be going through a phase where every module I buy doesn't work as the instructions say they should.... Latest case, a ESP8266 from this Ebay link, and following the instructions on this page. I dont get past the "Hooking it up" stage, it wont respond to the AT commands. I've checked the serial data is going in with my cro, but get no response. The power LED is let. Am I supposed to flash it first, or not? The several pages I've found using the chip make no mention of it, and I get the impression they are ready to go out of the box. Glenn. The best time to plant a tree was twenty years ago, the second best time is right now. JAQ |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10310 |
It is always best to re-flash them with latest version of required firmware when newly purchased |
||||
Mixtel90![]() Guru ![]() Joined: 05/10/2019 Location: United KingdomPosts: 7937 |
You should always be able to get a "Ok" response to "AT" (note the capitals!), no matter what firmware is loaded. All you need is a simple terminal program (but I used Tera Term because it's already loaded). The baud rate is NOT always 115200 by default! Try 9600 or 76800 (it's non-standard, you have to enter it manually). Once you have the "Ok" you can set the baud rate with AT+UART_DEF=115200, 8, 1, 0, 3 The change is immediate so you'll have to reset the terminal (and possibly restart the ESP8266) You may find that 9600 is better than 115200 for most purposes. Edited 2021-11-12 19:21 by Mixtel90 Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
Tinine Guru ![]() Joined: 30/03/2016 Location: United KingdomPosts: 1646 |
Pretty sure @matherp covered this 8266 stuff in detail somewhere but I don't remember where. Been a while since I did anything with it but the following is what I used. Don't know if it's of any help: Firmware Update WiFi Setup |
||||
Gizmo![]() Admin Group ![]() Joined: 05/06/2004 Location: AustraliaPosts: 5119 |
Pretty sure I've bought a couple of dead boards. Even the software to flash them cant get a response, and I can see the serial signal on the Rx pin on the module with my cro. Wasting way to many hours on this project. The best time to plant a tree was twenty years ago, the second best time is right now. JAQ |
||||
Mixtel90![]() Guru ![]() Joined: 05/10/2019 Location: United KingdomPosts: 7937 |
The power supply is important - they have a nasty, sharp current spike of about 300mA at start of transmit. That's enough to sink the 3.3v regulator on a PicoMite. You need a cap of at least 10uF close to the module. However, you should probably be ok on the initial test. If you did the wiring mod on the page that you linked to, check it. I didn't do that, I just put suitable links between a USB-TTL converter and the ESP8266. Then I made a little adapter from a strip of veroboard a 4x2 connector and some bits of bare wire. Now I can plug it into a breadboard. Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
lizby Guru ![]() Joined: 17/05/2016 Location: United StatesPosts: 3378 |
Indispensible for ESP01. Also useful, especially if modded as here. I also use this 4-pin module a lot now--includes onboard 5V to 3V3 regulator. Very sensitive to weedy power supply--what are you using? ~ Edited 2021-11-13 01:01 by lizby PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed |
||||
Gizmo![]() Admin Group ![]() Joined: 05/06/2004 Location: AustraliaPosts: 5119 |
I'm a glutton for punishment. This morning I made a little adapter so I could fit the module on breadboard. The adapter included the short from VCC to CH_EN, and a 220uF cap across the VCC and GND pins. I've configured my USB to serial adapter to 3.3 volts. I then used TeraTerm to try to talk to the module on every baud rate between 1200 and 230400. Nothing. I can see the Tx light on the USB-serial adapter flashing, and can confirm I see the signal on the Rx pin of the module. The module has a little red light on. Tried both modules ( I was silly enough to buy two, and drove 40km to pick them up ). Also tried the recommended program to flash the modules, with the GPIO0 pin tied to ground on power up, and the program could not find the chip at any baud speed. About to bin them and give the seller a bad review. Edited 2021-11-13 13:16 by Gizmo The best time to plant a tree was twenty years ago, the second best time is right now. JAQ |
||||
Gizmo![]() Admin Group ![]() Joined: 05/06/2004 Location: AustraliaPosts: 5119 |
Some more testing. If I apply a reset to the reset pin, I do get a burst of serial data out of the module, but no matter what baud rate I select in the terminal, its rubbish. If I apply the ground to the GPIO0 pin ( to prepare the module for a new flash ), are any of the LED's other that the usual power LED supposed to light, to indicate its ready for a new flash? Is there any test I can do apart from the AT over serial, to get a response from the module to indicate its working or dead? Glenn The best time to plant a tree was twenty years ago, the second best time is right now. JAQ |
||||
Gizmo![]() Admin Group ![]() Joined: 05/06/2004 Location: AustraliaPosts: 5119 |
Googling "ESP-01 not working" returns hundreds of pages. Seams dead chips are common. Added the suggested extra caps, pull up resistors, etc. If I do a GPIO0 to ground, and reset it, it will start pouring data out the serial port constantly. No baud rate configuration in Tera Term will make sense of the rubbish. The cro shows a nice clear serial stream 0-3.3 volts. Been at it for 1 day now, time to let it go. The best time to plant a tree was twenty years ago, the second best time is right now. JAQ |
||||
JohnS Guru ![]() Joined: 18/11/2011 Location: United KingdomPosts: 4044 |
Mine uses 115200 I think (but over USB the speed is sort of hidden). John |
||||
CaptainBoing![]() Guru ![]() Joined: 07/09/2016 Location: United KingdomPosts: 2170 |
you need a logic analyzer with protocol analysis. Even a cheap chinese Saleae knock-off would handle UART rates and it will talk to the real software. I wouldn't normally vouch for fakes but they are dirt cheap an might get you out of a hole. Even shoite like this would give you a fighting chance https://www.ebay.co.uk/itm/233760345600?hash=item366d33ce00:g:aMYAAOSw~pRfmRrB Not much help right now but I have a genuine 8 channel Saleae and it was without-doubt one of my better buys - bugs fall really fast when that bad-boy comes out, debugging 20MHz SPI is a piece. Edited 2021-11-13 18:03 by CaptainBoing |
||||
Mixtel90![]() Guru ![]() Joined: 05/10/2019 Location: United KingdomPosts: 7937 |
First, make sure what you have. :) There is a ESP-01S and an ESP-01 and they are slightly different. The S version has internal pull-ups to 3v3 on RST, EN/CH_PD and IO0. You have to add them externally on the ESP-01 (no S) version. Apart from this I'm not aware of any other differences. The ESP-01S is easier to get now, I think. It sounds like it's working, just that you aren't seeing the response. Change the Tera Term "Terminal Settings" to LF+CR on transmit and receive. When I produced the manual for my PicoMite Backpack I included the following bit of MMBasic: 'ESP-01S Test option explicit 'forces you to declare variables. Good programming practice! dim dat$ 'declare dat$ SETPIN gp0, gp1, com1 'allocate pins for COM1 OPEN "com1:115200 as #5" 'open COM1 for access at 11500 baud to buffer number 5 PRINT#5, "AT"+chr$(13)+chr$(10) 'send "AT"+CR+LF to the ESP-01S pause 100 'give it time to respond dat$=INPUT$(loc(#5),#5) 'receive characters from buffer 5 up to last character PRINT dat$ 'display what we've received CLOSE #5 'close the receive buffer You should see: AT busy p... OK > Edited 2021-11-13 18:05 by Mixtel90 Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
Volhout Guru ![]() Joined: 05/03/2018 Location: NetherlandsPosts: 5089 |
Bear in mind that there are esp01 with 512, 1M and some indicate even 4M. I had similar experience when programming the wrong code. PicomiteVGA PETSCII ROBOTS |
||||
Gizmo![]() Admin Group ![]() Joined: 05/06/2004 Location: AustraliaPosts: 5119 |
Just a heads up, the USB-Serial adapter I'm using has LED's for Tx and Rx data. When I try to communicate with the ESP-01 by sending AT commands, at various baud rates, I can see the Tx light flashing, but the Rx light never flashes. Its just silent. If I go into the flash mode by shorting the GPIO0 pin to ground, I see constant data leaving the module on the Rx LED, but TeraTerm just sees rubbish data at any baud rate I try. Sending data ( trying to flash it ) while in this mode has no effect. I've walked away for now, wasted to much time on these ESP-01 modules. Tempted to try the Jaycar Wifi Mini ESP8266 module link . Its a lot more expensive, but better gamble it actually works as per the online instructions. Glenn The best time to plant a tree was twenty years ago, the second best time is right now. JAQ |
||||
bigfix Senior Member ![]() Joined: 20/02/2014 Location: AustriaPosts: 129 |
Did you try to connect xmt and rcv pins on the adapter ? This is a simple test if the adapter echoes its own data and works with the terminal I also often made the simple mistake to connect xmt to xmt instead of crossing Edited 2021-11-14 23:04 by bigfix |
||||
lizby Guru ![]() Joined: 17/05/2016 Location: United StatesPosts: 3378 |
That's a powerful markup they've got going for them compared to Aliex D1 Mini. The D1 Mini is my favorite ESP8266 for stand-alone use, but for just adding wifi, I've always gotten the ESP-01 to work (though in earlier times after much hair-pulling). I wouldn't try it now, though, without one of the above-linked adaptors. ~ Edited 2021-11-14 23:14 by lizby PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed |
||||
robscott Newbie ![]() Joined: 20/10/2021 Location: United StatesPosts: 22 |
Mick posted a nice basic example, once you get that working here is my ESP01 Picomite code to get the NTP time (I'm -5 from UTC) and Set the DATE$ and TIME$ values (Note my Baud Rate is 115200) Also, This works well with this version of the ESP01 AT Firmware Here is the 'AT' command to read what version you have AT+GMR AT version:1.7.4.0(May 11 2020 19:13:04) SDK version:3.0.4(9532ceb) compile time:May 27 2020 10:12:22 Bin version(Wroom 02):1.7.4 YOU MUST SEND A CR+LF WITH YOUR 'AT' COMMAND ! if you send just a CR, it will never answer you, and it will seem like it's not working .... ' ESP01 Test Program 'Option EXPLICIT SetPin GP25,DOUT SetPin gp17,gp16,com1 'SetPin GP2,dout ' ESP01 Reset Const qu$=Chr$(34) Const SSID$=qu$ + "YourSSID" + qu$ Const PWD$=qu$ + "YourPassword" + qu$ Const HOSTNAME$=qu$ + "Picomite" + qu$ IP$="" Const TREQ$="+CIPSNTPTIME" Const SNTP1$=qu$ + "0.pool.ntp.org" + qu$ Const SNTP2$=qu$ + "time.google.com" + qu$ ' Full Reset ESP01 'Pin(GP2)=0 'Pause 100 'Pin(GP2)=1 Open "com1:115200" As #1 ans$=ESP01("AT") ans$=ESP01("AT+CWMODE=3") ans$=ESP01("AT+CWHOSTNAME="+HOSTNAME$) ans$=ESP01("AT+CWJAP="+SSID$+","+PWD$) ans$=ESP01("AT+CIPSTA?") ans$=ESP01("AT+CIPSNTPCFG=1,-5," + SNTP1$ + "," + SNTP2$) For x=1 To 5 Pause 1000 ' wait for NTP ans$=ESP01("AT"+TREQ$+"?") If ans$="OK" Then Exit For Next x ans$=ESP01("AT+CWQAP") Close #1 Print HOSTNAME$ Print IP$ Print Time$ Print "... Done ..." Function ESP01(cmd$) As string Print cmd$ Print #1,cmd$ ans$=ESPInput(10000) Do ans$=ESPInput(20000) Print ans$ If Left$(ans$,11)="+CIPSTA:ip:" Then IP$=Right$(ans$,Len(ans$)-11) EndIf If Left$(ans$,12)=TREQ$ Then If Mid$(ans$,25,8)="00:00:00" Then ans$=ESPInput(10000) ' Clear OK msg ans$="ERROR" Print ans$ Else Time$=Mid$(ans$,25,8) Date$=GetDate(ans$) EndIf EndIf Loop Until (ans$="OK" Or ans$="ERROR") ESP01 = ans$ End Function Function ESPInput(timeout%) As string Local ret$,c$ Timer =0 Do c$=Input$(1,1) If c$<>Chr$(&HA) Then If c$=Chr$(&HD) Then Exit ret$=ret$ + c$ EndIf Loop Until Timer>timeout% If Timer>timeout% Then Print "Time Out" ret$="" EndIf ESPInput=ret$ End Function Function GetDate(ans$) As string Local j% j%=(Instr("JanFebMarAprMayJunJulAugSepOctNovDec",Mid$(ans$,18,3))-1)/3+1 GetDate=Mid$(ans$,22,2)+"/"+Str$(j%)+"/"+Mid$(ans$,34,4) End Function |
||||
robscott Newbie ![]() Joined: 20/10/2021 Location: United StatesPosts: 22 |
When the esp8266 boots the baud rate is 74880, if you do not have your terminal set to 74880 the meaningful information it sends out comes out as garbage. see: https://www.esp8266.com/viewtopic.php?t=2308 |
||||
Gizmo![]() Admin Group ![]() Joined: 05/06/2004 Location: AustraliaPosts: 5119 |
Yes, that would explain why TeraTerm could only see garbage, it doesnt have a option for 74880bd. Just an update. I've ordered the ESP-01 programmer board. Its cheap, and comes with a extra ESP-01, and hopefully will work. In the mean time I've been playing around with the Wifi Mini ESP8266 from Jaycar and getting somewhere. Its programmed via the Arduino app and a usb cable, easy. This board might kill two birds with one stone, I think its got enough power and spare GPIO pins to do away with using a Micromite altogether. Keep you posted. Glenn The best time to plant a tree was twenty years ago, the second best time is right now. JAQ |
||||
Page 1 of 2 ![]() ![]() |
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |