[Errno 6] VEML7700 No such device or address

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
YesApostrophe
 
Posts: 2
Joined: Tue Dec 08, 2020 1:54 pm

[Errno 6] VEML7700 No such device or address

Post by YesApostrophe »

Hello,

I have used the VEML7700 in the past on my RPi, and it worked wonderfully. Recently I booted up the same code on the same pi, and I am now getting an error. Here is the code:

Code: Select all

import RPi.GPIO as GPIO
import time
import os
import busio
import digitalio
import board
import adafruit_veml7700

i2c = busio.I2C(board.SCL, board.SDA)
veml7700 = adafruit_veml7700.VEML7700(i2c)
The error is thrown at the last line. Entire error shown below:

Code: Select all

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/adafruit_bus_device/i2c_device.py", line 172, in __probe_for_device
    self.i2c.writeto(self.device_address, b"")
  File "/usr/local/lib/python3.7/dist-packages/busio.py", line 116, in writeto
    return self._i2c.writeto(address, buffer, stop=stop)
  File "/usr/local/lib/python3.7/dist-packages/adafruit_blinka/microcontroller/generic_linux/i2c.py", line 49, in writeto
    self._i2c_bus.write_bytes(address, buffer[start:end])
  File "/usr/local/lib/python3.7/dist-packages/Adafruit_PureIO/smbus.py", line 308, in write_bytes
    self._device.write(buf)
OSError: [Errno 6] No such device or address

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/adafruit_bus_device/i2c_device.py", line 178, in __probe_for_device
    self.i2c.readfrom_into(self.device_address, result)
  File "/usr/local/lib/python3.7/dist-packages/busio.py", line 106, in readfrom_into
    return self._i2c.readfrom_into(address, buffer, stop=stop)
  File "/usr/local/lib/python3.7/dist-packages/adafruit_blinka/microcontroller/generic_linux/i2c.py", line 56, in readfrom_into
    readin = self._i2c_bus.read_bytes(address, end - start)
  File "/usr/local/lib/python3.7/dist-packages/Adafruit_PureIO/smbus.py", line 179, in read_bytes
    return self._device.read(number)
OSError: [Errno 6] No such device or address

During handling of the above exception, another exception occurred:

  File "garageTemp.py", line 17, in <module>
    veml7700 = adafruit_veml7700.VEML7700(i2c)
  File "/usr/local/lib/python3.7/dist-packages/adafruit_veml7700.py", line 205, in __init__
    self.i2c_device = i2cdevice.I2CDevice(i2c_bus, address)
  File "/usr/local/lib/python3.7/dist-packages/adafruit_bus_device/i2c_device.py", line 68, in __init__
    self.__probe_for_device()
  File "/usr/local/lib/python3.7/dist-packages/adafruit_bus_device/i2c_device.py", line 180, in __probe_for_device
    raise ValueError("No I2C device at address: %x" % self.device_address)
ValueError: No I2C device at address: 10
In my own troubleshooting, I've checked the solder and wiring (these worked before, so I am assuming they are OK now too, but still checked it). I've also checked to make sure the RPi sees the VEML7700 using i2cdetect. It does, as shown below (the correct address for the VEML7700 is 10):

Code: Select all

pi@raspberrypi:~ $ i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: 10 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
The 10 goes away when I disconnect the VEML7700, so I am pretty sure it's seeing it.

Not sure what to do. Any assistance is greatly appreciated!

User avatar
mikeysklar
 
Posts: 13936
Joined: Mon Aug 01, 2016 8:10 pm

Re: [Errno 6] VEML7700 No such device or address

Post by mikeysklar »

Your connections are most likely good with the device showing up in the i2c CLI scan.

You can try running the blinka test setup code to see if everything is good there.

Code: Select all

 import board
import digitalio
import busio

print("Hello blinka!")

# Try to great a Digital input
pin = digitalio.DigitalInOut(board.D4)
print("Digital IO ok!")

# Try to create an I2C device
i2c = busio.I2C(board.SCL, board.SDA)
print("I2C ok!")

# Try to create an SPI device
spi = busio.SPI(board.SCLK, board.MOSI, board.MISO)
print("SPI ok!")

print("done!")
It looks like your code is old in that it uses RPi.GPIO. It would probably be best to update the Pi OS and blinka to current level before troubleshooting any further.

https://learn.adafruit.com/circuitpytho ... spberry-pi

User avatar
YesApostrophe
 
Posts: 2
Joined: Tue Dec 08, 2020 1:54 pm

Re: [Errno 6] VEML7700 No such device or address

Post by YesApostrophe »

Thanks for the help! Here is the result of the blinka test before updating:

Code: Select all

Hello blinka!
Digital IO ok!
I2C ok!
SPI ok!
done!
Got the pi all upgraded to the latest installation, decided to do a clean install from scratch. Did update and upgrade after that, got the network and SSH set up, etc. Followed all the instruction installations in your link, and tried installing adafruit-cricuitpython-veml7700 separately but it said all the requirements were met.

Looks like I can now read the VEML7700. Thank you so much for your help!

User avatar
mikeysklar
 
Posts: 13936
Joined: Mon Aug 01, 2016 8:10 pm

Re: [Errno 6] VEML7700 No such device or address

Post by mikeysklar »

Great. Thank you for the confirmation that it was just a matter of getting everything up to date.

Locked
Please be positive and constructive with your questions and comments.

Return to “General Project help”