Go Down

Topic: Serial problems ESP8266  (Read 162 times) previous topic - next topic

wothke

I am trying to migrate a simple USB device from a "ProMini328+UART TTL CP2102" based impl to a "WeMos D1 mini pro" (I am using: esp8266/2.3.0/boards.txt) one. My respective device is plugged into some USB port and communicates with a Java application (which uses the jssc lib).


My existing old impl is tried and tested and the respective code works perfectly on the ProMini.

I already found these issues that I had to fix when using the esp8266 based configuration:
1) "serialEvent()" does not seem to be invoked and I had to add it to my "loop()"
2) PROGMEM based stuff seems to be a headache on the 32-bit platform so I removed it here
3) The D1 mini pro's USB adapter seems to use RTS where the CP2102 uses DTR: Fixed the Java application to avoid resetting the device..

Obviously the correct functioning of my Arduino code depends on the premise that no other (library) code is using Serial (e.g. to output debug messages, etc).  The only libs that I am using are: LiquidCrystal+, SPI, Wire

Unfortunately it seems that within the esp8266 context somebody else is writing to Serial - creating garbage data that messes up my communication protocol.


I see stuff like "@offsetG" and "rstI�useI,I+ooxmodeH3�" and it would be useful to know where that garbage comes from.. and ideas?

wothke

#1
Sep 20, 2017, 01:41 am Last Edit: Sep 20, 2017, 02:04 am by wothke
just found this: http://smallbits.marshall-tribe.net/blog/2016/11/13/esp8266-quiet-uart but the suggested hacks are not much use with a hard-wired PCB like the D1

I also tried system_set_os_print(0);  and   Serial.setDebugOutput(false); and these seem to help...

Go Up