tim-hellhake / esphome-adapter

Mozilla Public License 2.0
2 stars 3 forks source link

Error: no auth mechanism defined #10

Open geoffbowditch opened 3 years ago

geoffbowditch commented 3 years ago

Hi, I was trying out Mozilla webthings, and was pleasantly surprised that it found my Xiaomi humidity / temperature sensors connected via ESP32 to home assistant. Not sure what changed, but I can't get any data from them anymore. I've tried removing them and rediscovering, but they are no longer detected. I see this in the logs, any thoughts how this can be fixed? Kind regards, geoff.

2020-12-07 03:48:00.191 INFO : esphome-adapter: Discovered api service at downstairs_temp.local 2020-12-07 03:48:00.194 INFO : esphome-adapter: Probing 10.2.8.123:80 2020-12-07 03:48:00.196 INFO : esphome-adapter: Unhandled Rejection 2020-12-07 03:48:00.198 ERROR : esphome-adapter: Error: no auth mechanism defined 2020-12-07 03:48:00.199 ERROR : esphome-adapter: at Auth.onRequest (/home/pi/.webthings/addons/esphome-adapter/node_modules/request/lib/auth.js:132:32) 2020-12-07 03:48:00.200 ERROR : esphome-adapter: at Request.auth (/home/pi/.webthings/addons/esphome-adapter/node_modules/request/request.js:1347:14) 2020-12-07 03:48:00.201 ERROR : esphome-adapter: at Request.init (/home/pi/.webthings/addons/esphome-adapter/node_modules/request/request.js:378:10) 2020-12-07 03:48:00.202 ERROR : esphome-adapter: at new Request (/home/pi/.webthings/addons/esphome-adapter/node_modules/request/request.js:127:8) 2020-12-07 03:48:00.203 ERROR : esphome-adapter: at request (/home/pi/.webthings/addons/esphome-adapter/node_modules/request/index.js:53:10) 2020-12-07 03:48:00.205 ERROR : esphome-adapter: at Promise (/home/pi/.webthings/addons/esphome-adapter/lib/fetch.js:11:9) 2020-12-07 03:48:00.206 ERROR : esphome-adapter: at new Promise () 2020-12-07 03:48:00.207 ERROR : esphome-adapter: at Object.fetch (/home/pi/.webthings/addons/esphome-adapter/lib/fetch.js:10:12) 2020-12-07 03:48:00.208 ERROR : esphome-adapter: at ESPHomeAdapter. (/home/pi/.webthings/addons/esphome-adapter/lib/esphome-adapter.js:62:42) 2020-12-07 03:48:00.210 ERROR : esphome-adapter: at Generator.next ()

tim-hellhake commented 3 years ago

It looks like you didn't provide a user/password combination. They are now optional. After the next update, the problem should disappear.

geoffbowditch commented 3 years ago

Thanks Tim. Just to confirm, what should the username be? In the eps32 config, I'm only setting a password, e.g.

api: password: ""

ota: password: ""

Thanks, geoff

tim-hellhake commented 3 years ago

You need to activate the webserver like this:

web_server:
  port: 80
  auth:
    username: <USERNAME>
    password: <PASSWORD>

or

web_server:
  port: 80
tim-hellhake commented 3 years ago

Did you have any success so far?

geoffbowditch commented 3 years ago

Not yet, but not spent much time on it recently. I now seem to have 0.2.2 of ESPHome, and noticed some different log entries. I tried setting up the webserver with a username and password, and putting these in the ESPhome add-on It now seems to detect the thermometer, but doesn't get any readings back I see this in the logs now:

2020-12-23 14:57:24.756 ERROR : esphome-adapter: { Error: connect ETIMEDOUT 10.2.8.126:80 2020-12-23 14:57:24.758 ERROR : esphome-adapter: at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1107:14) 2020-12-23 14:57:24.759 ERROR : esphome-adapter: errno: 'ETIMEDOUT', 2020-12-23 14:57:24.761 ERROR : esphome-adapter: code: 'ETIMEDOUT', 2020-12-23 14:57:24.762 ERROR : esphome-adapter: syscall: 'connect', 2020-12-23 14:57:24.764 ERROR : esphome-adapter: address: '10.2.8.126', 2020-12-23 14:57:24.765 ERROR : esphome-adapter: port: 80 }

tim-hellhake commented 3 years ago

Did you use port 80 for the webserver? Can you confirm that the IP is correct? If you attach your config to the issue, I can test it for you if you want.

tim-hellhake commented 3 years ago

@geoffbowditch Are you still interested in this issue? :smile:

geoffbowditch commented 3 years ago

Hi Tim, not had chance to look at it recently. In fact something has gone wrong with my installation as I can no longer access it. Will try and find some time, and let you know. Kind regards, geoff.

On Sat, 13 Feb 2021 at 17:00, Tim Hellhake notifications@github.com wrote:

@geoffbowditch https://github.com/geoffbowditch Are you still interested in this issue? 😄

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/tim-hellhake/esphome-adapter/issues/10#issuecomment-778645450, or unsubscribe https://github.com/notifications/unsubscribe-auth/AELLBVN2QLT3GQ76I77CQ2LS62VZBANCNFSM4UTEQZ7A .