for my raspberry pil solar system monitoring project, i am using six sensors that measure both voltage and current from the PV panel, batt and load sides. Those sensors return analog output and has been read by my arduino uno and then being called by my python script using serial command. i have printed a txt file just to make sure that i am taking the reading. now i want to upload the code to the table that i have created following the instrustion of the raspberry pi weather station guidelines, the database name is weather and i have created the table using the following codes
CREATE TABLE WEATHER_MEASUREMENT(
ID BIGINT NOT NULL AUTO_INCREMENT,
REMOTE_ID BIGINT,
PV_VOLTAGE DECIMAL(6,2) NOT NULL,
PV_CURRENT DECIMAL(6,2) NOT NULL,
BATT_VOLTAGE DECIMAL(6,2) NOT NULL,
BATT_CURRENT DECIMAL(6,2) NOT NULL,
LOAD_VOLTAGE(6,2) NOT NULL,
LOAD_CURRENT DECIMAL(6,2) NULL,
CREATED TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY ( ID )
);
below are my python and arduino codes (i test my sensors using a DC powe supply, the 4th and 5th value printed is abit weird because i didnt connect my sensors to the supply). [1]http://www.imgpaste.net/image/xt61S "tooltip"
i am actually a newbie to python and the arduino language. i did the codes by referring to some guides and other people posts so please point out my mistake or any necessary codes that i ve written. Cheers.