Post Go back to editing

Reading out data through python not working [installation problems]

Thread Summary

The user is unable to access data from an ADXL313z accelerometer using Python on a Windows 11 system with WSL and a Blackfin eval-sdp-cb1z board. The final answer suggests using the ADXL313z-specific GUI software for quick evaluation or direct pin connections to a microcontroller or Raspberry Pi for more flexible control and raw data access. The user confirms the need for raw data and asks about boards with easier Python or Arduino access, to which the engineer recommends verifying the setup in the Linux software forum and potentially using a Raspberry Pi with the Kuiper Linux image.
AI Generated Content
Category: Software
Product Number: ADXL313

Hi, thanks in advance for any help:

Setup:

ADXL313z accelerometer sensor -> sdp interface board rev2 -> blackfin eval-sdp-cb1z -> usb -> computer

on my laptop: win11, python 10, vscode with ubuntu WSL active, venv active

The board is already shared to wsl: lsusb shows `Bus 001 Device 002: ID 0456:b630 Analog Devices, Inc. Blackfin USB Device`

Issue: I cannot get my python code to access the data from the sensor. It never finds the sensor.

Also iio_config does not seem to ever work (i suspect the problem is here)
Library version: 0.23 (git tag: v0.23)

Compiled with backends: local xml ip usb

Unable to create Local IIO context : No such file or directory (2)

What i tried(i tried alot):

sudo dpkg -i libiio-0.26.ga0eca0d-Linux-Ubuntu-22.04.deb

pip install pylibiio

pip install pyadi-iio

Current code:

import adi
# Create the device interface using the USB bus and device number
sdr = adi.adxl313(uri="usb:1.2")  # Bus 001, Device 002

# Read data from the device
data = sdr.rx()

# Print the data
print(data)
Parents Reply
  • Hi,

    "The other options you provide then need direct pin-connection to the ADX313 accelerometer board (and in this way not use the sdp interface board or eval cb1z board)? Is my understanding correct?" I would encourage you to verify this in the accelerometer forum or the linux or NoOs forum. But yes, for direct access to raw values you will need to put the SDP-B to one side and you will most likely need to wire directly from the microcontroller/RaspberryPi to your ADXL board.

    "To avoid a next mispurchase, is there a list of boards where the accelerometer data is easily accessible by (ideally) python or arduino? Or at least boards where the guides are a little more clear :) ?" I understand your frustration/disappointment here. Honestly, I haven't used an ADXL from Python. Do you have a Raspberry Pi? If you do, the most straightforward option may be to burn the Kuiper Linux image to an SD card, jumper wire to your board and try to access from Python. I'm making an assumption here that the linux drivers for the ADXL devices and other iio tools are pre-installed in Kuiper.
    Using pyadi-iio in python, you should be able to run this example - https://github.com/analogdevicesinc/pyadi-iio/blob/main/examples/adxl313_example.py
    You will need to figure out the uri to pass to the example.

    I would encourage you to double check this advice in the Linux software forum!

Children
No Data