I am trying to get Serial2 connected to an ESP8266 wifi module, and in turn talk to RemoteXY
I am using this simple pushbutton/led sketch to test the connection.
If I use Serial1 (pins 0,1) it works fine, however, compiled for Serial2 (as above), and using pins 9/10, it doesn't work, and the RemoteXY app reports "Error: (61) Connection refused"
Is there anything I have to do to enable Serial2 on those pins ??
I am using this simple pushbutton/led sketch to test the connection.
Code:
//////////////////////////////////////////////
// RemoteXY include library //
//////////////////////////////////////////////
// RemoteXY select connection mode and include library
#define REMOTEXY_MODE__ESP8266_HARDSERIAL_POINT
#include <RemoteXY.h>
// RemoteXY connection settings
#define REMOTEXY_SERIAL Serial2
#define REMOTEXY_SERIAL_SPEED 115200
#define REMOTEXY_WIFI_SSID "TeensyTest"
#define REMOTEXY_WIFI_PASSWORD "12345678"
#define REMOTEXY_SERVER_PORT 6377
// RemoteXY configurate
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =
{ 255,1,0,1,0,19,0,8,13,0,
1,0,17,19,12,12,2,31,88,0,
65,4,48,20,9,9 };
// this structure defines all the variables of your control interface
struct {
// input variable
uint8_t button_1; // =1 if button pressed, else =0
// output variable
uint8_t led_1_r; // =0..255 LED Red brightness
// other variable
uint8_t connect_flag; // =1 if wire connected, else =0
} RemoteXY;
#pragma pack(pop)
/////////////////////////////////////////////
// END RemoteXY include //
/////////////////////////////////////////////
// **********************************************************************
void setup() {
RemoteXY_Init ();
} // end setup
// ***********************************************************************
// LOOP
// ***********************************************************************
void loop() {
RemoteXY_Handler ();
RemoteXY.led_1_r = RemoteXY.button_1 * 255;
delay(25);
} // void(loop)
If I use Serial1 (pins 0,1) it works fine, however, compiled for Serial2 (as above), and using pins 9/10, it doesn't work, and the RemoteXY app reports "Error: (61) Connection refused"
Is there anything I have to do to enable Serial2 on those pins ??