Hi,
I'd like to use 2 arduinos for monitoring, but I need you help to see if it is possible or not to make.
I have on computer a software that is named Mission planner that can be connected directly to an hardware card (PixHawk) by USB (that is transform into Serial).
The final goal of this project is to use Lora Modules to make the communication between Mission Planner and the PixHawk.
The first step for me is to do that without the Lora, only Serial communication:
To do that I use 2 arduinos (Mega and Duemilanove), two computers and a PixHawk (see image attached)
The first computer is running Mission planner and is connected to the Adruino Duemilanove with the Serial port (by the USB)
The Arduino Duemilanove is connected to the Arduino Mega with a SoftSerial named softSerialInterArduinos (on both Arduino it is SoftSerial)
3, The Arduino Mega is connected to the PixHawk with another SoftSerial named softSerialArdupilot
Questions:
A) Can I have 2 SoftSerials on Arduino Mega?
B) Can I have 1 SoftSerial on Arduino Duemilanove?
C) Doe the Serial communication is fullduplex?
D) Can it works
A few questions:
Where is the problem located; meaning does the 2nd PC echo the serial communications?
Is the Lora module you are planning to use able to handle the data rate you would need to send all the mission planning data?
The issue is: the communication between the 2 Arduinos does not work (softSerialInterArduinos), but I can see data received between PixHawk and Arduino Mega on softSerialArdupilot.
Theoretically the Lora module (2.4 Ghz if I need speed) is able to handle the data rate (Crossfire radio use Lora system 900 MHz / 2.4 Ghz and is able to manage it), I can go slower (9600), but of course I feel it will be a complete second projet to use the Lora module
May help, but you'll be disappointed. Only one receiving software serial will work. I haven't looked into it, but I suspect the root cause is blocking code. Watching an input for serial comms is time-intensive. You'll have to dig deeper, but I suspect if you really want multiple serial, you'd be better to use something like a Mega, which has multiple hardware serial ports. Others will likely have better advice.
C
Sorry, browsed your info further - why software serial for two ports on a Mega? I thought it had multiple hardware serial, which can be used independently?
I think that's your problem. You need to implement at least one of those using the actual ports on the Mega, not using soft serial.
Serial: 0 (RX) and 1 (TX); Serial 1: 19 (RX) and 18 (TX); Serial 2: 17 (RX) and 16 (TX); Serial 3: 15 (RX) and 14 (TX). Used to receive (RX) and transmit (TX) TTL serial data. Pins 0 and 1 are also connected to the corresponding pins of the ATmega16U2 USB-to-TTL Serial chip.