0
\$\begingroup\$

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?

asked Dec 24, 2015 at 10:47
\$\endgroup\$
5
  • \$\begingroup\$ 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. \$\endgroup\$ Commented Dec 24, 2015 at 10:51
  • \$\begingroup\$ 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). \$\endgroup\$ Commented Dec 24, 2015 at 10:53
  • \$\begingroup\$ D2, D3 - are these diodes dude? \$\endgroup\$ Commented Dec 24, 2015 at 10:55
  • \$\begingroup\$ Arduino Digital2 pin, Arduino Digital3 pin \$\endgroup\$ Commented Dec 24, 2015 at 10:58
  • \$\begingroup\$ 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. \$\endgroup\$ Commented Dec 24, 2015 at 13:23

1 Answer 1

1
\$\begingroup\$

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.

answered Dec 24, 2015 at 13:32
\$\endgroup\$

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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.