1

Topic: Alternative Arduino SoftwareSerial library

Hello, I am a happy RemoteXY user and I congratulate you on the excellent work you have done.
I ran into a strange problem related to the arduino SoftwareSerial library that doesn't get along well with interrupts.
The problem is known and much discussed on the web: in many cases where the software serial and the i2c protocol are used, one of the two does not work well.
My case is an arduino nano connected to an ESP8266 with the SoftwareSerial and to an i2c oled display and an adafruit MLX90614 sensor always i2c.
I can read the sensor and send the data via RemoteXY but the display does not work, if I disable the software serial (and consequently RemoteXY) I can read the results on the display.
Some people who had similar problems, not with RemoteXY but only with the software serial, have solved it using the "AltSoftSerial Library".
I was wondering if there was a way to use this library instead of the standard "SoftwareSerial" with RemoteXY.
Sorry for my English!!!! (I used google translate ....)
Many thanks!!

2

Re: Alternative Arduino SoftwareSerial library

RemoteXY uses the standard SoftwareSerial library. All its features about which you write will also appear in the RemoteXY. This is a known issue. The best solution is to use a hardware serial to communicate with the ESP.
Also the SoftwareSerial.h is not compatible with:
- servo.h

We will explore the possibility of integrating with AltSoftSerial

3 (edited by arduquadsonarwii 2022-10-28 01:33:21)

Re: Alternative Arduino SoftwareSerial library

Hi, I just found RemoteXY, have not used it in any real test. But it looks exactly what I need for my quadcopter. But, when working with my code I found out that: 1. I got an error of multiple definition of vector_3 when compiling if I use softserial; 2. I got an error complaining multiple definition of vector_18 and 19 when compiling if I use hardwareserial because it conflicts with serial.cpp "openserial" function called in setup() inside multiwii.cpp. It appears once multiwii starts, the hardwareserial is opened. Looks like the only alternative is AltSoftSerial, It would be great if this is integrated into RemoteXY.

4

Re: Alternative Arduino SoftwareSerial library

The 3.1.10 library  beta version includes this feature. But the editor does not support now.
Link from github https://github.com/RemoteXY/RemoteXY-Ar … master.zip
The code for example

//////////////////////////////////////////////
//        RemoteXY include library          //
//////////////////////////////////////////////

// RemoteXY select connection mode and include library 
#define REMOTEXY_MODE__ALTSOFTSERIAL
#include <AltSoftSerial.h>

#include <RemoteXY.h>

// RemoteXY connection settings 
#define REMOTEXY_SERIAL_SPEED 9600


// RemoteXY configurate  
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =   // 19 bytes
  { 255,1,0,0,0,12,0,16,31,1,1,0,26,43,12,12,2,31,0 };
  
// this structure defines all the variables and events of your control interface 
struct {

    // input variables
  uint8_t button_1; // =1 if button pressed, else =0 

    // other variable
  uint8_t connect_flag;  // =1 if wire connected, else =0 

} RemoteXY;
#pragma pack(pop)

/////////////////////////////////////////////
//           END RemoteXY include          //
/////////////////////////////////////////////



void setup() 
{
  RemoteXY_Init (); 
  
  
  // TODO you setup code
  
}

void loop() 
{ 
  RemoteXY_Handler (); 
  
  // TODO you loop code
  // use the RemoteXY structure for data transfer
  // do not call delay() 

}