I am now trying to connect my drone with ROS on pi 3b+. Ubuntu Mate 16.04 has been installed on the my Raspberry Pi 3B+.
The connection is fine when I connect them via a USB cable. However, I cannot receive anything from the cube when I connect them via TX/RX(GPIO) on pi and Telem2 on cube. I have checked my wiring is correct.
which I have added
on Mission Planner, I have set
BRD_SER2_RTSCTS = 0
SERIAL2_PROTOCOL = 1
SERIAL2_BAUD = 921
(I have also tried 57600)
in raspi-config, I disabled serial interfaces
When I type
roslaunch mavros apm.launch fcu_url:=/dev/ttyAMA0:921600
in the terminal, the plugins are loaded and initialized and MAVROS is started but got no heartbeat.
Hence I can’t receive a single echo from rostopic. It indicated there is no connection. I tried to screen ttyAMA0, ttyS0, and ttyprintk but nothing is transmitting. I wonder if the problem is on me or something is still not supported on pi 3b+?
I was thinking if I have forgot to install something but it doesn’t make sense since I can connect them perfectly on USB. My guessing is that maybe I missed some hardware settings in the pi.
PS: I have swapped the TX and RX for many times, almost once after every changes I have made.
PS. The answer is for Jessie, but it works too for Ubuntu Mate. Just forget the first step with raspi-config PS2 : Save your SD card on your computer before doing it, because a wrong setting case break the boot of the Raspberry Pi. If it’s the case, just reload the SD card with your backup.
I did not see any /dev/serial0 in my tty list. I guess S0 is equivalent.
I tried your solution.
The file system has been expanded and I disabled serial login shell and enabled serial interface.
I also removed
but still not working
I tried to modify the line as you mentioned. However, the error became “serial0 : receive : End of file” which made it even worse. I think setting the console at ttyAMA0 occupied the port.
I also discovered that after I run several trials, the telem port on the cube will become malfunctioned. I reset the parameters on the cube but it stop functioning soon after I launch mavros for a few times.
According to this:
I am not sure if the issue is related to the OS itself.