ESP8266 on nodeCMU, authorization problem

Subforum for the 'MySensors' project.
http://www.mysensors.org/
Post Reply
User avatar
cobrp
Posts: 10
Joined: Tuesday 02 June 2015 13:40
Target OS: Raspberry Pi
Domoticz version: V3.8153
Location: Enschede, the Netherlands
Contact:

ESP8266 on nodeCMU, authorization problem

Post by cobrp » Tuesday 02 February 2016 10: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:

Code: Select all

conn:send("GET /json.htm?type=command&param=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!)

User avatar
gizmocuz
Posts: 8526
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi
Domoticz version: beta
Location: Top of the world
Contact:

Re: ESP8266 on nodeCMU, authorization problem

Post by gizmocuz » Tuesday 02 February 2016 10:07

Does your ESP runs in your private network, or can get a fixed IP address ?
If yes, you can add this in the Local Network settings of domoticz so it does not need a username/password
Quality outlives Quantity!

User avatar
cobrp
Posts: 10
Joined: Tuesday 02 June 2015 13:40
Target OS: Raspberry Pi
Domoticz version: V3.8153
Location: Enschede, the Netherlands
Contact:

Re: ESP8266 on nodeCMU, authorization problem

Post by cobrp » Tuesday 02 February 2016 10:32

:D Thank you, that did it!

tazitiz
Posts: 2
Joined: Tuesday 18 October 2016 13:42
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: ESP8266 on nodeCMU, authorization problem

Post by tazitiz » Saturday 08 April 2017 21:46

I have a nodemcu that i want to keep dhcp-ing and therefore wanted the authentication going. Now i got it to work, your addition to the header was allmost complete. this is what i got working:

conn:send("GET /json.htm?type=command&param=udevice&idx=501&nvalue=0&svalue=".. t .." HTTP/1.1\r\nHost: www.local.lan\r\n"
.."Authorization: Basic, value: nnnnnnnnnnnnnnnnnnnnnnnnn\r\nConnection: keep-alive\r\nAccept: */*\r\n\r\n")

thanks for your steps - i wouldn't get it to work on my end if you didn't post your question!

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest