openhsorg / openhs

OpenHS - core modules
0 stars 0 forks source link

Ease connection of Wifi sensors to Router #39

Closed openhsorg closed 6 years ago

openhsorg commented 7 years ago

Problem: We have 50 home sensors based on Wemos (ESP-8266EX) and we need to connect each of them to home router. This must be intuitive and easy done by end user. This has been issued from: https://github.com/openhsorg/openhs/issues/38

Proposal of solution:

  1. Turn on wifi sensors
  2. Open OpenHS admin page and see a list of these sensors
  3. Mark all of them or select only some of them and press connect. In dialogue enter SSID credentials (home router login:passwd) Insert also MQTT server data.
  4. The similar approach when we want to disconnect sensors

Study materials and similar solutions:

  1. I attached an example of home extender - how it deals with router connection extender_www.pdf
  2. Project which deals with this problem: https://github.com/tzapu/WiFiManager
  3. How to make web-server on wemos: http://www.arduino8.cz/hrajeme-si-wemos-d1-web-server/ and http://www.arduino8.cz/hrajeme-si-wemos-d1-web-server-2/
  4. Update Wemos software via Wifi: http://www.arduino8.cz/hrajeme-si-wemos-d1-nahrani-programu-pres-wifi-ota/
MichalValny commented 7 years ago

This project: https://github.com/tzapu/WiFiManager at the beginning switches Wemos into Access Point mode which can be connected directly from another computer via http:// where user can enter wifi and MQTT credentials.

Next step is figure out how to enter credentials from openHS page into more connected ESPs in Access Point mode.

MichalValny commented 7 years ago

This project solves the issue: https://github.com/marvinroger/homie-esp8266 Scenario:

  1. Wemos boots into config mode (Access point)
  2. Connect to the access point and send JSON config with credentials (wifi, MQTT):
    curl -X PUT http://homie.config/config --header "Content-Type: application/json" -d @config.json Credentials are in EPROM

The issues TB solved:

  1. return back to config mode for a change of credentials: a/ we need external button, b/ format file system:

    include "FS.h"

void setup() { Serial.begin(115200); Serial.println(""); Serial.println("Mounting FS...");

if (!SPIFFS.begin()) { Serial.println("Failed to mount file system"); return; }

SPIFFS.format(); Serial.println("Done."); }

void loop() { }

  1. Java module must do this work for each sensor
gangaanonymous commented 7 years ago

Connection problem arises. How can i connect to my router by WAN from another city ? I have a router at my hone and want to connect it from my workplace computer

MichalValny commented 6 years ago

capability will be moved to MQTT gateway...