homie-esp8266 icon indicating copy to clipboard operation
homie-esp8266 copied to clipboard

WPS connections for Homie?

Open jpmens opened this issue 7 years ago • 6 comments

If I understand WPS, it would allow Homie devices to autoconfigure themselves for the WiFi connection, and this would be something grand to have in Homie: we could install a device, push a button on the WiFi AP and have Homie auto-connect to Wifi (and subsequently, via mdns to MQTT).

In #87 there is mention of WPS for initiating WiFi connection to the AP, and judging by this code, Arduino ESP8266 is actually capable of doing WPS.

Has anybody recently tried implementing this for Homie-esp8266?

jpmens avatar Aug 30 '16 19:08 jpmens

The problem is the current WPS implementation is synchronous. I've filled an issue on https://github.com/esp8266/Arduino/issues/2464, let's see if this is doable.

But even if doable, how would the device be configured? Via mdns, we would have the IP/port, but what about the device id, base topic, auth... ?

marvinroger avatar Aug 31 '16 09:08 marvinroger

Bah, those pesky questions ... I was hoping you'd just give answers! 😆

Yes, we'd have IP/port for the broker. Device ID defaults to the hex serial which is fine, and authentication (in this particular case) is not really needed. And we already have a default base topic (devices/<deviceID>) in the convention, don't we?

jpmens avatar Aug 31 '16 09:08 jpmens

Hmm, mDNS network discovery? Could use SRV records for MQTT broker IP/port, but wouldn't help with authentication credentials.

shogsbro avatar Aug 31 '16 10:08 shogsbro

I have been thinking about this, this is really the stumbling block to making this "general public" friendly. Could we define some sort of wps like protocol for mqtt? Even if it required you to push a physical button on the broker (say a pi in my case), that would be better than entering credentials on a config screen.

stufisher avatar Oct 15 '16 07:10 stufisher

I am using a raspberry pi as an hotspot The idea was to setup a dns on the rpi and assign a domain name like "mqtt.mylocalpi" to the rpi itself so you have already the MQTT broker Address

then you can autostart because the device itself is generating the id automatically so you don't need anything else

nicola-lunghi avatar Apr 25 '18 15:04 nicola-lunghi

@nicola-lunghi how do you mqtt.mylocalpi onto the device initially? also username and password?

timpur avatar Apr 25 '18 22:04 timpur