1

Topic: Help with Serial.Print

Hi,

My configuration is setup in WiFi AP mode, using an ESP8266, with an Uno.

Everything works as expected, turning on and off some LEDs.

For debugging, I would like to use the Serial.print function. However, when I do, the App refuses connections and errors, but as soon as I remove the Serial.print lines, the App works again.

Any advice?

Regards,

Christopher

2

Re: Help with Serial.Print

Hello Christopher,
how do you connect the ESP8266 to the UNO?

3

Re: Help with Serial.Print

Hi,

Thanks for replying.

The UNO and ESP8266 are connected via hardware serial on pins D0/RX and D1/TX.

Regards,

Christopher

4

Re: Help with Serial.Print

Hi,

could it be, that Serial.print corrupts this connection? Maybe you can use some software serial and print the debug messages this way.
As you only want to print, you don't need to worry about the restriction of the RX pin ( must be interrupt, if I remember it correctly )

Could you please post the code?
Regards

5

Re: Help with Serial.Print

Hi,

Yes, it is. I have switched to software serial on pins 2 & 3 and it now works properly. Further more, I can upload sketches without having to disconnect the ESP8266, after reading the comments on switching to a Mega (which has more Serial ports for use).

I had to use an AT command to set the ESP8266 to the lower baud rate before re configuring everything.

However, this moves into new problems, which I will post desperately shortly.

Regards,

Christopher

6

Re: Help with Serial.Print

Why not use the esp8266 as the main controller and the uno as an IO expander (if you really need it).

esp8266 is much faster and has much more memory than an uno or a mega, and you can upload sketch wirelessly...

7

Re: Help with Serial.Print

Hi Guillaume,

Thanks for the idea, Im not that confident yet, but learning rapidly. I decided when Corona virus hit, I needed to learn something, so I decided to learn Arduino!

Regards,

Christopher

8

Re: Help with Serial.Print

void setup()
{
   Serial.begin(115200); // Start the serial monitor.
  delay(20); // Give it a moment.
  // Connect to WiFi network:
  Serial.println("Connect to WiFi network");