mini pitft not working after upgrade

Moderators: adafruit_support_bill, adafruit

Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/
User avatar
bill6460
 
Posts: 19
Joined: Tue May 26, 2020 5:54 pm

Re: mini pitft not working after upgrade

Post by bill6460 »

Code: Select all

pi@raspberrypi:~ $ ls /dev/i2c* /dev/spi*
ls: cannot access '/dev/spi*': No such file or directory
 /dev/i2c-1   /dev/i2c-2
pi@raspberrypi:~ $

User avatar
adafruit_support_carter
 
Posts: 29056
Joined: Tue Nov 29, 2016 2:45 pm

Re: mini pitft not working after upgrade

Post by adafruit_support_carter »

SPI is not enabled.
I have tried turning SPI on and off from raspi-config with the same results.
This should work, if you reboot after.

However, the install script should have done that as well. This step of the guide:
https://learn.adafruit.com/adafruit-min ... up-3044241
takes you here:
https://learn.adafruit.com/circuitpytho ... rypi-linux
which then has you run a script:
https://learn.adafruit.com/circuitpytho ... spberry-pi
that would have done the same thing.

So not sure why enabling SPI on your Pi is not working. Try via raspi-config again. Enable SPI. Reboot. And then check again with:

Code: Select all

ls /dev/i2c* /dev/spi*

User avatar
bill6460
 
Posts: 19
Joined: Tue May 26, 2020 5:54 pm

Re: mini pitft not working after upgrade

Post by bill6460 »

Thank you for your support. I did not expect this to take so long.

I did as the last post instructed and got the same result. I then created a folder /dev/spi and now I get this.

Code: Select all

Last login: Thu Jan 12 18:52:30 2023 from 192.168.8.178
pi@raspberrypi:~ $ ls /dev/i2c* /dev/spi*
/dev/i2c-1  /dev/i2c-2

/dev/spi:
pi@raspberrypi:~ $

User avatar
bill6460
 
Posts: 19
Joined: Tue May 26, 2020 5:54 pm

Re: mini pitft not working after upgrade

Post by bill6460 »

When I run the blinkatest.py I get this.

Code: Select all

Last login: Thu Jan 12 20:02:12 2023 from 192.168.8.178
pi@raspberrypi:~ $ python3 blinkatest.py
Hello blinka!
Digital IO ok!
I2C ok!
Traceback (most recent call last):
  File "/home/pi/blinkatest.py", line 16, in <module>
    spi = busio.SPI(board.SCLK, board.MOSI, board.MISO)
  File "/usr/local/lib/python3.9/dist-packages/busio.py", line 301, in __init__
    self._spi = _SPI(portId)
  File "/usr/local/lib/python3.9/dist-packages/adafruit_blinka/microcontroller/generic_linux/spi.py", line 25, in __init__
    self._spi = spi.SPI(device=(portid, 0))
  File "/usr/local/lib/python3.9/dist-packages/Adafruit_PureIO/spi.py", line 167, in __init__
    raise IOError("{} does not exist".format(device))
OSError: /dev/spidev0.0 does not exist
pi@raspberrypi:~ $

User avatar
adafruit_support_carter
 
Posts: 29056
Joined: Tue Nov 29, 2016 2:45 pm

Re: mini pitft not working after upgrade

Post by adafruit_support_carter »

I then created a folder /dev/spi and now I get this.

This will not work. The operating system needs to create the "folder", which it should if SPI is enabled via raspi-config and the system is rebooted. Please delete that folder.

It's a total mystery why raspi-config is not working.

Try running this command and post the output here:

Code: Select all

cat /boot/config.txt | grep spi

User avatar
bill6460
 
Posts: 19
Joined: Tue May 26, 2020 5:54 pm

Re: mini pitft not working after upgrade

Post by bill6460 »

I removed the spi dir. There was nothing in it.

Code: Select all

Last login: Thu Jan 12 21:27:40 2023 from 192.168.8.178
pi@raspberrypi:~ $ cat /boot/config.txt | grep spi
dtparam=spi=on
dtparam=spi=on
dtparam=spi=on
pi@raspberrypi:~ $

User avatar
bill6460
 
Posts: 19
Joined: Tue May 26, 2020 5:54 pm

Re: mini pitft not working after upgrade

Post by bill6460 »

And this has not changed

Code: Select all

Last login: Thu Jan 12 21:29:43 2023 from 192.168.8.178
pi@raspberrypi:~ $ ls /dev/i2c* /dev/spi*
ls: cannot access '/dev/spi*': No such file or directory
 /dev/i2c-1   /dev/i2c-2
pi@raspberrypi:~ $

User avatar
adafruit_support_carter
 
Posts: 29056
Joined: Tue Nov 29, 2016 2:45 pm

Re: mini pitft not working after upgrade

Post by adafruit_support_carter »

Did you try the suggestion to start over with a new OS image?

User avatar
bill6460
 
Posts: 19
Joined: Tue May 26, 2020 5:54 pm

Re: mini pitft not working after upgrade

Post by bill6460 »

Not yet. I made a traveling pi-hole using this https://learn.adafruit.com/pi-hole-ad-b ... -pi-zero-w and coupled it with a WIFI repeater / router that I use when I travel and I am leaving in a few days. That's what started all this. I did the update and upgrade as usual before a trip and the display stopped working. When I get time I will try to set it up on a new OS image. I am still unclear if Bullseye is supported at this time for the pi-hole project.

Thanks again for all the effort.

User avatar
bill6460
 
Posts: 19
Joined: Tue May 26, 2020 5:54 pm

Re: mini pitft not working after upgrade

Post by bill6460 »

I did a new install of ver raspberrypi-kernel 1:1.20220308~buster-1.
I did no updates or upgrades to this ver.

First I installed this project and the display worked fine.
https://learn.adafruit.com/adafruit-min ... spberry-pi

Then I followed the instructions for the pi-hole project and everything ran fine with no 404 errors.
https://learn.adafruit.com/pi-hole-ad-b ... mini-pitft
Pi Hole is running fine but the API to the Pi Hole is not working.
When I run stats.py I get this error.

Code: Select all

pi@raspberrypi:~ $ sudo python3 stats.py
Traceback (most recent call last):
  File "stats.py", line 97, in <module>
    DNSQUERIES = data['dns_queries_today']
TypeError: list indices must be integers or slices, not str
So I tried this code

Code: Select all

import json
import requests

api_url = 'http://localhost/admin/api.php'
r = requests.get(api_url)
data = json.loads(r.text)
print(data)
And I get this result.

Code: Select all

pi@raspberrypi:~ $ sudo python3 test3.py
[]

User avatar
adafruit_support_carter
 
Posts: 29056
Joined: Tue Nov 29, 2016 2:45 pm

Re: mini pitft not working after upgrade

Post by adafruit_support_carter »

Pi Hole is running fine but the API to the Pi Hole is not working.
This is a new issue that has recently cropped up due to changes with Pi-Hole now requiring authentication to access the API data (which is used for the stats info). It took a while to figure this out and the stats.py code and guide will need to be updated (this is in works). If you're willing to make some minor changes to the stats.py code, there is a fix you can try here:
viewtopic.php?p=955696#p955696

User avatar
bill6460
 
Posts: 19
Joined: Tue May 26, 2020 5:54 pm

Re: mini pitft not working after upgrade

Post by bill6460 »

That fixed it. Thank you.

User avatar
adafruit_support_carter
 
Posts: 29056
Joined: Tue Nov 29, 2016 2:45 pm

Re: mini pitft not working after upgrade

Post by adafruit_support_carter »

Cool, glad it worked. Thanks for letting us know.

Guide has now been updated. This affected both the OLED and TFT codes, both of which are now updated.

Locked
Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/

Return to “Adafruit Raspberry Pi® accessories”