Raspberry Pi4B serial to Arduino Uno
Goal: direct upload of data from arduino uno using internet from raspberry pi…Is that possible?
The library in arduino for influxdb uses esp wlan module…
Currently Iam able to readout utf-8.rstrip() from arduino with python script over raspberry. but i guess that format wont be fit in influxdb easily…
measuring wind temp press rhum
I had the same setup once before I moved it to ESP.
Just send numbers from UNO, without units (e.g. comma separated), and you will be ok with ASCII chars.
You can use InfluxDB Python client to write data.
from influxdb import InfluxDBClient
ser=serial.Serial("/dev/ttyUSB0",9600) #change ACM number as found from ls /dev/tty/ACM*
client = InfluxDBClient(server,8086,user,password, database, True, False)
if len(data) == 3:
if len(data) == 1:
dude sorry for the late response. thanks for your help.
thats my output now
Is your code fore arduino? (.ino?)
how to i get the datfor server, database etc?
The example I’ve provided above is python code running on raspberry using Python client for InfluxDB 1x.
It reads data from the virtual serial driver which is loaded when Arduino is connected via USB cable to Raspberry Pi.
It reads lines and splits each row into values by the comma char. As you are using a semi-colon as a separator char, you need to modify it.
Split data is written to the database via JSON payload used by the python client.
Ahh great got it. My goal is to use the influxdb cloud service.
I created a bucket there. Did you the same?
My code was used at the time when there was only InfluxDB 1, so it is using the client for v1. You can easily use examples as you posted above to adjust code to write data to InfluxDB 2 Cloud. When you parse lines into an array of strings, you can use those parts to fill Point.
I would recommend you to first try the examples without data from Arduino to make sure your code to write data works ok, then add code to read and parse Arduino measurements.