fradaloisio / ESP8266-Sensors-InfluxDB

6 stars 3 forks source link

Writing failed #1

Open juergenschubert opened 6 years ago

juergenschubert commented 6 years ago

Writing data to host 192.168.1.117:8086's database=IOT dht22 t=20.70,h=50.70,hic=20.15

I have no idea how to troubleshoot as on the InfluxDB host a

influx Connected to http://localhost:8086 version 1.5.0 InfluxDB shell version: 1.5.0 USE IOT Using database IOT INSERT dht22 t=20.60,h=50.90,hic=20.04

does work. It is not that I am sophisticated here but I wanna understand why it is telling me that it failes.

fradaloisio commented 6 years ago

Some (obvious but not) question:

  1. Is the ESP8266 Connected to the WiFi?
  2. By connecting the searial adapter, are any messages printed?
  3. Is the ifluxdb server accessible from the ip 192.168.1.117? try with influx -host 192.168.1.117 -port 8086
juergenschubert commented 6 years ago

1) Sure I am also sending MQTT messages which is working 2) sure I do get the "Writing failed" from the serial output 2) sure - I do get a Connected to http://192.168.1.50:8086 version 1.5.0 InfluxDB shell version: 1.5.0

the Serial output is telling me: WiFi Connected Writing data to host 192.168.1.50:8086's database=IOT dht22,location=Speicher,client=ESP01 temperatur=22.30,humidity=50.50,heat_index=21.90 Writing failed

The writing failed seems to come from the

Serial.println(influxdb.response() == DB_SUCCESS ? "HTTP write success" : "Writing failed");

The influx DB does not contain any row.

you can find the cpp file @ https://pastebin.com/J1qBbfyS When I do an api insert with: juergenschubert@~ $ curl -i -XPOST 'http://192.168.1.50:8086/write?db=IOT&u=root&p=123456' --data-binary 'dht22,location=Speicher,client=ESP01 temperatur=22.30,humidity=50.50,heat_index=21.90'

it is inserted into the DB IOT, only the cpp Version fails.