Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using Arduino Nano and ESP8266.

When I setup like the picture and connect Arduino Nano to PC by USB: enter image description here

The ESP8266 properly works. (Arduino Nano is just used as a bridge)

I print and read from serial with a C# program, it correctly works.

What I send from C# program:

AT+CWJAP="APN", "Pass"

The message from ESP:

AT+CWJAP="APN", "Pass"
OK

But, when I change the setup as follows:

  • Green wire (green wire on picture) to Arduino Digital2 pin
  • Red wire (red wire on picture) to Arduino Digital3 pin
  • Use Arduino code to read/write serial, instead of C# program
  • Create a software serial from code (esp8266 = SoftwareSerial(2, 3))

What I send from SoftwareSerial:

AT+CWJAP="APN", "Pass"

The message from ESP:

AT+CWJAP="APN", "Pass"
ERROR

Do you have any ideas? Why isn't the result on SoftwareSerial identical to Serial?

share|improve this question
    
What does "Green wire to D2" mean precisely? Ditto "Red wire to D3" - if these are components then explain where they are and what they do. – Andy aka Dec 24 '15 at 10:51
    
The green wire on picture (the wire that I previously connected to RX), and the red wire on picture (the wire that I previously connected to TX). – Burak Yavuzalp Dec 24 '15 at 10:53
    
D2, D3 - are these diodes dude? – Andy aka Dec 24 '15 at 10:55
    
Arduino Digital2 pin, Arduino Digital3 pin – Burak Yavuzalp Dec 24 '15 at 10:58
    
Totally off topic but have you considered using ESP as the arduino itself? You can use ESP-07 or ESP12 to get more GPIO pins and you can directly program the ESP using Arduino IDE. Here is more info on that topic. – Whiskeyjack Dec 24 '15 at 13:23

This is the info taken from arduino website:

The library has the following known limitations:

1) If using multiple software serial ports, only one can receive data at a time.

2) Not all pins on the Leonardo and Micro support change interrupts, so only the following can be used for RX: 8, 9, 10, 11, 14 (MISO), 15 (SCK), 16 (MOSI).

This has not explicitly mentioned the board you are using, but I think these limitations are on hardware level. Changing the software serial pins should most likely take care of this issue.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.