1) Give a description of the problem
I believe that my URLs are being truncated - I’m getting api key errors if the api key is at the end of the URL and im getting data errors if the data is at the the end.
The URL source is 192.168.13.237/emoncms/input/post?apikey={apikey}&node={$currentEventDevice}&fulljson={urlEncode(strLeftCurly)}{urlEncode(strDQuote)}{$currentEventAttribute}{urlEncode(strDQuote)}:{round($currentEventValue,2)}{urlEncode(strRightCurly)}
Oddly enough this was working for an externally hosted version of this service, but it uses a shorter hostname and is missing /emoncms/ from the url as well, leading me to believe that truncation is the issue. Alas I’m not a good enough Linux/Apache hacker to see what the URL is from the other servers perspective.
The docco for inputting to EmonCMS is here - https://emoncms.org/Modules/site/api.php
2) What is the expected behaviour?
That the URL generated by the piston was actually submitted, not a truncated version.
3) What is happening/not happening?
The machine receiving the web request isn’t happy with the URL. The Piston logs show a URL that works if I put it in a browser, but the URL actually submitted isn’t the same.
+170ms ║║Sending internal web request to: 192.168.13.237/emoncms/input/post?apikey=43c74826014779bd5257278584e11814&node=Air%20Conditioner&fulljson=%7B%22temperature%22:22%7D
Gets an error from the receiving server:
But chrome works:
4) Post a Green Snapshot of the piston
14/06/2020, 20:54:56 +746ms
+2ms ╔Received event [Air Conditioner].temperature = 22.0 with a delay of 78ms
+102ms ║RunTime Analysis CS > 21ms > PS > 27ms > PE > 54ms > CE
+105ms ║Runtime (41633 bytes) successfully initialized in 27ms (v0.3.110.20191009) (102ms)
+105ms ║╔Execution stage started
+113ms ║║Cancelling statement #16's schedules...
+132ms ║║Calculating (string) 192.168.13.237/emoncms/input/post?apikey= + (string) AAAAAAAAAAAAAAAAAAAAAAAAAAAA >> (string) 192.168.13.237/emoncms/input/post?apikey=AAAAAAAAAAAAAAAAAAAAAAAAAAAA
+136ms ║║Calculating (string) 192.168.13.237/emoncms/input/post?apikey=AAAAAAAAAAAAAAAAAAAAAAAAAAAA + (string) &node= >> (string) 192.168.13.237/emoncms/input/post?apikey=AAAAAAAAAAAAAAAAAAAAAAAAAAAA&node=
+140ms ║║Calculating (string) 192.168.13.237/emoncms/input/post?apikey=AAAAAAAAAAAAAAAAAAAAAAAAAAAA&node= + (string) Air Conditioner >> (string) 192.168.13.237/emoncms/input/post?apikey=AAAAAAAAAAAAAAAAAAAAAAAAAAAA&node=Air Conditioner
+143ms ║║Calculating (string) 192.168.13.237/emoncms/input/post?apikey=AAAAAAAAAAAAAAAAAAAAAAAAAAAA&node=Air Conditioner + (string) &fulljson= >> (string) 192.168.13.237/emoncms/input/post?apikey=AAAAAAAAAAAAAAAAAAAAAAAAAAAA&node=Air Conditioner&fulljson=
+147ms ║║Calculating (string) 192.168.13.237/emoncms/input/post?apikey=AAAAAAAAAAAAAAAAAAAAAAAAAAAA&node=Air Conditioner&fulljson= + (string) %7B >> (string) 192.168.13.237/emoncms/input/post?apikey=AAAAAAAAAAAAAAAAAAAAAAAAAAAA&node=Air Conditioner&fulljson=%7B
+150ms ║║Calculating (string) 192.168.13.237/emoncms/input/post?apikey=AAAAAAAAAAAAAAAAAAAAAAAAAAAA&node=Air Conditioner&fulljson=%7B + (string) %22 >> (string) 192.168.13.237/emoncms/input/post?apikey=AAAAAAAAAAAAAAAAAAAAAAAAAAAA&node=Air Conditioner&fulljson=%7B%22
+153ms ║║Calculating (string) 192.168.13.237/emoncms/input/post?apikey=AAAAAAAAAAAAAAAAAAAAAAAAAAAA&node=Air Conditioner&fulljson=%7B%22 + (string) temperature >> (string) 192.168.13.237/emoncms/input/post?apikey=AAAAAAAAAAAAAAAAAAAAAAAAAAAA&node=Air Conditioner&fulljson=%7B%22temperature
+156ms ║║Calculating (string) 192.168.13.237/emoncms/input/post?apikey=AAAAAAAAAAAAAAAAAAAAAAAAAAAA&node=Air Conditioner&fulljson=%7B%22temperature + (string) %22 >> (string) 192.168.13.237/emoncms/input/post?apikey=AAAAAAAAAAAAAAAAAAAAAAAAAAAA&node=Air Conditioner&fulljson=%7B%22temperature%22
+159ms ║║Calculating (string) 192.168.13.237/emoncms/input/post?apikey=AAAAAAAAAAAAAAAAAAAAAAAAAAAA&node=Air Conditioner&fulljson=%7B%22temperature%22 + (string) : >> (string) 192.168.13.237/emoncms/input/post?apikey=AAAAAAAAAAAAAAAAAAAAAAAAAAAA&node=Air Conditioner&fulljson=%7B%22temperature%22:
+161ms ║║Calculating (string) 192.168.13.237/emoncms/input/post?apikey=AAAAAAAAAAAAAAAAAAAAAAAAAAAA&node=Air Conditioner&fulljson=%7B%22temperature%22: + (string) 22 >> (string) 192.168.13.237/emoncms/input/post?apikey=AAAAAAAAAAAAAAAAAAAAAAAAAAAA&node=Air Conditioner&fulljson=%7B%22temperature%22:22
+164ms ║║Calculating (string) 192.168.13.237/emoncms/input/post?apikey=AAAAAAAAAAAAAAAAAAAAAAAAAAAA&node=Air Conditioner&fulljson=%7B%22temperature%22:22 + (string) %7D >> (string) 192.168.13.237/emoncms/input/post?apikey=AAAAAAAAAAAAAAAAAAAAAAAAAAAA&node=Air Conditioner&fulljson=%7B%22temperature%22:22%7D
+170ms ║║Sending internal web request to: 192.168.13.237/emoncms/input/post?apikey=AAAAAAAAAAAAAAAAAAAAAAAAAAAA&node=Air%20Conditioner&fulljson=%7B%22temperature%22:22%7D
+195ms ║║Executed virtual command httpRequest (27ms)
+196ms ║║Requesting a wake up for Sun, Jun 14 2020 @ 8:55:16 PM AEST (in 20.0s)
+200ms ║╚Execution stage complete. (95ms)
+201ms ║Setting up scheduled job for Sun, Jun 14 2020 @ 8:55:16 PM AEST (in 19.996s)
+209ms ╚Event processed successfully (209ms)
14/06/202