User Tools

Site Tools


projets:fuz:presence_button

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
projets:fuz:presence_button [2019-11-25 23:12] – [Current status] Lomanicprojets:fuz:presence_button [2019-12-18 07:33] – [Current status] Lomanic
Line 26: Line 26:
 See [[https://github.com/Lomanic/presence-button|Lomanic/presence-button]] on Github. See [[https://github.com/Lomanic/presence-button|Lomanic/presence-button]] on Github.
  
 +See [[https://glitch.com/edit/#!/presence-button|presence-button project]] on glitch.com for the remote server part.
 ===== Roadmap ===== ===== Roadmap =====
   - make the LED blink (GPIO 13 is the green LED, **not 12** as it's the relay and blue LED)   - make the LED blink (GPIO 13 is the green LED, **not 12** as it's the relay and blue LED)
Line 53: Line 54:
   - **DONE** following [[https://github.com/matt-williams/matrix-esp8266/blob/master/matrix-esp8266.ino#L70-L109|matrix-esp8266.ino#L70-L109]] [[https://gist.github.com/Lomanic/06c1a2d873dfbd9be93db7c965117f91|sonoff_s20_multiwifi_matrix_events.ino]] (also implemented [[https://matrix.org/docs/spec/client_server/latest#post-matrix-client-r0-rooms-roomid-receipt-receipttype-eventid|read receipts]] in [[https://gist.github.com/Lomanic/dba3cd9f93161cc1acc32c83197298eb/e8fb3810c208f21e2d62c4d173d6801aec0b3a80|sonoff_s20_wifimanager_longpress_matrix_events.ino]] so even if nobody mentions the Matrix account, we see it running)   - **DONE** following [[https://github.com/matt-williams/matrix-esp8266/blob/master/matrix-esp8266.ino#L70-L109|matrix-esp8266.ino#L70-L109]] [[https://gist.github.com/Lomanic/06c1a2d873dfbd9be93db7c965117f91|sonoff_s20_multiwifi_matrix_events.ino]] (also implemented [[https://matrix.org/docs/spec/client_server/latest#post-matrix-client-r0-rooms-roomid-receipt-receipttype-eventid|read receipts]] in [[https://gist.github.com/Lomanic/dba3cd9f93161cc1acc32c83197298eb/e8fb3810c208f21e2d62c4d173d6801aec0b3a80|sonoff_s20_wifimanager_longpress_matrix_events.ino]] so even if nobody mentions the Matrix account, we see it running)
   - **DONE** (only useful when using WifiManager) [[https://gist.github.com/Lomanic/dba3cd9f93161cc1acc32c83197298eb|sonoff_s20_wifimanager_longpress_matrix_events.ino]]   - **DONE** (only useful when using WifiManager) [[https://gist.github.com/Lomanic/dba3cd9f93161cc1acc32c83197298eb|sonoff_s20_wifimanager_longpress_matrix_events.ino]]
-  - **TODO** +  - **TO BE TESTED** see [[https://github.com/Lomanic/presence-button/tree/multiroom|multiroom branch]] 
-  - **TODO** https://github.com/esp8266/Arduino/issues/4826#issuecomment-491813938 (insecure) https://github.com/esp8266/Arduino/pull/3271/files (more secure). https://github.com/SensorsIot/HTTPS-for-Makers+  - **TODO** https://github.com/esp8266/Arduino/issues/4826#issuecomment-491813938 (insecure) https://github.com/esp8266/Arduino/pull/3271/files (more secure). https://github.com/SensorsIot/HTTPS-for-Makers https://github.com/knolleary/pubsubclient/issues/462#issuecomment-542911896 very promising example, finally
   - **DONE** making the S20 regularly ping a remote server. This remote server would then send a message on Matrix saying Fuz is closed if it's not ping-ed after some delay. Implementing the latter using <del>MQTT ([[https://github.com/knolleary/pubsubclient|PubSubClient library]])</del> HTTP polling. <del>simpler, have an HTTP server on the S20 indicating if the button has been pushed once, and have an always-on esp8266 poll this webserver and notify the Matrix channel and a remote server when it's gone after a few minutes. S20 webserver done in [[https://gist.github.com/Lomanic/3ac81aa6bb5ce4cdb88da3a76fe4aa1c|sonoff_s20_wifimanager_longpress_matrix_events_webserver_admin.ino]] (with an admin interface as a bonus)</del>, S20 part done in [[https://github.com/Lomanic/presence-button/commit/450fdfcddf5a187fb261470427bf255231f175d5|450fdfcddf5a187fb261470427bf255231f175d5]], server side on the Glitch platform also done (via a JSON log file as container gets killed after a while and to be able to recover after being killed)   - **DONE** making the S20 regularly ping a remote server. This remote server would then send a message on Matrix saying Fuz is closed if it's not ping-ed after some delay. Implementing the latter using <del>MQTT ([[https://github.com/knolleary/pubsubclient|PubSubClient library]])</del> HTTP polling. <del>simpler, have an HTTP server on the S20 indicating if the button has been pushed once, and have an always-on esp8266 poll this webserver and notify the Matrix channel and a remote server when it's gone after a few minutes. S20 webserver done in [[https://gist.github.com/Lomanic/3ac81aa6bb5ce4cdb88da3a76fe4aa1c|sonoff_s20_wifimanager_longpress_matrix_events_webserver_admin.ino]] (with an admin interface as a bonus)</del>, S20 part done in [[https://github.com/Lomanic/presence-button/commit/450fdfcddf5a187fb261470427bf255231f175d5|450fdfcddf5a187fb261470427bf255231f175d5]], server side on the Glitch platform also done (via a JSON log file as container gets killed after a while and to be able to recover after being killed)
   - **ALMOST DONE** check out [[https://github.com/Lomanic/presence-button/commit/450fdfcddf5a187fb261470427bf255231f175d5|450fdfcddf5a187fb261470427bf255231f175d5]] and https://glitch.com/edit/#!/presence-button [[https://presence-button.glitch.me/|presence-button]], to be integrated on fuz.re   - **ALMOST DONE** check out [[https://github.com/Lomanic/presence-button/commit/450fdfcddf5a187fb261470427bf255231f175d5|450fdfcddf5a187fb261470427bf255231f175d5]] and https://glitch.com/edit/#!/presence-button [[https://presence-button.glitch.me/|presence-button]], to be integrated on fuz.re
Line 64: Line 65:
 Next steps: Next steps:
  
-  - investigate random crashes after some time, integrate the awesome [[https://github.com/krzychb/EspSaveCrash|EspSaveCrash]] library, maybe do as this dude [[https://www.esp8266.com/viewtopic.php?f=6&t=18716&start=4#79055|here]], but sending crash to HTTP server. See also https://arduino-esp8266.readthedocs.io/en/latest/faq/a02-my-esp-crashes.html+  - investigate random crashes after some time (check also why there is no polling anymore), integrate the awesome [[https://github.com/krzychb/EspSaveCrash|EspSaveCrash]] library, maybe do as this dude [[https://www.esp8266.com/viewtopic.php?f=6&t=18716&start=4#79055|here]], but sending crash to HTTP server. See also https://arduino-esp8266.readthedocs.io/en/latest/faq/a02-my-esp-crashes.html
   - handle multiple matrix channels configured (to listen to and to reply to)   - handle multiple matrix channels configured (to listen to and to reply to)
   - resolve HTTPS locally instead of relying on an HTTP/HTTPS proxy   - resolve HTTPS locally instead of relying on an HTTP/HTTPS proxy
projets/fuz/presence_button.txt · Last modified: 2023-02-02 22:06 by 127.0.0.1