ESP8266 Wifi Module - prints "ready" but not responding to AT commands - arduino

Just received my first ESP8266 wifi module with some excitement. However I've been unable to fully communicate with it. I have connected the module to my computer via a usb to serial cable and I'm power the module via a separate power supply (3.3v).
After powering the module up I receive the following information (via PuTTY or and Arduino serial monitor window):
[Vendor:www.ai-thinker.com Version:0.9.2.4]
ready
I have tried sending various AT commands e.g.
AT+RST
But I get no response. Using ctrl+m and ctrl+j in putty didn't help either.
Please see my youtube video if its helpful:
https://www.youtube.com/watch?v=RvasOuHuWDc

To get AT OK .
1.AT + PRESS ENTER + THEN CTRL +J WILL GIVE OK
2.Then Enter commands to execute
eg AT+GMR ->presss enter then ctrl+j
to get firmware
repeat step 1 for each command.

Make sure that you have putty or the Arduino serial console configured to send both a newline \n and a carriage return \r character. So AT+RST actually ends up being AT+RST\r\n. This took me a bit when I first received my ESP8266 modules. On the Arduino serial console this option is at the bottom of the window. I can see in your video you have it set to no line ending. Hopefully that does it for you.

Related

Putty carriage return corruption

I am trying to make a windows executable talk with a Quectel module through serial.
The tool always fails at the first step which is to read the module's firmware version with an AT command (AT+CGMR\r).
I tested to send the same command to the module, using Putty and typing out the command, and it worked like a charm.
However, when I type the command in a notepad (including the carriage return at the end), then copy the text and paste it into putty (my idea was to get closer to the behavior of the .exe by sending the command faster), 2 weird things happen:
1 - I don't get a response from the module until I send a second carriage return by pressing Ctrl-M in putty. I am certain that the character is copied into the clipboard from the notepad though...
2 - The module does not receive "AT+CGMR" but "AT+CGMM" (which is also a valid command). I tested other variations and concluded that the last text character is always replaced by the second to last text character. So AT+CDFR gives AT+CDFF. AT+PILJ gives AT+PILL etc...
I am certain that is what the module receives because echo mode is on so the module prints out the command it received before the answer to said command.
To summarize:
By typing on the keyboard directly into putty I get:
AT+CGMR
SSB,V150R100C10B200SP1
SECURITY_A,V150R100C20B300SP5
PROTOCOL_A,V150R100C20B300SP5
APPLICATION_A,V150R100C20B300SP5
SECURITY_B,V150R100C20B300SP5
RADIO,Hi2115_RF0
OK
Which is the expected output.
But by copying and pasting the exact same text from notepad I get:
AT+CGMM
BC95GJB-02-STD
OK
and that, only after I press Ctrl-M. Before that there is no answer at all so it is as if the module never received the carriage return.
I can't figure out what is going on here... Any help appreciated.
I worked a lot with Quectel 4G modules. Maybe make a simple data tracer.
Download dumb terminal Termite so you can see single hex characters including non printable. Connect termite to to read a stock USB to serial adaptor. Make sure the adaptor is set to 3.3V not 5V. The Quectels are 1.8V domain but can scrape in and drive 3.3V logic. I assume you are driving your Quectel with 1.8V.
Hardware wise attach the Rx pin of the Quectel module to the USB module Rx pin then you can see exactly the characters going into the Quectel from Notepad and Putty. (Sometimes you may need a 1K in series with the USB Rx pin to reduce loading). Bingo, you can see exactly the characters the Quectel is getting. I found many bugs doing this.

Flashed the ESP-01S to new firmware, now can't send any AT commands

I've have been trying to flash the ESP-01S to the 1.5.1 from the official website. I am also using their own flash tool. The tool detects the component and completes the update all the time, this is what it detects:
5Eh : N/A
flash devID:
4014h
QUAD;8Mbit
crystal:
26 Mhz
AP: CA-2B-96-03-59-AF STA: C8-2B-96-03-59-AF
Now when I try connect everything up with my arduino and try some AT commands through the serial port, nothing happens. When the ESP is first switched on it spits out the normal gibberish however, it now doesn't say "READY" and every time i send an AT command it sends no reply.
I can still reflash the device but, no matter what I try no AT command work.

How to send command through serial same way it does with PuTTy in a python script

I have a HPLC pump connected via serial port to the computer. By using PuTTy I can send commands to it such as REMOTE to control it from PC (the display will change on the pump to show that it is indeed in remote mode. However when I use the same command from python the device does not respond.
import serial
pump = serial.Serial(port='COM2', baudrate=19200)
I have tried
pump.write('REMOTE\n'.encode())
and
pump.write(b'REMOTE\n')
and
pump.write(b'REMOTE')
I resolved the issue.
I needed to use
pump.write(b'REMOTE\r')
not
\n

HM10 BLE 4.0 Send AT Commands instead of passing through serial

When I send any commands to the HM10 BLE Bluetooth module, it sends the commands through bluetooth instead of the HM10 module processing the command. For example, I expected to send AT and have the module respond with "OK", but it sends the text "AT" through the bluetooth connection. I have tried sending the command with no bluetooth connection and the same thing happens. I have also tried sending the command via bluetooth instead of the serial connected to the device and I get the same thing.
When HM10 is connected to remote ble device it is in transparent mode. To put it into AT mode you need break connection or not establish it at all.
For breaking connection use reset/break pins. Reset is 12 pin and Break seems to be 23 pin.
It has sense to look IMME parameter of the module (page 32 of datasheet).
IMME Query/Set Module work type
1: When module is powered on, only respond the AT Command, don’t do
anything. Until AT + START, AT+CON, AT+CONNL commands is received.
0: When power on, module will start work immediately Default: 0
Also be carefull with strings endings, usually string doesn't need to be terminated with any symbol at all: AT, but some H11 need the string to end with CRLF: AT\r\n
Maybe (Maybe) your problem because of using clone module, try this solution with upload genuine firmware to your hm-10.
How to flash genuine HM-10 firmware on CC2541
I had problem close from your problem but for me no matter what I send I don't receive anything even to connected device, but after I upload that firmware, and change Module work mode to 1 (AT+MODE1) become able to send command even from connected device.

avrdude: error: buffered memory access not supported

I am trying to upload this firmware sck_beta_v0_8_6 via Arduino 1.0.5-r2.
I have chosen LilyPad Arduino USB as the board. The device is a Smart Citizen Kit Urban Shield v.1.1.
The upload fails with the following error message:
Found programmer: Id = "BÛR"; type =
Software Version = . ; Hardware Version = .
avrdude: error: buffered memory access not supported. Maybe it isn't
a butterfly/AVR109 but a AVR910 device?
What am I doing wrong?
Sometimes, a different USB cable will make all the difference. There is a wide range in the quality of cables on the market, and sometimes, you get one on the ragged edge of acceptable.
The Arduino lilypad seems to be particularly susceptible to this. Glad this helped.
Press the Reset Button before upload the code, until you hear the "unplug" sound (in windows). Open the IDE and try it again
I had the same error message trying to upload a sketch to an Arduino Leonardo board from a Levovo laptop using Arduino ver 1.0.6. Both Device Manager and Arduino showed the board connected on COM3. Arduino also gave an error message that COM3 was being used by another App. I tried changing USB cables but got the same message. What worked was changing the USB outlet from the top right rear on the Lenovo to the bottom right rear outlet. It connected on COM8 and I was able to upload the sketch. Understand there are speed differences between the two outlets. Now all I need to do is figure out why I cannot upload sketches to the same Leonardo board on my HP laptop with Windows 10 and the most recent Arduino version. Connects on COM6 but hangs up when uploading. (Note: Also had to edit some Arduino library files that worked on ver 1.0.6 but showed compile errors in the latest version.)
I had the same error, but I later found that I had the wrong Arduino type selected, instead of Nano I had Yun.
I had the same issue when trying to upload code into Arduino Micro ( Chinese clone ). Spending hours on Google, flashing new bootloader - still nothing. Physical reset and opening COM port with boundrate 1200 doesn't work. Why?
I HAVE ATMEGA168 INSTEAD OF ATMEGA32u4!
Google is telling, that Arduino Micro got Atmega32u4, but my clone got Atmega168! First of all, check what atmega type do you have by lookup on black soldered chip on Arduino.
So instead of choose "Arduino Micro" on "Board" menu, i choose Arduino Nano and everything works!
I get this same error, avrdude: error: buffered memory access not supported also with garbage-looking output with programmer id # with versions ., when I point avrdude at the serial port of the stock main firmware of my Leonardo-compatible breakout board instead of the serial port offered during the bootloader; it seems that the latter is what avrdude can program?
The normal initial output when actually connecting to the bootloader would be something like:
Connecting to programmer: .
Found programmer: Id = "CATERIN"; type = S
Software Version = 1.0; No Hardware Version given.
To get to the bootloader you can either
press the reset button (if you don't have a reset button, connecting reset to ground), or
briefly connect to the main firmware's serial port at 1200 bps and disconnect
The bootloader will present a different serial USB device than the main firmware's serial USB device, so it may get assigned a different serial port number in your OS, usually the next available one. For instance in Windows my Leonardo-compatible main firmware was assigned COM3 and the bootloader was assigned COM4.
A python script, courtesy of https://nicholaskell.wordpress.com/tag/leonardo/, for doing this serial 'knock':
reset.py:
#!/usr/bin/env python
import serial, sys
serialPort = sys.argv[1]
ser = serial.Serial(
port=serialPort,
baudrate=1200,
parity=serial.PARITY_NONE,
stopbits=serial.STOPBITS_ONE,
bytesize=serial.EIGHTBITS
)
ser.isOpen()
ser.close() # always close port
In Windows land, I have a cmd script for using this in a virtualenv
reset.cmd:
"C:\Program Files (x86)\Python37-32\Scripts\virtualenv.exe" pyreset_virtualenv
pyreset_virtualenv\Scripts\pip.exe install pyserial
pyreset_virtualenv\Scripts\python reset.py COM3
pause
adjust to suit your serial port and python path.
Either way, after getting the bootloader connected, you have a brief window of a couple of seconds where avrdude can connect to the new serial port to start programming before the bootloader will go into the main firmware again, at which point you'll have to do the reset again. So, once you figure out the bootloader serial port, you'll want to prepare the avrdude command line to run in advance, so you can launch it without delay after the reset.
While this answer isn't specific to the lilypad, you need to reset the board to write or read from/to the memory. However, If you are using avrdude in the terminal you must send a specific baudrate(1200 for the Leonardo) then close, wait 2 seconds, and open the port. At that point you can read and write to and from your Arduino. I achieved this using python.
Along the lines of:
Import serial
Import time
Import os
Seri=serial.Serial(yourConnectedPort, specificBaudRate)
Seria.close()
time.sleep(2)
Seri.open()
os.system(your avrdude command)

Resources