Hello all,
I am trying to read in a serial line from an xbee using an ESP8266. The problem I'm having is that the ESP8266 is transmitting just fine but will not receive. I am proving this to myself by printing a debug message to the serial port. The confusing thing is that the debug message is showing up on the ESP8266 Rx line and nothing is happening on the Tx line. Guaranteed I'm doing something dumb but I've been staring at it too long now to find it. Thanks for providing fresh eyes!
Code and pic of setup below
I am trying to read in a serial line from an xbee using an ESP8266. The problem I'm having is that the ESP8266 is transmitting just fine but will not receive. I am proving this to myself by printing a debug message to the serial port. The confusing thing is that the debug message is showing up on the ESP8266 Rx line and nothing is happening on the Tx line. Guaranteed I'm doing something dumb but I've been staring at it too long now to find it. Thanks for providing fresh eyes!
Code and pic of setup below
Code:
#include "ESP8266WiFi.h" #include "GFX4d.h" GFX4d gfx = GFX4d(); #include "weathervane_serial_2Const.h" // Note. This file will not be created if there are no generated graphics #include "SoftwareSerial.h" int direction = 0; int speed = 0; void setup() { gfx.begin(); gfx.Cls(); gfx.ScrollEnable(false); gfx.BacklightOn(true); gfx.Orientation(LANDSCAPE); // Change manually if the orientation change gfx.SmoothScrollSpeed(5); gfx.TextColor(WHITE, BLACK); gfx.Font(2); gfx.TextSize(1); gfx.Open4dGFX("WEATHE~1"); // Opens DAT and GCI files for read using filename without extension. // Note! Workshop generates files with Short filenames gfx.UserImage(iLeddigits1); // Leddigits1 show all digits at 0, only do this once gfx.UserImage(iLeddigits2); // Leddigits2 show all digits at 0, only do this once Serial.begin(115200, SERIAL_8N1); // initialize serial: } void loop() { if (Serial.available() > 0) // did anything show up in the buffer? { speed = Serial.read() - 48; // read the data in the buffer and write it to variable "speed" gfx.LedDigitsDisplay(speed, iiLeddigits1, 3, 1, 92, 0); // Leddigits1 gfx.LedDigitsDisplay(speed, iiLeddigits2, 2, 1, 76, 0); // Leddigits2 Serial.println(speed); delay(1000); } // test section to put something on the serial transmit line. lets alos view it on the display speed = 14; gfx.LedDigitsDisplay(speed, iiLeddigits1, 3, 1, 92, 0); // Leddigits1 gfx.LedDigitsDisplay(speed, iiLeddigits2, 2, 1, 76, 0); // Leddigits2 Serial.println(speed); delay(1000); speed = 7; gfx.LedDigitsDisplay(speed, iiLeddigits1, 3, 1, 92, 0); // Leddigits1 gfx.LedDigitsDisplay(speed, iiLeddigits2, 2, 1, 76, 0); // Leddigits2 Serial.println(speed); delay(1000); yield(); // Required for ESP }
Comment