AttributeError: 'SMBus' object has no attribute 'timeout'

userHead Nikita.Nagar 2024-01-29 15:31:43 307 Views0 Replies

I am interfacing the huskylens with raspberry pi5.

Here is the code:

 

from huskylib import HuskyLensLibrary
import huskylib

hl = HuskyLensLibrary("I2C","",address=0x32)
print(hl.knock())         # To ensure that device has connected and can communicate.        
print(hl.count())         # Number of faces in the frame

 

while True:

   face_detection = hl.requestAll() # Return all block/arrows data
   face = hl.algorthim("ALGORITHM_OBJECT_RECOGNITION")
   print(face)

   for face_detection in face_detection:
       if face_detection.learned == True:
           print("Known Face!")
     

 

and it's output is :

 

['55aa', '11', 0, '2e', [], '3e']
Knock Recieved
['55aa', '11', 10, '29', '01000100600700000000', 'ac']
1
['55aa', '11', 10, '29', '01000100600700000000', 'ac']
['0000', '00', 0, '00', [], '00']
Traceback (most recent call last):
 File "/home/pi/Codes/huskylib.py", line 178, in processReturnData
   numberOfBlocksOrArrow = int(commandSplit[4][2:4]+commandSplit[4][0:2],16)
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/Codes/huskylens_demo.py", line 13, in <module>
   face = hl.algorthim("ALGORITHM_OBJECT_RECOGNITION")
 File "/home/pi/Codes/huskylib.py", line 384, in algorthim
   return self.processReturnData()
 File "/home/pi/Codes/huskylib.py", line 214, in processReturnData
   self.huskylensSer.timeout=5
AttributeError: 'SMBus' object has no attribute 'timeout'

 

How to solve it?