1 (edited by raitisgr 2018-03-05 07:22:00)

Topic: Setting different pins as RX/TX on MEGA to Serial1 pins 19RX an 18TX

Hello,
I am beginner on the Arduino and micro-controllers programming.
I faced in a problem during realization of my house automatisation project.
By plan I am willing to make as follows:
  1. set the communication between one central point(Arduno MEGA 2560 + ESP8266 ESP-01) with many secondary points(ESP8266 ESP-01) via local Ethernet connection.
  2. central point(Arduno MEGA 2560 with ESP8266 ESP-01) connected RemoteXY application via cloud.

So for 1.  I use WiFiEsp library examples WIFIClient and WIFIserver. And there I faced with limitation for MEGA, it should be connected via communication pins like Serial1 pins 19RX an 18TX. And I am willing to use same ESP module for sending the data to RemoteXY cloud.
  But in the RemoteXY sketch I can't set 19RX an 18TX, it dos not work with them.
   If there is possible to do it some hove, or what solution you could recommend?

Here is beginning of the RemoteXY code what I use:
      // определение режима соединения и подключение библиотеки RemoteXY 
      #define REMOTEXY_MODE__ESP8266_SOFTSERIAL_CLOUD
      #include <SoftwareSerial.h>
      #include <RemoteXY.h>

     //R: DHT:
      #include <SimpleDHT.h>

       // настройки соединения 
     #define REMOTEXY_SERIAL_RX 51
     #define REMOTEXY_SERIAL_TX 53
     #define REMOTEXY_SERIAL_SPEED 9600
     #define REMOTEXY_WIFI_SSID "xxxx"
     #define REMOTEXY_WIFI_PASSWORD "xxxx"
    #define REMOTEXY_CLOUD_SERVER "cloud.remotexy.com"
     #define REMOTEXY_CLOUD_PORT 6376
      #define REMOTEXY_CLOUD_TOKEN "xxxxx"

Thank you in advance for your help.

2 (edited by Guillaume 2018-03-05 13:38:21)

Re: Setting different pins as RX/TX on MEGA to Serial1 pins 19RX an 18TX

Welcome smile

You try to use SoftSerial on HardwareSerial pins. I suppose this is your problem, so try change the mode to REMOTEXY_MODE__ESP8266_HARDSERIAL_CLOUD, set REMOTEXY_SERIAL to Serial1 and remove REMOTEXY_SERIAL_RX and REMOTEXY_SERIAL_TX.

// определение режима соединения и подключение библиотеки RemoteXY
#define REMOTEXY_MODE__ESP8266_HARDSERIAL_CLOUD
#include <RemoteXY.h>
...
// настройки соединения  
#define REMOTEXY_SERIAL Serial1
#define REMOTEXY_SERIAL_SPEED 9600
...

You can change these options in the Editor.

3

Re: Setting different pins as RX/TX on MEGA to Serial1 pins 19RX an 18TX

Guillaume,
Thank You alot. Yes it is simply smile
Now it works!

regards,
Raitis