Husky "Error: SMBus object has no attribute 'timeout'

userHead Bill.James 2023-02-09 02:52:03 1576 Views5 Replies

We are trying to read April Tags using the following 

from huskylib import HuskyLensLibrary

 

husky = HuskyLensLibrary("I2C","", address=0x32)

husky.algorthim("ALGORITHM_TAG_RECOGNITION")

print("Show tag now...")

 

while(True):

    data = husky.blocks()

    for tag in data:

        print("Tag: {}, {}, {}".format(tag.ID, tag.height, tag.width))

 

We are getting the error: 

 

Traceback (most recent call last):
 File "/home/pi/Component/huskylib.py", line 178, in processReturnData
   numberOfBlocksOrArrow = int(
TypeError: int() can't convert non-string with explicit base

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
 File "/home/pi/Component/husky.py", line 4, in <module>
   husky.algorthim("ALGORITHM_TAG_RECOGNITION")
 File "/home/pi/Component/huskylib.py", line 387, in algorthim
   return self.processReturnData()
 File "/home/pi/Component/huskylib.py", line 217, in processReturnData
   self.huskylensSer.timeout=5
AttributeError: 'SMBus' object has no attribute 'timeout'

 

We have tried:

pip install pysmbus

pip install pysmbus --upgrade

pip install smbus --upgrade
sudo apt install python3-smbus -y
sudo apt install python-smbus -y


 

 
2024-02-01 16:28:59

Hey Everyone, I am facing the same issue. Can anyone tell how to solve it ?

userHeadPic Nikita.Nagar
Nikita.Nagar wrote:

exampleHL.py is also not working when I am calling the algorithm.

2024-02-01 16:30:35
1 Replies
2023-04-18 10:41:54

Does exampleHL.py work properly? (I use Raspberry Pi 3B, python3.9, version 5.15.32. It's recommended to add sudo before the pip command.)

userHeadPic jenna
2023-04-16 23:12:26

Hi, 

 

I am experiencing the same problem as Bill.James. I am using a raspberry 4B with raspberry Pi OS 32bits. 

 

My python version is 3.9.2.

 

Is there any solution to use this library in a raspberry?

 

Best regards, 

userHeadPic Nico.BrM
2023-02-20 10:51:20

Hi

Sorry for the inconvenience. 

Could you please try updating python to v3.9?

The SMBus library for Raspberry Pi is not good. We will update this library soon.

Hope it can help.

userHeadPic NeloKin