Communicating with Raspberry Pi 3b+

Hi

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.

I have followed the instructions from
http://ardupilot.org/dev/docs/raspberry-pi-via-mavlink.html


which I have added
enable_uart=1
dtoverlay=pi3-disable-bt
to /boot/config.txt

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.

Thank you for anyone who read my topic.

Have you tried /dev/serial0?

Hello,

I had the same problem. If I remember well, the port /ttyAMA0 is used by default for the Bluetooth. You need to disable it, to allow Serial COM.

Look at the second answer : https://raspberrypi.stackexchange.com/questions/45570/how-do-i-make-serial-work-on-the-raspberry-pi3-pi3b-pizerow

You have to change the following file :

/boot/cmdline.txt

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.

Thank you for your replies.

To Echo:
I did not see any /dev/serial0 in my tty list. I guess S0 is equivalent.

To KiloNovemberDelta:
I tried your solution.
The file system has been expanded and I disabled serial login shell and enabled serial interface.
I also removed
console=serial0,115200
from cmdline.txt
but still not working

In the cmdline.txt, you have to remove and then add (or check that parameters are set) :

dwc_otg.lpm_enable=0 console=tty1 console=serial0(or ttyAMA0),115200 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait

Besides, I don’t know if it changes something, but in my bash I use this command :
roslaunch mavros apm.launch fcu_url:=serial:///dev/ttyAMA0:115200

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.

Because I did this fix a year ago, I checked again in my Pi (with Ubuntu Mate), and I have this config :

in /boot/config.txt, I add at the end of the file :

dtoverlay=pi-disable-bt
enable_uart=1

And in /boot/cmdline.txt

dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles

If it is still not working, I don’t know where it can comes from, sorry :confused:

1 Like

I finally figured it out.

In /boot/config.txt,
dtoverlay=pi-disable-bt should be used instead of
dtoverlay=pi3-disable-bt

This seems make sense as I have seen some unofficial 3B+ adaption image/software tell you to replace the pi3 files with plain pi files. So looks like 3/3B files may not work 100% on 3B+.

After changing this, my ROS works fine with my Ubuntu Mate on pi
Thank you very much KiloNovemberDelta :slight_smile:

2 Likes

Hello!. I am communicating with Raspberry Pi 3B+ and I have read the instructions(the same with you). I can receive the tlogs, image.I am wondering can you get the dataflash?
image
the picture is captured in the Mission planner.
In windows OS, the SD card logs are like this

I think you will need to download it with some commands