@Malte
all seem ok, but still not working
any idea ?
if I put manual value from %s to a number 4 for for exemple, it is working
but I want result of the soc request , it is not working.
This I want is (%s) is (SoC) value.
Something wrong ?
Result must be 1 or 2 digit number because of my sql table.
It looks like you have some errors in your code.
like the last line soc = get_soc() is never executed, and if it would be executed then it would just call itself over and over again.
You should probably move the last line “soc = get_soc()” to the write_soc() method instead, somewhere above the sql_insert_query line.
Can you show the job that is executing the methods?
I guess it runs the write_soc() method, right?
this is working, when I put value “4”
4 is just a exemple of value
but when I replace the value “4” for request value, not working…
i also move the line soc = get_soc()
or maybe work but send value as not 2 digit number. my db accept only 1 or 2 digit. so if it is 4.5, it will not working. I am worried about what is come from the soc request … digit 1 or 2 or more ?
Yep, in the sql_insert_query line, you use the soc variable, but you have not created it yet.
The error message you get is python complaining about the soc variable not existing yet.
So to fix this, the call to get_soc() should be moved to be above the sql_insert_query line.
@Malte
ok, it seem ok now, mysql receive data every minute, like I want, but where or what langage? I don’t know.
this is the screen shoot at the log, but I don’t know how to read it, and also if it is the good one. because the soc commande work well manually.
also the screen of my mysql connection. something come every minute.
I don’t know what AutoPi send, is it raw data or number ?