Writebyte and Readbyte esp QMC5883 on Python (Beaglebone Black) appear Errno 110

451 Views Asked by At

I could not find the suitable code for this BBB Python as many source codes would express more on Raspberry Pi and Arduino. I am using VMware and Ubuntu_18 to run the linux terminal in order to run my BBB.

This are my starting few lines code to try test on QMC5883 magnetometer that I'm trying to translate Arduino into Python version.

import Adafruit_GPIO.I2C as I2C
import math

QMC5883 = I2C.Device(0x0D, 1)
QMC5883.write8(0x0b,0x01)

However, the error keep appearing as following especially the writebyte and readbyte on the terminal BBB

root@beaglebone:~/user_python# python compass1.py
Traceback (most recent call last):
File "compass1.py", line 5, in <module>
QMC5883.write8(0x0b,0x01)
File "build/bdist.linux-armv7l/egg/Adafruit_GPIO/I2C.py", line 116, in write8
File "build/bdist.linux-armv7l/egg/Adafruit_PureIO/smbus.py", line 256, in write_byte_data
IOError: [Errno 110] Connection timed out]

The link that I'm following that to call the function is from this Adafruit_GPIO/I2C.py

Even using the smbus library the error still the same

import smbus

Anyone here know how to solve this Errno110 time out connection? I am looking forward for anyone to guide me throughout for BBB Python getting on QMC5883 magnetometer to function.

1

There are 1 best solutions below

0
On

Finally is one month plus and I found the solution for Beaglebone Black. Make some changes in the library code if possible to change in the library itself. Change the bus number from 1 to 2.

This GitHub link might help you https://github.com/RigacciOrg/py-qmc5883l to get your bearing degree (yaw rotation) in no time.