0

Ok so I've been trying to do this for quite some time now. Still couldn't get it to work. I am trying to read a ESP8266 WiFi program from a normal Arduino Uno program. I've seen some people do this:

#include <SoftwareSerial.h>

Then

SoftwareSerial esp8266(2,3);

Let me see a working example of this?

Thanks for everything.

closed as unclear what you're asking by gre_gor, jose can u c, VE7JRO, sempaiscuba, MatsK Oct 9 '18 at 19:31

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • it is an additional Serial interface called esp8266. You can print to it and read from it by Stream functions. What else? arduino.cc/reference/en/language/functions/communication/stream – Juraj Oct 8 '18 at 12:57
  • Thanks, so from what I perceive, Stream is a library? If it is, I would go include it. – W. Adrian Oct 8 '18 at 13:21
  • Stream is a common class from which Serial, SoftwareSerial and similar are derived – Juraj Oct 8 '18 at 13:29
  • 2
    You can't 'access code'. You can write sketches to communicate for example over Serial or SoftwareSerial. You connect the pins of Serial interfaces RX to TX and let sketch in one MCU read or parse what the sketch in other MCU sent over Serial with print or write. – Juraj Oct 8 '18 at 13:35
  • I am using this board: Link I bought the board from The WiFi shield is integrated with the board, so I think no need to connect the PINs? – W. Adrian Oct 8 '18 at 13:47
1

You can't 'access code'. You can write sketches to communicate for example over Serial or SoftwareSerial. You connect the pins of Serial interfaces RX to TX and let sketch in one MCU read or parse what the sketch in other MCU sent over Serial with print or write.

The onboar connection on Uno+WiFi board is over Serial. So you can't use USB and connection to esp8266 at the same time. But you could use SoftwareSerial like other use it with esp8266, if you connect some pins (for example 2 and 3) of Uno headers to Serial of esp8266 which is accessible on the esp8266 header on the board.

enter image description here

  • So in order to communicate because Arduino sketch and the ESP8266 sketch, I must [1] connect the TX and RX of Arduino to RX and TX of ESP8266 [2] use serial stream class to send and receive data between them Am I correct? – W. Adrian Oct 8 '18 at 14:24
  • RS and TX of esp8266 and Atmega are connected on board, if you set it on DIP switches. but then the connection to computer is out. all tutorials on Internet show you how to use SoftwareSerial to connect to esp8266 and have Serial connection over USB to computer. and you can achieve this SoftwareSerial connection with this board too. by wiring selected Atmega SoftwareSerial pins to RX and TX of esp8266 and setting the DIP switches to connect Serial of Atmega to computer over USB – Juraj Oct 8 '18 at 14:33
  • So does it mean, if I use SoftwareSerial, I must use the external connection as it is required by the SoftwareSerial library and it does not occupy the physical USB serial port so I can still connect the board to computer? If I don't want to use SoftwareSerial (and thus no need external wiring), what is the option I have to communicate between ESP8266 and Arduino sketches? – W. Adrian Oct 8 '18 at 14:41
  • Switches 1 and 2 connect Atmega to esp8266. I recommend you to use this SoftwareSerial connection for developing the sketch. otherwise you would have hard time always switching the DIP switches for upload of sketch and you could not have debug prints in Serial Monitor. – Juraj Oct 8 '18 at 14:49
  • A BIG thank you for your kind assistance and advice. I now have better understanding on how should I proceed. – W. Adrian Oct 8 '18 at 14:52

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