slackspace-io / seneye-python

python scripts to read Seneye
0 stars 1 forks source link

usb.core.USBError: [Errno 110] #2

Open rjsears opened 4 years ago

rjsears commented 4 years ago

Looks like it starts to work, Seneye SUD plugged in and visable, but then something times out:

root tankpi: tank_monitor # python seneye.py DEBUG ('device >>>', <DEVICE ID 24f7:2204 on Bus 001 Address 008>) ('configuration>>>', <CONFIGURATION 1: 250 mA>) ('interface >>>', <INTERFACE 0: Human Interface Device>) ('endpoint in >>>', <ENDPOINT 0x81: Interrupt IN>) ('endpoint out >>>', <ENDPOINT 0x1: Interrupt OUT>) ('HELO ret code>>>', 8) ('HELO hex >>>', (<type 'array.array'>, 64, '77:01:01:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00')) ('HELO hex >>>', (<type 'array.array'>, 64, '4b:cd:fe:31:a8:5a:d4:aa:e0:8e:54:1b:87:6d:18:25:8b:4a:cc:db:23:62:c1:0c:ba:87:c1:a8:21:9e:95:3d:6f:93:7b:d3:fe:97:6d:ac:56:07:67:ce:91:ec:9d:b2:5c:15:89:ee:dd:50:89:16:8c:fd:d8:90:8f:3e:0c:2d')) ('HELO hex >>>', (<type 'array.array'>, 64, '88:01:01:03:32:75:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00')) good response ('READ ret code>>>', 7) ('sensor hex >>>', (<type 'array.array'>, 64, '00:02:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00')) ('sensor bits len>', 512) ('sensor bits >>>', '00000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000') ('sensor hex >>>', (<type 'array.array'>, 64, '88:02:01:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00')) ('sensor bits len>', 512) ('sensor bits >>>', '10001000000000100000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000') Traceback (most recent call last): File "seneye.py", line 171, in main() File "seneye.py", line 161, in main read_results=read_sud(dev,epIn,epOut) File "seneye.py", line 84, in read_sud read_read=dev.read(epIn,epIn.wMaxPacketSize) File "/usr/local/lib/python2.7/dist-packages/usb/core.py", line 988, in read self.get_timeout(timeout)) File "/usr/local/lib/python2.7/dist-packages/usb/backend/libusb1.py", line 851, in intr_read timeout) File "/usr/local/lib/python2.7/dist-packages/usb/backend/libusb1.py", line 936, in read _check(retval) File "/usr/local/lib/python2.7/dist-packages/usb/backend/libusb1.py", line 595, in _check raise USBError(_strerror(ret), ret, _libusb_errno[ret]) usb.core.USBError: [Errno 110] Operation timed out

slackspace-io commented 4 years ago

Hey, sorry never saw this comment :) didn't realize anyone else ever use this code.

Did you get it resolved? If not, I can see my local copy is a bit different than the one in github. I can update github and try again. However, I think I only added some code to make the rasberrypi reboot if it failed to post to web. (Have had an issue with the rasberrypi 'freezing' up randomly after running a while.

There is logic to repeat reads until successful, but seems it times out trying to read. First inclination is to either catch that in exception handling so it will try multiple times still and/or add increase timeout time.

I'm using a rasberry pi with following version: Linux raspberrypi 4.14.30-v7+ #1102 SMP Mon Mar 26 16:45:49 BST 2018 armv7l GNU/Linux

here is my output running:

`root@raspberrypi:/home/dopey# python bin/seneye-pi.py ('device >>>', <DEVICE ID 24f7:2204 on Bus 001 Address 007>) ('configuration>>>', <CONFIGURATION 1: 250 mA>) ('interface >>>', <INTERFACE 0: Human Interface Device>) ('endpoint in >>>', <ENDPOINT 0x81: Interrupt IN>) ('endpoint out >>>', <ENDPOINT 0x1: Interrupt OUT>) ('HELO ret code>>>', 8) ('HELO hex >>>', (<type 'array.array'>, 64, '77:01:01:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00')) ('HELO hex >>>', (<type 'array.array'>, 64, '88:01:01:03:30:4e:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00')) good response ('READ ret code>>>', 7) ('sensor hex >>>', (<type 'array.array'>, 64, '00:02:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:02:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00')) ('sensor bits len>', 512) ('sensor bits >>>', '00000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000') ('sensor hex >>>', (<type 'array.array'>, 64, '88:02:01:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00')) ('sensor bits len>', 512) ('sensor bits >>>', '10001000000000100000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000') ('BYE ret code >>>', 6) {'InWater': True, 'NH3': 0.0, 'SlideExpired': False, 'SlideNotFitted': True, 'Temp': 24.75, 'pH': 8.0} {"value": 1088895.0, "measurement": "uptime"} {"value": 8.0, "measurement": "pH"} {"value": 0.0, "measurement": "NH3"} {"value": 24.75, "measurement": "Temp"} {"status": true, "name": "InWater"} {"status": true, "name": "SlideNotFitted"} {"status": false, "name": "SlideExpired"} I will not reboot root@raspberrypi:/home/dopey#

`