1

I've been beating my head on the table for days trying to figure this out. For the life of me I cannot seem to get my Raspberry Pi 3 serial port to communicate with the Xbee Series 2.

I checked my /boot/cmdline.txt and there are no references to AMA0 in the file. Here is what is current in there:

dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=/dev/mmcblkOp2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait

EDIT: PI 3 does not AMA0. It uses S0. I've removed entry console=serial0,115200

Since this is the Jessie update, there is no inittab. In which I've read that I need to do the following (which I've done):

sudo systemctl stop serial-getty@AMA0.service
sudo systemctl disable serial-getty@AMA0.service
sudo systemctl mask serial-getty@AMA0.service

After doing all of this, I open up cutecom, set it to 9600 baud rate, read/write, 8 bit data, 1 bit stop, and set the device to /dev/ttyAMA0.

When I hit connect and type:

+++

to enter the configuration mode I get:

write returned 0 errno: 11
write : Resource temporarily unavailable

I'm not sure what I'm doing wrong here... I know that the Xbee is functional because I'm able to configure it using XCTU software via a serial-to-USB breakout board. But on the Pi connected via the GPIO serial pins I get no response.

Any ideas?

The Xbee is hooked up to a Spark Fun Xbee Regulated Explorer


I'm also having issues doing this with my Raspberry Pi 2 (Which is where the Pi 3 will be communicating to). On the Pi 2, I've edited the cmdline.txt file and removed references to AMA0:

dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblkOp2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait

And I've ran through the earlier mentioned systemctl commands on the Pi2.

Currently when I open a session using cutecom (S0 for Rpi3 AMA0 for Rpi2) I get no output. I type +++ in to the input line, I see the TX light blink on my Regulated Explorer but I get no output inside cutecom, nor any message in the terminal window.

techraf
  • 4,353
  • 10
  • 32
  • 43
Myg0t
  • 111
  • 10

1 Answers1

1

The Pi3 has swapped serial ports. /dev/ttyAMA0 is now used for Bluetooth. serial0 refers to the non-Bluetooth serial port which is on /dev/ttyS0 by default.

My experience if trying to use serial0 is not good. It works, but unreliably, although I have only tried using a serial to USB converter to a PC, and haven't tested extensively. From further reading the miniUART uses the "core clock" which can change with processor speed changes which may explain the problems. I have seen suggestions to fix the clock with:-

core_freq=250

EDIT I have since tried this and it seems to fix the problems. So far I can't see any downsides.

The miniUART is also limited - it only supports 8 data bits and has no parity as well as a smaller buffer.

If you don't use Bluetooth it is possible to swap the ports back in Device Tree. There is a pi3-miniuart-bt and pi3-disable-bt module.

EDIT I have now managed to get serial working to my satisfaction on Pi 3 and have documented this in How-do-i-make-serial-work-on-the-raspberry-pi3

Milliways
  • 62,573
  • 32
  • 113
  • 225