PiPyADC icon indicating copy to clipboard operation
PiPyADC copied to clipboard

Unable to open SPI device: No such file or directory

Open BirdingPix opened this issue 8 years ago • 2 comments

I finally am asking for a bit of help since I cannot solve this myself.

I get this error when running example.py (or benchmark.py): Unable to open SPI device: No such file or directory

The error occurs when executing this line in pipyadc: fd = wp.wiringPiSPISetupMode( conf.SPI_CHANNEL, conf.SPI_FREQUENCY, conf.SPI_MODE)

screen shot 2017-12-22 at 2 38 48 pm

The values are correct but unable to get past this error.
Pls offer some guidance... THANK YOU!

I know the Waveshare High-Precision AD/DA hardware is running ok as their little demo program works (sudo ./ads1256_test). but I need to run this within PYTHON environment.

thanks again for any help!
Dave Houston, TX

BirdingPix avatar Dec 22 '17 20:12 BirdingPix

Dear Dave,

this looks as if the Linux device file is missing - which could be a kernel configuration or kernel version issue.

Can you post the output of the following commands:

ls -l /dev/spi* grep "^dt.*" /boot/config.txt uname -a cat /etc/os-release lsmod

I do not have my Raspberry Pis with the ADC board at hand as I am on Christmas vacation for the next two weeks. Maybe I can borrow one from a friend for testing this. Maybe this is not even necessary.

Let us fix this before Christmas!

Best wishes, Ulrich

ul-gh avatar Dec 22 '17 22:12 ul-gh

Ulrich, THANK YOU so much for fast reply. I've continued working on it and just got it working! Even though the other test program worked... and raspi-config said SPI was ON... I changed the /boot/config.txt file to uncomment dtparam=spi=on andf also added dtoverlay=spi-bcm2835

Not sure which fixed it, but now for the first time... your example.py is working so I can progress!

THANK YOU! I'll keep you posted on my progress. Dave

BirdingPix avatar Dec 22 '17 22:12 BirdingPix