code-google-com / nxt-python

Automatically exported from code.google.com/p/nxt-python
GNU General Public License v3.0
1 stars 1 forks source link

Ultrasonic sensor: nxt.error.I2CError: read_value timeout #59

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. get a fresh install of nxt-python 2.2.2 working on Linux, connected to the 
brick via USB; the brick is running the latest leJOS firmware 0.9.1
2. check that the basic sensors (touch, sound) work nicely
3. then try accessing the ultrasonic sensor, even by running just:

#!/usr/bin/env python

import nxt.locator
from nxt.sensor import *
b = nxt.locator.find_one_brick()
ultrasonicSensor = Ultrasonic(b, PORT_3)

The output will be

Traceback (most recent call last):
  File "./test_ultrasonic.py", line 7, in <module>
    ultrasonicSensor = Ultrasonic(b, PORT_3)
  File "/usr/local/lib/python2.7/dist-packages/nxt/sensor/generic.py", line 95, in __init__
    super(Ultrasonic, self).__init__(brick, port, check_compatible)
  File "/usr/local/lib/python2.7/dist-packages/nxt/sensor/digital.py", line 73, in __init__
    sensor = self.get_sensor_info()
  File "/usr/local/lib/python2.7/dist-packages/nxt/sensor/digital.py", line 155, in get_sensor_info
    version = self.read_value('version')[0].split('\0')[0]
  File "/usr/local/lib/python2.7/dist-packages/nxt/sensor/digital.py", line 142, in read_value
    raise I2CError, "read_value timeout"
nxt.error.I2CError: read_value timeout

I believe that the leJOS firmware I am using is well stable (suggest 
differently otherwise) and I see that nxt-python had issues with the ultrasonic 
sensor before (e.g. issues no. 5 or 11). Perhaps the issue is still there.

In general, is the project still maintained? Thanks a lot.

Giacecco

Original issue reported on code.google.com by giace...@giacecco.com on 26 Aug 2013 at 2:13

GoogleCodeExporter commented 9 years ago
I get the same identical issue by using the trunk code.

Original comment by giace...@giacecco.com on 26 Aug 2013 at 2:19

GoogleCodeExporter commented 9 years ago
Solved by "downgrading" to LEGO's latest official firmware v1.31. Interestingly 
enough, the sound sensor also changed behaviour, with higher sampled values 
corresponding to higher noise rather than the other way round in leJOS.

Original comment by giace...@giacecco.com on 26 Aug 2013 at 3:32

GoogleCodeExporter commented 9 years ago
I have problems with certain firmwares. But in general works with Lejos 0.90 
and NXT 1.28 and 1.31.

Original comment by alan...@gmail.com on 14 Sep 2013 at 12:40