adafruit / Adafruit_CircuitPython_VEML7700

CircuitPython driver for VEML7700 high precision I2C ambient light sensor
MIT License
11 stars 8 forks source link

VEML7700 Not loading #4

Closed lesreaper closed 3 years ago

lesreaper commented 5 years ago

So, I'm using a Jetson Nano, which has identical GPIO pins to the Raspberry Pi.

When I load the sample code,I get an error from this line:

veml7700 = adafruit_veml7700.VEML7700(i2c)

The error is:

Traceback (most recent call last):
  File "light.py", line 15, in <module>
    veml7700 = adafruit_veml7700.VEML7700(i2c)
  File "/home/nvidia/.virtualenvs/deep_learning/lib/python3.6/site-packages/adafruit_veml7700.py", line 204, in __init__
    self.light_shutdown = False  # Enable the ambient light sensor
  File "/home/nvidia/.virtualenvs/deep_learning/lib/python3.6/site-packages/adafruit_register/i2c_bit.py", line 65, in __set__
    out_end=1, in_start=1, stop=False)
  File "/home/nvidia/.virtualenvs/deep_learning/lib/python3.6/site-packages/adafruit_bus_device/i2c_device.py", line 157, in write_then_readinto
    in_start=in_start, in_end=in_end, stop=stop)
  File "/home/nvidia/.virtualenvs/deep_learning/lib/python3.6/site-packages/busio.py", line 70, in writeto_then_readfrom
    in_start=in_start, in_end=in_end, stop=stop)
  File "/home/nvidia/.virtualenvs/deep_learning/lib/python3.6/site-packages/adafruit_blinka/microcontroller/generic_linux/i2c.py", line 63, in writeto_then_readfrom
    readin = self._i2c_bus.read_i2c_block_data(address, buffer_out[out_start:out_end][0], in_end-in_start)
  File "/home/nvidia/.virtualenvs/deep_learning/lib/python3.6/site-packages/Adafruit_PureIO/smbus.py", line 215, in read_i2c_block_data
    ioctl(self._device.fileno(), I2C_RDWR, request)
BlockingIOError: [Errno 11] Resource temporarily unavailable
Exiting... 
Cleaning up pins

If I do a scan on the I2C bus, I am getting [16], which seems to be a value on the bus.

print(i2c.scan())

Any idea what's going on here? Should I be selecting a specific bus? Is it getting data, but not able to manage the data? Kind of at a loss what the error means here..

kattni commented 4 years ago

@lesreaper Are you still experiencing this issue?

jposada202020 commented 3 years ago

@lesreaper Let me know if you still having this issue. thanks :)

jposada202020 commented 3 years ago

This was tested on

Adafruit CircuitPython 6.2.0-beta.3-188-g05ed179e1 on 2021-03-15; Adafruit Feather RP2040 with rp2040
>>> import veml7700_simpletest
Ambient light: 278
Ambient light: 272
Ambient light: 273

Work as expected

jposada202020 commented 3 years ago

Closing for now. was tested ok as previously mentioned