Post by david on Jan 24, 2020 12:18:44 GMT -8
I have been working to setup DataLogger on a Raspberry Pi 3. It will run and fetch one line of data and put into the database but fails when try to plot:
@raspberrypi:~/SDL_Pi_DataLogger $ python DataLogger.py
SDL_Pi_Datalogger
Will work with the INA3221 SwitchDoc Labs Breakout Board
Will work with the ADS1115 SwitchDoc Labs Breakout Board
Will work with OurWeather - Complete Weather Kit
Will work with SwitchDoc Labs WxLink Wireless LInk
Program Started at:2020-01-24 14:03:41
readOURWEATHERData - The time is: 2020-01-24 14:03:41.105961
[u'5.45', u'72.24', u'8.72', u'101131.00', u'132.64', u'3.28', u'5.19', u'315.00', u'0.00', u'1.90', u'6.01', u'3.11', u'9.43', u'180.00', u'315.00', u'0', u'2020-01-24 14:01:51', u"David's weather station ", u'0', u'-1', u'0.00', u'0.00', u'0.00', u'0.00', u'0.00', u'0.00', u'0.00', u'0.00', u'0.00', u'0.00', u'0.00', u'0.00', u'V:0', u'WXLMB ', u'1', u'', u'', u'0', u'', u'', u'0', u'0.00', u'2020-01-24 13:57:07', u' 0', u'0', u'not defined', u'5.4', u' 0', u'5.4', u'40', u'0.00', u'-0.10', u'2020-01-24 14:01:51', u'2020-01-24 14:01:51', u'light air', u'Rising fast', u'Clearing within 12-hrs', u'0', u' 0']
writing SQLdata
query=INSERT INTO OURWEATHERTable(timestamp, deviceid, Outdoor_Temperature , Outdoor_Humidity , Indoor_Temperature , Barometric_Pressure , Altitude , Current_Wind_Speed , Current_Wind_Gust , Current_Wind_Direction , Rain_Total , Wind_Speed_Minimum , Wind_Speed_Maximum , Wind_Gust_Minimum , Wind_Gust_Maximum , Wind_Direction_Minimum , Wind_Direction_Maximum , Display_English_Metrice , OurWeather_DateTime , OurWeather_Station_Name , Current_Air_Quality_Sensor , Current_Air_Quality_Qualitative, Battery_Voltage, Battery_Current, Solar_Voltage, Solar_Current, Load_Voltage, Load_Current ) VALUES(UTC_TIMESTAMP(), 1, 5.450, 72.240, 8.720, 101131.000, 132.640, 3.280, 5.190, 315.000, 0.000, 1.900, 6.010, 3.110, 9.430, 180.000, 315.000, 0, "2020-01-24 14:01:51" , "David's weather station ", 0, -1,0.000, 0.000, 0.000,0.000,0.000,0.000)
buildOURWEATHERGraph - The time is: 2020-01-24 14:03:44.818709
2000
query= (SELECT timestamp, deviceid, Outdoor_Temperature, Outdoor_Humidity, OurWeather_Station_Name, id FROM OURWEATHERTable ORDER BY id DESC LIMIT 2000) ORDER BY id ASC
('count of t=', 7)
Traceback (most recent call last):
File "DataLogger.py", line 171, in <module>
OURWEATHERFunctions.buildOURWEATHERGraphTemperature(username, password, GraphSampleCount)
File "/home/pi/SDL_Pi_DataLogger/OURWEATHERFunctions.py", line 169, in buildOURWEATHERGraphTemperature
x = [datetime.strptime(d, '%Y-%m-%d %H:%M:%S',) for d in t]
TypeError: strptime() argument 1 must be string, not datetime.datetime
pi@raspberrypi:~/SDL_Pi_D
@raspberrypi:~/SDL_Pi_DataLogger $ python DataLogger.py
SDL_Pi_Datalogger
Will work with the INA3221 SwitchDoc Labs Breakout Board
Will work with the ADS1115 SwitchDoc Labs Breakout Board
Will work with OurWeather - Complete Weather Kit
Will work with SwitchDoc Labs WxLink Wireless LInk
Program Started at:2020-01-24 14:03:41
readOURWEATHERData - The time is: 2020-01-24 14:03:41.105961
[u'5.45', u'72.24', u'8.72', u'101131.00', u'132.64', u'3.28', u'5.19', u'315.00', u'0.00', u'1.90', u'6.01', u'3.11', u'9.43', u'180.00', u'315.00', u'0', u'2020-01-24 14:01:51', u"David's weather station ", u'0', u'-1', u'0.00', u'0.00', u'0.00', u'0.00', u'0.00', u'0.00', u'0.00', u'0.00', u'0.00', u'0.00', u'0.00', u'0.00', u'V:0', u'WXLMB ', u'1', u'', u'', u'0', u'', u'', u'0', u'0.00', u'2020-01-24 13:57:07', u' 0', u'0', u'not defined', u'5.4', u' 0', u'5.4', u'40', u'0.00', u'-0.10', u'2020-01-24 14:01:51', u'2020-01-24 14:01:51', u'light air', u'Rising fast', u'Clearing within 12-hrs', u'0', u' 0']
writing SQLdata
query=INSERT INTO OURWEATHERTable(timestamp, deviceid, Outdoor_Temperature , Outdoor_Humidity , Indoor_Temperature , Barometric_Pressure , Altitude , Current_Wind_Speed , Current_Wind_Gust , Current_Wind_Direction , Rain_Total , Wind_Speed_Minimum , Wind_Speed_Maximum , Wind_Gust_Minimum , Wind_Gust_Maximum , Wind_Direction_Minimum , Wind_Direction_Maximum , Display_English_Metrice , OurWeather_DateTime , OurWeather_Station_Name , Current_Air_Quality_Sensor , Current_Air_Quality_Qualitative, Battery_Voltage, Battery_Current, Solar_Voltage, Solar_Current, Load_Voltage, Load_Current ) VALUES(UTC_TIMESTAMP(), 1, 5.450, 72.240, 8.720, 101131.000, 132.640, 3.280, 5.190, 315.000, 0.000, 1.900, 6.010, 3.110, 9.430, 180.000, 315.000, 0, "2020-01-24 14:01:51" , "David's weather station ", 0, -1,0.000, 0.000, 0.000,0.000,0.000,0.000)
buildOURWEATHERGraph - The time is: 2020-01-24 14:03:44.818709
2000
query= (SELECT timestamp, deviceid, Outdoor_Temperature, Outdoor_Humidity, OurWeather_Station_Name, id FROM OURWEATHERTable ORDER BY id DESC LIMIT 2000) ORDER BY id ASC
('count of t=', 7)
Traceback (most recent call last):
File "DataLogger.py", line 171, in <module>
OURWEATHERFunctions.buildOURWEATHERGraphTemperature(username, password, GraphSampleCount)
File "/home/pi/SDL_Pi_DataLogger/OURWEATHERFunctions.py", line 169, in buildOURWEATHERGraphTemperature
x = [datetime.strptime(d, '%Y-%m-%d %H:%M:%S',) for d in t]
TypeError: strptime() argument 1 must be string, not datetime.datetime
pi@raspberrypi:~/SDL_Pi_D