I'm using Megunolink to monitor and (hopefully) adjust variables of a modified version of this sketch https://github.com/ArduPilot/ardupilot/ ... Loiter.ino.
I connect Megunolink to the Arduino Uno sketch via a standard XBee shield and using SoftwareSerial "XBeeSerial". But the sketch also includes another SoftwareSerial connection "fcboardSerial" which connects the Uno to an Ardupilot Pixhawk controller via a wired serial connection.
I'm able to monitor the data produced by the sketch via the XBeeSerial connection but am unable to send any data from my interface panel to the sketch.
To find the problem, I started with a simple single SoftwareSerial XBeeSerial sketch. I discovered that as soon as I included the second SoftwareSerial connection (fcboardSerial), the data coming from the Megunolink interface panel stopped being recognized by the Arduino sketch.
Question: Are there any tricks I need to do in order to work with multiple SoftwareSerial connections.
UPDATE: OK I just read up about the Listen() function. I'll let you'all know if it helps.
Thanks
RoboBill
Multiple SoftwareSerials connections
Well it turns out that only one SoftwareSerial port can "listen" at any given time. So if the program was listening to the Pixhawk/fcboardserial port, it would never receive any data from my XBee/Megunolink interface panel port. There is the SoftwareSerialPort.listen() function, but given that I'm not a programmer and these serial ports seem to rely on complex internal interrupts, timers, etc, I decided to switch my uno to a mega where I can use real hardware serial ports ....
All is much better
Thanks
RoboBill
All is much better
Thanks
RoboBill