Ah I believe that’s the missing piece!!!
The main script, SkyWeather2.py, checks to see if the camera is functional and sets a flag named Camera_Present to either True or False. The value is used to determine if a job should be added to the background scheduler to take pictures.
Unfortunately, the code to send data to WeatherSTEM is part of the script that takes the pictures. Unless you’re willing to make changes to SkyWeather2.py and SkyCamera.py, you won’t be able to send data to WeatherSTEM.
Thanks,
Jason
Hi Jason,
Thanks for the clarification. I borrowed a camera from an acquaintance. Now, when I run "sudo python3 SkyWeather2.py", I get:
./SkyWeather2.JSON File exists
using updateWebConfig
##########################################################
SkyWeather2 Weather Station Version 027.6 - SwitchDoc Labs
Program Started at:2022-12-11 14:25:32
##########################################################
Starting pigpio daemon
b''
b''
Pi Camera Revision imx219
----------------------
BMP280: Present
SkyCam: Present
OLED: Not Present
SunAirPlus/SunControl: Not Present
SolarMAX: Not Present
DustSensor: Not Present
UseBlynk: Disabled
UseWSLIGHTNING: Enabled
UseWSAQI: Disabled
UseWSSKYCAM: Disabled
UseMySQL: Enabled
UseMQTT: Disabled
Check WLAN: Not Present
WeatherUnderground: Not Present
UseWeatherStem: Present
----------------------
-----------------
Scheduled Jobs
-----------------
Jobstore default:
######
patTheDog (trigger: interval[0:00:20], next run at: 2022-12-11 14:26:06 +03)
readWiredSensors (trigger: interval[0:00:30], next run at: 2022-12-11 14:26:16 +03)
tick (trigger: interval[0:01:00], next run at: 2022-12-11 14:26:46 +03)
printState (trigger: interval[0:01:00], next run at: 2022-12-11 14:26:46 +03)
takeSkyPicture (trigger: interval[0:01:00], next run at: 2022-12-11 14:26:46 +03)
barometricTrend (trigger: interval[0:15:00], next run at: 2022-12-11 14:40:46 +03)
writeWeatherRecord (trigger: interval[0:15:00], next run at: 2022-12-11 14:40:46 +03)
writeITWeatherRecord (trigger: interval[0:15:00], next run at: 2022-12-11 14:40:46 +03)
cleanPictures (trigger: cron[day='*', hour='3', minute='4'], next run at: 2022-12-12 03:04:00 +03)
cleanTimeLapses (trigger: cron[day='*', hour='3', minute='10'], next run at: 2022-12-12 03:10:00 +03)
buildTimeLapse (trigger: cron[day='*', hour='5', minute='30'], next run at: 2022-12-12 05:30:00 +03)
rebootPi (trigger: cron[day='5-30/5', hour='0', minute='4'], next run at: 2022-12-15 00:04:00 +03)
-----------------
starting 433MHz scanning
######
Processing F016TH data
This is the raw data: {"time" : "2022-12-11 14:25:51", "model" : "SwitchDoc Labs F016TH Thermo-Hygrometer", "device" : 58, "modelnumber" : 5, "channel" : 6, "battery" : "OK", "temperature_F" : 74.700, "humidity" : 53, "mic" : "CRC", "mod" : "ASK", "freq" : 433.994, "rssi" : -0.107, "snr" : 18.534, "noise" : -18.642}
Indoor Weather Sensors Found
Processing F016TH data
This is the raw data: {"time" : "2022-12-11 14:26:01", "model" : "SwitchDoc Labs F016TH Thermo-Hygrometer", "device" : 152, "modelnumber" : 5, "channel" : 3, "battery" : "OK", "temperature_F" : 73.500, "humidity" : 52, "mic" : "CRC", "mod" : "ASK", "freq" : 433.988, "rssi" : -0.102, "snr" : 19.417, "noise" : -19.520}
------Patting The Dog-------
Processing F016TH data
This is the raw data: {"time" : "2022-12-11 14:26:14", "model" : "SwitchDoc Labs F016TH Thermo-Hygrometer", "device" : 143, "modelnumber" : 5, "channel" : 8, "battery" : "OK", "temperature_F" : 73.700, "humidity" : 53, "mic" : "CRC", "mod" : "ASK", "freq" : 433.991, "rssi" : -0.119, "snr" : 16.774, "noise" : -16.894}
Processing F016TH data
This is the raw data: {"time" : "2022-12-11 14:26:17", "model" : "SwitchDoc Labs F016TH Thermo-Hygrometer", "device" : 174, "modelnumber" : 5, "channel" : 8, "battery" : "OK", "temperature_F" : 73.300, "humidity" : 54, "mic" : "CRC", "mod" : "ASK", "freq" : 433.993, "rssi" : -0.134, "snr" : 20.249, "noise" : -20.383}
------Patting The Dog-------
Tick! The time is: 2022-12-11 14:26:46.890708
-------------
Current State
-------------
-------------
latest MainSensor Reading= Never
MainDeviceNumber= 182
OutdoorTemperature = 0.0
OutdoorHumidity = 0.0
latest Indoor Sensor Reading= 2022-12-11 14:26:17
IndoorDeviceNumber= 8
IndoorTemperature = 22.94
IndoorHumidity = 54
Rain60Minutes = 0.0
SunlightVisible = 0.0
SunlightUVIndex = 0.0
WindSpeed = 0
WindGust = 0
WindDirection = 0.2
TotalRain = 0
BarometricTemperature = 32.79
BarometricPressure = 101.77794
Altitude = 626.0
BarometricPressureSeaLevel = 109.67595
BarometricTemperature = 32.79
barometricTrend = True
pastBarometricReading = 0
AQI = 0.0
Hour24_AQI = 0.0
WS_AQI = 0.0
WS_Hour24_AQI = 0.0
Main Battery Status = OK
CPU Temperature = 0.0
Serial Number = 0
RSSI = 0.0
SNR = 0.0
NOISE = 0.0
-------------
runRainbow = False
flashStrip = False
runOLED = True
-------------
Last_Event = My Last Event
-------------
batteryVoltage 0
batteryCurrent 0
solarVoltage 0
solarCurrent 0
loadVoltage 0
loadCurrent 0
batteryPower 0
solarPower 0
loadPower 0
batteryCharge 0
SolarMAX Inside Temperature 0.0
SolarMAX Inside Humidity 0.0
SolarMAX Last Received Never
-------------
-------------
-------------
fanState = False
-------------
------Patting The Dog-------
--------------------
SkyCam Picture Taken
--------------------
mySkyCameraText= SkyWeather2 V027.6 11-Dec-2022 14:26:49 Wind Speed: 0.0KPH Wind Gust: 0.0KPH Temp: 0.0 C
query= INSERT INTO SkyCamPictures (cameraID, picturename, picturesize, messageID, resends,resolution) VALUES('SkyCamPi', 'SkyCamPi_1_2022-12-11-14-26-50.jpg', 130452, 1, 0, 0 )
--------------------
SkyCam Package Sending
--------------------
API Key: <<API KEY>>
------->Sea Level 1096.7661
The pastebin URL is (r.text):{"internal":{"record":1670758013,"readings":"[{\"units\":\"C\",\"value\":0,\"name\":\"OutsideTemperature\"},{\"value\":0,\"units\":\"%\",\"name\":\"OutsideHumidity\"},{\"name\":\"InsideTemperature\",\"units\":\"C\",\"value\":22.94},{\"value\":54,\"units\":\"%\",\"name\":\"InsideHumidity\"},{\"value\":0,\"units\":\"mm/h\",\"name\":\"RainInLast60Minutes\"},{\"value\":0,\"units\":\"lux\",\"name\":\"VisibleSunlight\"},{\"value\":\"0.0\",\"units\":\"lux\",\"name\":\"IRSunlight\"},{\"value\":\"0.0\",\"units\":\"lux\",\"name\":\"UVSunlightt\"},{\"name\":\"WindSpeed\",\"units\":\"kph\",\"value\":0},{\"value\":0,\"units\":\"kph\",\"name\":\"WindGust\"},{\"name\":\"WindDirection\",\"value\":0.2,\"units\":\"degrees\"},{\"name\":\"totalRain\",\"units\":\"mm\",\"value\":0},{\"name\":\"BarometricPressure\",\"units\":\"hPa\",\"value\":1017.7856},{\"units\":\"m\",\"value\":626,\"name\":\"Altitude\"},{\"name\":\"SeaLevelPressure\",\"units\":\"hPa\",\"value\":1096.7661},{\"name\":\"BarometricTrend\",\"units\":\"\",\"value\":\"Rising\"},{\"name\":\"OutdoorAirQuality\",\"value\":0,\"units\":\"AQI\"}]",
"station":{"handle":"handle","name":"name"},"image":1670758013},"json":"https://cdn.weatherstem.com/user_generated/skyweather/handle/latest.json","jpg":"https://cdn.weatherstem.com/user_generated/skyweather/handle/latest.jpg"}
Processing F016TH data
This is the raw data: {"time" : "2022-12-11 14:27:00", "model" : "SwitchDoc Labs F016TH Thermo-Hygrometer", "device" : 152, "modelnumber" : 5, "channel" : 3, "battery" : "OK", "temperature_F" : 73.500, "humidity" : 52, "mic" : "CRC", "mod" : "ASK", "freq" : 433.986, "rssi" : -0.103, "snr" : 17.696, "noise" : -17.799}
Processing F016TH data
This is the raw data: {"time" : "2022-12-11 14:27:02", "model" : "SwitchDoc Labs F016TH Thermo-Hygrometer", "device" : 58, "modelnumber" : 5, "channel" : 6, "battery" : "OK", "temperature_F" : 74.700, "humidity" : 53, "mic" : "CRC", "mod" : "ASK", "freq" : 433.992, "rssi" : -0.127, "snr" : 18.921, "noise" : -19.048}
------Patting The Dog-------
When i check the Weather STEM dashboard now, it actually opens. Here's what I get:
Even after keeping the station running for an hour, the dashboard remains the same. It doesn't update.