adafruit / adafruit/Adafruit_CircuitPython_BNO055

UART Timeout not implemented?

Open
#129 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
94
Forks
55
PR merge metrics
No merged PRs in 30d

Description

Hi! I've been profiling the bno055 over uart at baud of 115200. It holds steady at 15-20 ms read time, but ocassionally spikes to 100-200 ms. I attempted to use the inbuilt uart timeout with a value of 0.0001
uart = busio.UART(board.TX, board.RX, baudrate=115200,timeout=0.0001)
and got this crash report
Traceback (most recent call last):
File "code.py", line 349, in
File "adafruit_bno055.py", line 484, in linear_acceleration
File "adafruit_bno055.py", line 356, in mode
File "adafruit_bno055.py", line 843, in _read_register
TypeError: object of type 'NoneType' has no len()

line 349 of code.py is reading the linear_acceleration I commented out the linear_acceleration read and ran it again and got another crash
Traceback (most recent call last):
File "code.py", line 348, in
File "adafruit_bno055.py", line 454, in euler
File "adafruit_bno055.py", line 356, in mode
File "adafruit_bno055.py", line 843, in _read_register
TypeError: object of type 'NoneType' has no len()

line 348 of code.py is reading the euler angles.

It seems to me that the uart mode of the bno055 has no implemented timeout feature at the moment?

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the report with busio.UART at 115200 baud and timeout=0.0001, then inspect adafruit_bno055.py around _read_register at line 843 and the linear_acceleration and euler callers. Confirm how a timed-out UART read is represented; done means these reads no longer crash with a NoneType length error and the configured timeout behavior is preserved.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
embedded-iot
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.