shadesofginger
Posts: 9
Joined: Tue Jun 28, 2016 9:42 pm

PI 3 & Jessie Serial Problems

Tue Jun 28, 2016 9:55 pm

I am trying to use the Adafruit BNO055 board using their provided python code. it keeps having trouble with the serial port and frantic googling and serveral wipe cleans and start agains haven't made it work as of yet. Here is a list of operations i have done (after wipe) in order
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
sudo rpi - update
sudo reboot
sudo nano /boot/config.txt (added dtoverlay=pi3-miniuart-bt at the end of file)
sudo reboot
sudo nano /boot/cmdline.txt (would have edited but didn't need to)
sudo systemctl disable hicuart
sudo reboot
sudo systemctl disable serial-getty@ttyAMA0.service
sudo reboot
then all adafuruit software downloaded using the guide on their website ( https://learn.adafruit.com/bno055-absol ... k/software ) however when i run the simpletest.py i get the error:
serial.serialutil.SerialExeption: could not open port /dev/ttyAMA0: [Errno 2] No such file or directory: '/dev/ttyAMA0'

what going on?!

User avatar
HawaiianPi
Posts: 5711
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: PI 3 & Jessie Serial Problems

Wed Jun 29, 2016 1:00 am

That's because the serial port on the Pi3 is being used by Bluetooth, and the GPIO serial pins are now connected to a mini-UART.

Try either of these (not both) in your config.txt file. Add the following and remove the "#" comment character from whichever one you want to try.

Code: Select all

# UART and Bluetooth settings for the Raspberry Pi3
#pi3-disable-bt	   #(turn off Bluetooth and restore serial0 UART)
#pi3-miniuart-bt     #(set Bluetooth to use the mini-UART and restore serial0 UART)
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

SonOfAMotherlessGoat
Posts: 690
Joined: Tue Jun 16, 2015 6:01 am

Re: PI 3 & Jessie Serial Problems

Wed Jun 29, 2016 1:09 am

And to make sure you're future proof, change the `/dev/ttyAMA0` references to `/dev/serial0`. It should be linked already for you in the meantime.
Account Inactive

Daveawalker
Posts: 20
Joined: Fri Apr 26, 2013 3:26 pm

Re: PI 3 & Jessie Serial Problems

Wed Jun 29, 2016 5:36 pm

This is a very important point.....
Try either of these (not both) in your config.txt file.
I had both, and it confused me I got coms when running a python script from the command line BUT it would not communicate when in autostart...

mwilson1207
Posts: 2
Joined: Sun Feb 10, 2013 12:35 am

Re: PI 3 & Jessie Serial Problems

Thu Jun 30, 2016 10:18 pm

I'm trying to use the same sensor with a raspberry pi zero and getting the following error:

Code: Select all

pi@raspberrypi:~ $ sudo python Adafruit_Python_BNO055/examples/simpletest.py 
Traceback (most recent call last):
  File "Adafruit_Python_BNO055/examples/simpletest.py", line 46, in <module>
    if not bno.begin():
  File "build/bdist.linux-armv6l/egg/Adafruit_BNO055/BNO055.py", line 382, in begin
  File "build/bdist.linux-armv6l/egg/Adafruit_BNO055/BNO055.py", line 358, in _config_mode
  File "build/bdist.linux-armv6l/egg/Adafruit_BNO055/BNO055.py", line 416, in set_mode
  File "build/bdist.linux-armv6l/egg/Adafruit_BNO055/BNO055.py", line 311, in _write_byte
  File "build/bdist.linux-armv6l/egg/Adafruit_BNO055/BNO055.py", line 267, in _serial_send
RuntimeError: Timeout waiting for serial acknowledge, is the BNO055 connected?
Do I need to do something differently for the pi zero?

objectR
Posts: 5
Joined: Mon May 23, 2016 4:18 am

Re: PI 3 & Jessie Serial Problems

Sat Jul 02, 2016 5:28 am

did this ever get solved? I am running into the same issue (pi 2 though)

Code: Select all

[Errno 2] No such file or directory: '/dev/ttyAMA0'

shadesofginger
Posts: 9
Joined: Tue Jun 28, 2016 9:42 pm

Re: PI 3 & Jessie Serial Problems

Sat Jul 02, 2016 4:10 pm

mwilson1207 wrote:I'm trying to use the same sensor with a raspberry pi zero and getting the following error:

Code: Select all

pi@raspberrypi:~ $ sudo python Adafruit_Python_BNO055/examples/simpletest.py 
Traceback (most recent call last):
  File "Adafruit_Python_BNO055/examples/simpletest.py", line 46, in <module>
    if not bno.begin():
  File "build/bdist.linux-armv6l/egg/Adafruit_BNO055/BNO055.py", line 382, in begin
  File "build/bdist.linux-armv6l/egg/Adafruit_BNO055/BNO055.py", line 358, in _config_mode
  File "build/bdist.linux-armv6l/egg/Adafruit_BNO055/BNO055.py", line 416, in set_mode
  File "build/bdist.linux-armv6l/egg/Adafruit_BNO055/BNO055.py", line 311, in _write_byte
  File "build/bdist.linux-armv6l/egg/Adafruit_BNO055/BNO055.py", line 267, in _serial_send
RuntimeError: Timeout waiting for serial acknowledge, is the BNO055 connected?
Do I need to do something differently for the pi zero?
I have tried both the config add ons and they are giving me this error too despite the board being connected as the Adafruit diagrams shows. thoughts?

objectR
Posts: 5
Joined: Mon May 23, 2016 4:18 am

Re: PI 3 & Jessie Serial Problems

Sat Jul 02, 2016 4:43 pm

solved my problem, had to modify the /boot/config.txt
from

Code: Select all

enable_uart = 0  
to

Code: Select all

enable_uart = 1   

shadesofginger
Posts: 9
Joined: Tue Jun 28, 2016 9:42 pm

Re: PI 3 & Jessie Serial Problems

Mon Jul 04, 2016 6:42 pm

tried changing to enable uart=1 and now all i get is a serial location error just as i stared with, any more suggestions?

Return to “Raspberry Pi OS”