I take it you've seen this posting for MariaDB with Python https://mariadb.com/resources/blog/how- ... o-mariadb/.The scope of this project is to take temperature readings from the arduino (which is controlling much more than just temps btw), insert them into the assigned database,
I suspect that you are not matching the data type from the Python with MariaDB support data types. See https://mariadb.com/kb/en/data-types/. Unless stated for MariaDB, will not be any coversion.
I could figure out where some of the values were coming from in the code nor did you provide the schema of the DB. Here's an example I hope illustrates taking the Python data and converting it to something to write to the DB
Code:
>>> t=['HotFluidTemp', ' 69.12']>>> type(t)<class 'list'>>>> x=t[1]>>> x' 69.12'>>> type(x)<class 'str'>>>> y=float(x)>>> y69.12>>> type(y)<class 'float'>>>>
Statistics: Posted by DS256 — Tue Apr 16, 2024 9:03 pm