ESP8266 on nodeCMU, authorization problem
Posted: Tuesday 02 February 2016 9:03
I am trying to build a temperature monitoring device with a nodeCMU communicating with Domoticz. For details, see https://www.domoticz.com/wiki/ESP8266_WiFi_module.
Programming of the nodeCMU is done with Esplorer.
Everything is going well, but the temperature values are not accepted by Domoticz. At first I got the 401 message. My Domoticz implementation wants uid/pwd.
When I isolate the json-call and use it in a browser, the value is accepted and shown in Domoticz. My browser was logged in on Domoticz.
My problem is the way to include Authorization. I tried:
(the x's is my base64 coded uid/pwd)
The result is: nil and no accepted value in Domoticz.
Anyone with a better idea? (The syntax of the Lua implementation on the nodeCMU is NOT very well documented!)
Programming of the nodeCMU is done with Esplorer.
Everything is going well, but the temperature values are not accepted by Domoticz. At first I got the 401 message. My Domoticz implementation wants uid/pwd.
When I isolate the json-call and use it in a browser, the value is accepted and shown in Domoticz. My browser was logged in on Domoticz.
My problem is the way to include Authorization. I tried:
Code: Select all
conn:send("GET /json.htm?type=command¶m=udevice&idx=59&nvalue=0&svalue=" .. t .. "HTTP/1.1\r\nHost: 192.168.nnn.nnn\r\n"
.."Authorization: Basic xxxxxxxxxxxxxxxxxx\r\nConnection: keep-alive\r\nAccept: */*\r\n\r\n")
(the x's is my base64 coded uid/pwd)
The result is: nil and no accepted value in Domoticz.
Anyone with a better idea? (The syntax of the Lua implementation on the nodeCMU is NOT very well documented!)