0

I'm working on an Arduino Uno + ESP8266 project.

I try to use them as a web server on Wi-Fi network to control a motor that connects to Arduino - basically a trigger system that receives signals via Wi-Fi. Currently, I've successfully connected ESP8266 to my access point by sending AT commands from Arduino. Another client on the same network can statically access ESP8266's assigned IP address.

However, when I try to catch some HTTP queries (I want to use them as conditions to control the motor) I occasionally encountered the non-ASCII characters in HTTP request. I use serial comm to debug, please look at the screenshot in the link below:

Arduino - Computer serial communication for debugging

The line ",519:POST ..." should contain a complete number following "/?", but there's some strange characters instead. So I cannot determine the input data to control motor. Once in a blue moon, the expected format of request shows up as follows:

The correct data received

There's no issue with the HTTP response part, even though I got the uninterpretable request, I can still send the JSON error message back to client.

Attempt Note: The Arduino uses different serial ports to talk to computer and ESP8266. Since the connection can be established, and the data being sent, I believe that the baud rate is simply correct on both side. (115200 for ESP8266, 9600 for computer - also tried 115200 for both and got the same result)

I use V3.3 from Arduino as power source for ESP8266. But I also use voltage regulator to smooth out the current as many people suggest that. The problem still remains.

I'm struggled with this issue for a few days, just want to know if anybody had the similar experience, or could give some clue for the next step.

7
  • What's the hardware wiring? Do you have a logic level shifter between the Arduino and the ESP8266? Commented Apr 8, 2017 at 20:44
  • @MaximilianGerhardt simple wiring as below; Arduino->ESP8266 Pin2 -> RX Pin3 -> TX GND -> GND V5 -> CH_PD & Vcc (via V33 regulator with a common ground) The regulator is something like this adafruit.com/product/2165 Commented Apr 9, 2017 at 2:55
  • The Arduino Uno is a 5V volt device while the ESP8266 is a 3.3V volts device. You're risking to burn your ESP by putting 5V signals into it through your transmit pin. The transmit pin of the ESP will output its 3.3V logic level, which the arduino can still detect as a logic "1", however this configuration is not healthy. You need to convert the voltage levels (5V <--> 3.3V). Take a look at the schematic at youtube.com/watch?v=VDfI546YThQ&t=0m48s and buy a bidirectional logic shifter. Commented Apr 9, 2017 at 11:59
  • You point makes sense. Let me try adding the logic level shifter and get back to you. Commented Apr 10, 2017 at 1:57
  • I put a bidirectional logic level (3V and 5V) between RX/TX of Arduino and ESP8266 and it seems a bit better - like 60-70% requests are readable from 40-50%, previously. But it's still inconsistent. Is it because I use 5V and 3.3V from Arduino itself as supplying voltages for the whole circuit? I switched to 12v once and completely burnt the ESP8266 even though I use the 3.3V regulator to cut down the voltage. If the insufficient current is the issue, I'll try to look for an external 5v supply. Commented Apr 10, 2017 at 14:42

1 Answer 1

0

After a considerable effort to stabilize the circuit, I switched to NodeMCU and got the system working perfectly. I assume that ESP8266 alone is somehow not robust enough without other components, which I unfortunately have no knowledge on. So I'd like to close this thread with a short recommendation for anybody struggling with the same issue to switch to NodeMCU (which would replace both Arduino and ESP8266); if that could support the requirement.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.