406 response sending data from emonhub to Ubuntu install

I am trying to send data from my emonhub setup (that resides on an OrangePi that just only that) to my recently installed EmonCMS on Ubuntu.

When it tries to send I get this in the emonhub log

2019-09-13 19:19:21,774 INFO emonCMS77 sending: http://192.168.7.77/emoncms/input/bulk.json?apikey=E-M-O-N-C-M-S-A-P-I-K-E-Y&data=[[1568398761.13,10,621,0,0,
0,24731,715,646,443,635,527,457,850,252,0]]&sentat=1568398761
2019-09-13 19:19:21,784 WARNING emonCMS77 couldn't send to server, HTTPError: 406
2019-09-13 19:19:21,785 WARNING emonCMS77 send failure: wanted 'ok' but got ''

In the emoncms log I see an attempt to do the update but it is rejected with a 406 (ignore the timestamps).

2019-09-13 18:19:28.857|INFO|index.php|emoncms/input/bulk.json
2019-09-13 18:19:28.860|WARN|index.php|406 Not Acceptable|emoncms/input/bulk

From an SSH on the emonhub machine, I can copy the curl example from the Inputs API and it works fine and appears as an input.

root@OrPi1:~# curl --data "node=1&data={power1:100,power2:200,power3:300}&apikey=93197a8e5f82273c2622d077xxxxxxxx" "http://192.168.7.77/input/post"
ok[1]-  Exit 127                http://192.168.7.77/input/post?node=emontx
[2]+  Done                    fulljson={%22power1%22:100,%22power2%22:200,%22power3%22:300}
root@OrPi1:~# curl --data "node=1&data={power1:100,power2:200,power3:300}&apikey=93197a8e5f82273c2622d077xxxxxxx" "http://192.168.7.77/input/post"

This emonhub is quite happily communicating with my main EmonCMS setup - the only difference is the IP address (& API - yes I have checked) on the second reporter.

I have used this emonhub previously to report to 2 different instances so I know it has worked before.

The only place I can see that 406 Not Acceptable is here

I’ll leave this post here as evidence that only once you have written the post do you think ‘I wonder…’

The solution was simple; The main system runs on Lighttpd; the new on Apache. The redirects must be different as I need IP/emoncms in the reporter definition and for the new one just the IP.

Problem solved. :man_facepalming::man_facepalming::man_facepalming:

2 Likes