WeatherHat problems and lack of knowledge!

I am struggling with the weatherhat and not being a Python wiz I have come to a violent stop with the following:-
therimin@raspberrypi:~/weatherhat-python/examples $ python3 weather.py
Traceback (most recent call last):
File “/home/therimin/weatherhat-python/examples/weather.py”, line 738, in
main()
File “/home/therimin/weatherhat-python/examples/weather.py”, line 698, in main
display = ST7789.ST7789(
File “/home/therimin/.local/lib/python3.9/site-packages/ST7789/init.py”, line 123, in init
self._spi = spidev.SpiDev(port, cs)
FileNotFoundError: [Errno 2] No such file or directory

This is fine for an expert but I am at a stand unsure of what to do next, any help would be appreciated. I down loaded the files as directed, so short of knowledge and being of advanced years would like some help please.
Dave

have you activated spi in raspi-config? If not, activate spi. If unsure, search for these terms.

Thank you, I will give it a go and see what happens.
Dave

Just to let you all know, I enabled SPI and wonder of wonders it all came to life, I cannot help thinking why did all of the information not mention that this needed to be enabled or why it was needed. As I am on a steep learning curve I would have never have discovered this without your assistance. Thank you it has saved me much head scratching.
Dave

It is mentioned.

Pre-requisites

This library requires Python ≥3.6 so we’d recommend using it with Raspberry Pi OS Buster or later.

You must enable:

  • i2c: sudo raspi-config nonint do_i2c 0
  • spi: sudo raspi-config nonint do_spi 0

You can optionally run sudo raspi-config or the graphical Raspberry Pi Configuration UI to enable interfaces.

I’m not intending to rub it in, etc. As it also says just below that,

  • Just run pip3 install weatherhat

Plus those of us that know the fix, have been there and done what you did.
And that error “No such file or directory” really throws you off first time around with this issue.
First time I got it was because I didn’t have i2c enabled. I did a lot of head scratching before I figured out what was up.

Hi.
I have managed to sort out the problems, most caused by lack of knowledge and programming skills I now have the weatherHat talking to the cloud running headless via adafruit io. my next task is to get the Pi to run without a Power supply from a battery backed up by a solar panel, has anyone a design or any info otherwise I will be re-inventing the wheel. I do have a Hat that uses a LIPO battery and controller but I need to charge the battery! as it runs down. Any ideas anyone.
Dave

1 Like

You need a special solar-charger. Available in the shop. The ones from Adafruit do a good job. There are multiple generations, pick the newest if possible.

Thanks I will have look to sort out the best way forward, I also need to get the barometer to read corrected pressure as it tracks about 12 points below my other barometers.
Dave

Do you correct the value from the BME280 for altitude? With correction, the pressure readings I have are very good.

Hi
I have looked at the readings and the pressure reading is some 12 points lower that my Vantage Vue which is set for our altitude above MSL we are 115 m above. I have looked at the program and see I can only alter the temperature. I am learning fast and have the feed going to adafruit.io which works well, I have also now set up a Pi 0 to free up that unit I have built up the rain/wind/direction and speed unit, now working on a solar supply backed with a battery so I can run the unit headless all the time. Well that’s the intention, and just download when I need to to the main computer. Thanks for the Help.

There is altitude correction code in this Enviro py file.
pimoroni-pico/micropython/examples/pico_enviro/enviro_all.py at main · pimoroni/pimoroni-pico (github.com)

Thanks. I will see if I can integrate it into the program for weather hat.