Hi,
I am trying to send some data to my InfluxDB via upd protocol.
I am able to send the data via Git Bash:
echo "HM T=22.6,H=64.4,p=962,U=3.85,C=70"> /dev/udp/dynDNSadress/4444
So I think I can assume that my Database and the Port forwarding works.
But if I would like to send the same String via my Photon it does not work:
//#define INFLUXDB_HOST "dynDNSadress"
byte INFLUXDB_HOST[] = {90, 190, 290, 293};
int INFLUXDB_PORT = 4444;
String data = "HM T=" + String(temperature, 1) + ",H=" + String(humidity, 1) + ",p=" + String(pressure, 0) + ",U=" + String(cellVoltage, 2) + ",C=" + String(stateOfCharge, 0);
udp.beginPacket(INFLUXDB_HOST, INFLUXDB_PORT);
Particle.publish("HORSE", String(udp.print(data)), 60, PRIVATE);
udp.endPacket();
Particle.publish(eventName, data, 60, PRIVATE);
The console shows that there are 34 bytes sent, but they never arrive at my database. And it also shows that the String is the same:
HM T=22.5,H=59.1,p=965,U=3.82,C=67
I do not receive any error because of the UDP protocol. So I would be very grateful if you have an idea what I am doing wrong!