Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InfluxDB: measurements created, but no data #2152

Closed
tbernaerd opened this issue Feb 16, 2020 · 3 comments · Fixed by #2153
Closed

InfluxDB: measurements created, but no data #2152

tbernaerd opened this issue Feb 16, 2020 · 3 comments · Fixed by #2153

Comments

@tbernaerd
Copy link

I have a Sonoff Pow R2 with Espurna flashed onto it. I made my own build with the instructions in VS Code just to have influxdb support. Build seems to work, but adding data to Influx does not work so far.

The debug log in the web UI:

[540559] [INFLUXDB] Sending to 192.168.0.15:8086
[540563] [INFLUXDB] Connected to 192.168.0.15:8086
[540705] [INFLUXDB] Failure response after 142ms
[540951] [INFLUXDB] Disconnected

In influx, I can see the new measurements created but no data:

Connected to http://localhost:8086 version 1.7.9
InfluxDB shell version: 1.7.9
> use espurna
Using database espurna
> show measurements
name: measurements
name
----
apparent
current
energy
factor
freeheap
loadavg
power
reactive
rssi
ssid
uptime
vcc
voltage

Any ideas on how I can troubleshoot this further? The debug log does not seem too verbose.

@mcspr
Copy link
Collaborator

mcspr commented Feb 17, 2020

Have you checked influxdb logs?

@mcspr
Copy link
Collaborator

mcspr commented Feb 17, 2020

'Failure' notice is erroneous:

const char idb_success[] = "HTTP/1.1 204";
const bool result = (len > sizeof(idb_success) && (0 == strncmp((char*) response, idb_success, sizeof(idb_success))));

sizeof(char[]) != strlen(char[]), checking for HTTP string it failed to read it properly. Fixing that in #2153 (plus some unrelated refactoring that was bound to happen at some point)

So far I am not seeing any issues with influx part:

[17/Feb/2020:15:33:14 +0000] "POST /write?db=test&p=%5BREDACTED%5D&u=test HTTP/1.1" 204 0 "-" "-" cfbe967e-519a-11ea-8171-0242ac110002 401342
[17/Feb/2020:15:34:54 +0000] "POST /write?db=test&p=%5BREDACTED%5D&u=test HTTP/1.1" 204 0 "-" "-" 0b62faeb-519b-11ea-8172-0242ac110002 336431
[17/Feb/2020:15:34:57 +0000] "POST /write?db=test&p=%5BREDACTED%5D&u=test HTTP/1.1" 204 0 "-" "-" 0d671b6a-519b-11ea-8173-0242ac110002 770876
[17/Feb/2020:15:36:34 +0000] "POST /write?db=test&p=%5BREDACTED%5D&u=test HTTP/1.1" 204 0 "-" "-" 470a3ad7-519b-11ea-8175-0242ac110002 469414
> select time,value from vcc where device = 'testdevice' order by time desc limit 10
name: vcc
time                value
----                -----
2020-02-17T15:34:57.938942013Z 3418
2020-02-17T15:29:57.930141583Z 3418
2020-02-17T15:24:57.545009682Z 3420
2020-02-17T15:19:57.58609495Z  3418
2020-02-17T15:14:57.827285398Z 3420
2020-02-17T15:09:57.54426718Z  3418
2020-02-17T15:04:57.560531068Z 3418
2020-02-17T14:59:57.526623977Z 3418
2020-02-17T14:54:57.942935012Z 3418
2020-02-17T14:49:57.484544597Z 3420

@tbernaerd
Copy link
Author

You are right, I do have data in Influx. I got confused while looking at another Influxdb instance, which is also why the Influx logs were not very useful.

Changes to get rid of the erroneous notice will be better to not confuse future users though, thanks for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants