ekstrand / ESP8266wifi

ESP8266 Arduino library with built in reconnect functionality
MIT License
453 stars 236 forks source link

Errors in SoftwareSerial when combined #13

Closed TeaZee closed 8 years ago

TeaZee commented 8 years ago

A working sketch @115200 with SoftwareSerial (https://github.com/plerup/espsoftwareserial) reads garbage from the serial stream the moment "#include " is added to the sketch.

Just including the header file is enough to make the sketch fail to read the characters properly anymore.

cederberg commented 8 years ago

Probably one of these cause the issue:

#include <inttypes.h>
#include <avr/pgmspace.h>
#include "HardwareSerial.h"

Please try with them in orde to see which one fails.

TeaZee commented 8 years ago

Hmm,

include

include "HardwareSerial.h"

Do not effect the working of the sketch (that is: it remains correct)

include <avr/pgmspace.h>

Does not compile: "fatal error: avr/pgmspace.h: No such file or directory"

Note that including < ESP8266WiFi.h> results in bitrates above 19.200k to produce garbage. 19k2 works fine.

cederberg commented 8 years ago

Hmm... Could you make a copy of the header and try removing stuff until it unbreaks? I can't see anything serial-related except these three.

TeaZee commented 8 years ago

Yeah, i'll do some further investigating on what causes the malfunctioning. I will also try some includes.

Note that the issue is not serial related, since the softserial is "soft" because it doesn't use the UART. It reads and writes on IO pins using interrupts and timing. The trouble is therefore probably interrupt or maybe timing related. Could be an interrupt clash? A bit odd since it's just the header inclusion that already causes the issues.

I'll investigate further and let you know if it's really ESP8266Wifi or something else.