I have an EmonCMS running on a Rpi that feeds two standalone instances of EmonCMS. One is on my home LAN and works fine, and one is on a shared hosting server that was working fine. I moved the server instance to a new directory/URL and now I can’t get the feed to update.
The RPI doing the feeding gives this error:
2022-09-04 09:55:20,805 WARNING emoncms_remotename emoncms_remotename couldn't send to server: 418 Client Error: reauthentication required for url: http://my.url.au//input/bulk.json
If I take the URL and replace E-M-O-N-C-M-S-A-P-I-K-E-Y with the R/W key and paste it into a browser things work just fine.
The EmonHub configuration is below, taken from the suggestion in Log emonPi remotely - doesn’t work for me again - #18 by TrystanLea
[[emoncms_remotename]]
Type = EmonHubEmoncmsHTTPInterfacer
[[[init_settings]]]
[[[runtimesettings]]]
pubchannels = ToRFM12,
subchannels = ToEmonCMS,
url = http://x.x.id.au/emoncms
apikey = ********************************
senddata = 1 # Enable sending data to Emoncms.org
sendstatus = 1 # Enable sending WAN IP to Emoncms.org MyIP > Emoncms - myip list
sendinterval= 30 # Bulk send interval to Emoncms.org in seconds
This is the redacted log:
2022-09-04 10:12:00,654 INFO emoncms_local sending: http://192.168.x.x/emoncms//input/bulk.json? data=[[1662282699.7068021,8,1139,22,2.01324,0,245.55272,300,300,300,300,300,300,0,-64],[1662282709.6230373,8,1165,21,3.0198600000000004,0,245.4802,300,300,300,300,300,300,0,-64],[1662282719.534087,8,1157,21,5.0331,0,244.81715999999997,300,300,300,300,300,300,0,-65]]&sentat=1662282720&apikey=E-M-O-N-C-M-S-A-P-I-K-E-Y
2022-09-04 10:12:00,663 DEBUG emoncms_remote Buffer size: 7
2022-09-04 10:12:00,664 INFO emoncms_remote sending: http://x.x.id.au/emoncms/input/bulk.json? data=[[1662282660.0958626,8,1018,21,3.0198600000000004,0,244.97256,300,300,300,300,300,300,0,-65],[1662282670.0219557,8,1015,22,1.00662,0,244.57888,300,300,300,300,300,300,0,-64],[1662282679.9273295,8,1022,21,3.0198600000000004,0,244.73427999999998,300,300,300,300,300,300,0,-64],[1662282689.800564,8,1682,20,5.0331,0,244.62032,300,300,300,300,300,300,0,-64],[1662282699.7068021,8,1139,22,2.01324,0,245.55272,300,300,300,300,300,300,0,-64],[1662282709.6230373,8,1165,21,3.0198600000000004,0,245.4802,300,300,300,300,300,300,0,-64],[1662282719.534087,8,1157,21,5.0331,0,244.81715999999997,300,300,300,300,300,300,0,-65]]&sentat=1662282720&apikey=E-M-O-N-C-M-S-A-P-I-K-E-Y
2022-09-04 10:12:00,778 WARNING emoncms_remote emoncms_remote couldn't send to server: 418 Client Error: reauthentication required for url: http://x.x.id.au/emoncms/input/bulk.json
2022-09-04 10:12:00,780 DEBUG emoncms_local acknowledged receipt with 'ok' from http://192.168.x.x/emoncms/
The EmonPI is version 11.0.9 and the server version is also 11.0.9 (fresh Git download).
Putting a deliberate error in the API key doesn’t seem to make any difference. Is this possibly a mod_rewrite issue? The .htaccess file in /emoncms is the one that comes in from git. This is super confusing for me.
Any pointers appreciated.
[APIKey redacted - Moderator (RW) ]