Python3 Port of Old SkyWeather Software Dec 19, 2021 1:05:26 GMT -8 SDL, Powderjockey, and 1 more like this
Post by renegade on Dec 19, 2021 1:05:26 GMT -8
This is by no means complete, so far i have only ported the files and code that is currently installed on my development system which is raspberry Pi4b with USB direct boot on ssd to Ubuntu 20.4 server headless.
I have made many modification to the original code to add more sensors than the original files supported.
I do not use the stock MySQL database that comes with SkyWeather as i already had a database setup
so there is some MySQL commands commented out that may need to be put back if using the stock one.
I added a section in config.py for database selection, user id, and password. All calls for MySQL will
use these variables instead of being hard coded.
There are 2 more debug switches in config that will show the MySQL query string and the Weather Underground
My dev system is currently running this code with the following sensors attached as a service via the startserver.py and a cron job.
You need to install the pigpio-develop branch to make this work, on the regular branch it will fail.
Weather Rack is installed
I2C Mux - TCA9545 : Present
BME680 : Present
BMP280 : Not Present
SkyCam : Not Present
DS3231 : Not Present (system has DS3231 as sync to raspberry pi4b ubuntu kernel so not needed here)
HDC1080 : Not Present
SHT30 : Present
AM2315 : Not Present
ADS1015 : Not Present
ADS1115 : Present
AS3935 : Not Present
OLED : Present
SunAirPlus/SunControl : Not Present
SolarMAX : Not Present
VEML6070 UV Sensor : Not Present
SI1145 Sun Sensor : Not Present
TSL2591 Sun Sensor : Present
DustSensor : Not Present
WXLink : Not Present
Dual SolarMAX/WXLink : Not Present
UseBlynk : Not Present
UseMySQL : Present
Check WLAN : Not Present
WeatherUnderground : Present
UseWeatherStem : Not Present
It sends temperature and humidity readings to a local MySql database, and temp, humidity and wind speed/direction and rain reading to Weather Underground on a timed basis.
It is likely if you use this code and have other sensors attached shown here as not present there will need to be further porting of additional files, i can't trace for hardware i don't have to attach to my dev system so i only ported the files as they gave me errors. The most likely errors you will get is for print statements which need to be changed from print " test " to print ("test"), and invalid mix of tabs and spaces, which in notepad++ you need to turn all "view all symbols to see", all tabs should be replaced with 4 spaces but watch carefully because not all existing tabs are 4 spaces wide. In notepad++ space are shown as "periods or dots" while tabs are line arrows -->.
If anyone uses the files and makes further changes or needs help making changes please do it on github so we can end up with a copy that is fully ported in the end.
I am active porting so i will eventually hit every file in the directory at least when it comes to print statements and tabs/spaces.
Hopefully this helps someone out there that has the old system.
Here is the github repo