ISM330DLC issues

CircuitPython on hardware including Adafruit's boards, and CircuitPython libraries using Blinka on host computers.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Post Reply
User avatar
Summertime2022
 
Posts: 1
Joined: Mon Jun 27, 2022 5:29 am

ISM330DLC issues

Post by Summertime2022 »

Hi, I'm really struggling in installing circuitpython on my set up. I can't believe it's this hard! I've got a raspberrypi 4b with ubuntu server 20.04 installed. Unfortunately I can't use a different OS as I am using this for ROS applications which require an ubuntu system. Could somebody please help me to diagnose the error messages when I run the imu_test.py script?
Many thanks in advance. pi@ubuntu:~/circuitpython$ sudo python3 imu_test.py
[sudo] password for pi:
Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/adafruit_bus_device/i2c_device.py", line 174, in __probe_for_device
self.i2c.writeto(self.device_address, b"")
File "/usr/local/lib/python3.8/dist-packages/busio.py", line 169, in writeto
return self._i2c.writeto(address, buffer, stop=stop)
File "/usr/local/lib/python3.8/dist-packages/adafruit_blinka/microcontroller/generic_linux/i2c.py", line 52, in writeto
self._i2c_bus.write_bytes(address, buffer[start:end])
File "/usr/local/lib/python3.8/dist-packages/Adafruit_PureIO/smbus.py", line 314, in write_bytes
self._device.write(buf)
OSError: [Errno 121] Remote I/O error

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/adafruit_bus_device/i2c_device.py", line 180, in __probe_for_device
self.i2c.readfrom_into(self.device_address, result)
File "/usr/local/lib/python3.8/dist-packages/busio.py", line 159, in readfrom_into
return self._i2c.readfrom_into(address, buffer, stop=stop)
File "/usr/local/lib/python3.8/dist-packages/adafruit_blinka/microcontroller/generic_linux/i2c.py", line 59, in readfrom_into
readin = self._i2c_bus.read_bytes(address, end - start)
File "/usr/local/lib/python3.8/dist-packages/Adafruit_PureIO/smbus.py", line 181, in read_bytes
return self._device.read(number)
OSError: [Errno 121] Remote I/O error

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "imu_test.py", line 9, in <module>
sensor = LSM6DSOX(i2c)
File "/usr/local/lib/python3.8/dist-packages/adafruit_lsm6ds/lsm6dsox.py", line 56, in __init__
super().__init__(i2c_bus, address, ucf)
File "/usr/local/lib/python3.8/dist-packages/adafruit_lsm6ds/__init__.py", line 225, in __init__
self.i2c_device = i2c_device.I2CDevice(i2c_bus, address)
File "/usr/local/lib/python3.8/dist-packages/adafruit_bus_device/i2c_device.py", line 61, in __init__
self.__probe_for_device()
File "/usr/local/lib/python3.8/dist-packages/adafruit_bus_device/i2c_device.py", line 183, in __probe_for_device
raise ValueError("No I2C device at address: 0x%x" % self.device_address)
ValueError: No I2C device at address: 0x6a
pi@ubuntu:~/circuitpython$

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

Re: ISM330DLC issues

Post by mikeysklar »

The errors all appear to be i2c based. Do you have i2c enabled? Can you get a functional i2cscan?

I would strongly recommend that you use a separate SD card to get your setup working with Raspbian Lite to verify the hardware connection and communication which are guides are based on. Once you get that worked out then you can switch back to your RTOS Ubuntu and work to correct any package incompatibilities.

User avatar
Summertime2022_
 
Posts: 4
Joined: Mon Jun 27, 2022 3:32 pm

Re: ISM330DLC issues

Post by Summertime2022_ »

Hi Mikey, thank you for responding so quickly. So my set up is ISM330DLC 6 axis IMU connected to MCP2221A usb to i2c converter to raspberry pi 4b. I've run an i2c scan and get the attached, where only 1 address shows up. Is there any additional configuration I need to carry out to detect the i2c address of the IMU? I've re-installed everything, Adafruit Blinka is installed, all of the relevant libraries and mpy-cross and the path has been set to access these. The MCP 2221a installed went ok so it's just the ISM330DLC which I need to figure out. Thanks again.
i2c_image.PNG
i2c_image.PNG (29.26 KiB) Viewed 94 times

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

Re: ISM330DLC issues

Post by mikeysklar »

Adafruit does not sell the ISM330DLC model only the ISM330DHCX and various LSM6DS variants. The DLC model is not listed in the adafruit_lsm6ds implementation notes for supported hardware.

https://docs.circuitpython.org/projects ... t/api.html

User avatar
Summertime2022_
 
Posts: 4
Joined: Mon Jun 27, 2022 3:32 pm

Re: ISM330DLC issues

Post by Summertime2022_ »

It's this one https://www.adafruit.com/product/4502. It's got a star on so it must be Adafruit, same for the MCP2221A, it's got a star on that too so it must be Adafruit...
Ok thanks anyway. It looks like I'll need to use an arduino to get this up and running.

User avatar
adafruit2
 
Posts: 21109
Joined: Fri Mar 11, 2005 7:36 pm

Re: ISM330DLC issues

Post by adafruit2 »

tbh we have never used ubuntu but it should work on a pi - please try raspbian lite?

User avatar
Summertime2022_
 
Posts: 4
Joined: Mon Jun 27, 2022 3:32 pm

Re: ISM330DLC issues

Post by Summertime2022_ »

Hello again! So I'm a bit clearer but also stuck. I've since acquired the LSM6DSOX IMU and have come across the same error message. I'm not trying to use the I2C as I have the IMU connected via usb to the raspberry pi 4b (using MCP2221a converter). So I realise this is serial communication and not I2C so my earlier confusion has been resolved at least. My next question is does Adafruit have test scripts or a library to receive sensor data over serial communication (for example from a usb port)? I've found some relevant examples using a BNO085 IMU, and have tried running this to no success. Of course the rvc module is sensor specific and I can't seem to find one that would be compatible with the LSM6DSOX? Is there any workaround for this? I am no getting raw USB information so the sensor is at least working, but these are just random symbols at this point. Hope you can help!! Thanks

User avatar
adafruit2
 
Posts: 21109
Joined: Fri Mar 11, 2005 7:36 pm

Re: ISM330DLC issues

Post by adafruit2 »

errh, really dont recommend you do that - just connect the sensor direct to the pi - we havent tested three layers of blinka compatiblity which is what you are trying to do?

Post Reply
Please be positive and constructive with your questions and comments.

Return to “Adafruit CircuitPython”