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-10-16 20:12] – [Presence button] Lomanicprojets:fuz:presence_button [2019-11-03 18:52] – [Current status] Lomanic
Line 5: Line 5:
   * Notifying that the Hackerspace is open/closed on different channels (Matrix, Fuz.re homepage), while respecting the privacy of attendants   * Notifying that the Hackerspace is open/closed on different channels (Matrix, Fuz.re homepage), while respecting the privacy of attendants
 </WRAP> </WRAP>
 +
  
 ===== Hardware ===== ===== Hardware =====
Line 15: Line 16:
 Unplug the 3V3 VCC cable to be able to watch the serial monitor when the Sonoff is powered on through main **else you will fry the esp**. You can also flash Sonoff's esp like this (**be careful to not touch main current through the Sonoff** when manipulating it). \\  Unplug the 3V3 VCC cable to be able to watch the serial monitor when the Sonoff is powered on through main **else you will fry the esp**. You can also flash Sonoff's esp like this (**be careful to not touch main current through the Sonoff** when manipulating it). \\ 
 It also looks like when the program is of a given size, the USB/serial adapter (CH340G at least) is not able to give enough current for the esp to run properly (crashes in loop with stacktraces). An FTDI adapter looks more reliable.\\ It also looks like when the program is of a given size, the USB/serial adapter (CH340G at least) is not able to give enough current for the esp to run properly (crashes in loop with stacktraces). An FTDI adapter looks more reliable.\\
-You can also use ''screen /dev/ttyUSB0 115200'' to watch the serial monitor, but Arduino IDE serial monitor is more practical to use as it is relaunched each time it detects when the USB/serial adapter is plugged to a running chip. +You can also use ''screen /dev/ttyUSB0 115200'' to watch the serial monitor, but Arduino IDE serial monitor is more practical to use as it is relaunched each time it detects when the USB/serial adapter is plugged to a running chip
 + 
 +Using a FTDI as below is more practical as it's able to properly power the Sonoff S20. **Don't forget to set the jumper to 3.3V or you will fry the ESP**. 
 + 
 +{{:projets:fuz:presence_button:sonoff_s20_ftdi_pinout.jpg?200|}} 
 + 
 +===== Software ===== 
 + 
 +See [[https://github.com/Lomanic/presencebutton|Lomanic/presencebutton]] on Github.
  
 ===== Roadmap ===== ===== Roadmap =====
Line 46: Line 55:
   - **TODO**   - **TODO**
   - **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
-  - **DOING** 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 MQTT ([[https://github.com/knolleary/pubsubclient|PubSubClient library]]).  +  - **DOING** 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 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/presencebutton/commit/450fdfcddf5a187fb261470427bf255231f175d5|450fdfcddf5a187fb261470427bf255231f175d5]] 
-  **TODO** needs publicly accessible server to serve an image/API (probably the same server as previous step), include the image/JS on fuz.re and yadda!+  - **ALMOST DONE** check out [[https://github.com/Lomanic/presencebutton/commit/450fdfcddf5a187fb261470427bf255231f175d5|450fdfcddf5a187fb261470427bf255231f175d5]] and https://glitch.com/edit/#!/presence-button [[https://presence-button.glitch.me/|presence-button]], still need to find a way to reliably send a message after a delay once on the Glitch platform
   - ??   - ??
   - **TODO**   - **TODO**
Line 56: Line 65:
  
   - handle multiple matrix channels configured (to listen to and to reply to)   - handle multiple matrix channels configured (to listen to and to reply to)
 +  - notify when the Fuz is closing
   - resolve HTTPS locally instead of relying on a HTTP/HTTPS proxy   - resolve HTTPS locally instead of relying on a HTTP/HTTPS proxy
  
-===== Arduino sketch versions =====+===== Arduino sketch revisions =====
  
 In chronological order for a better comprehension compared to the note-taking style above In chronological order for a better comprehension compared to the note-taking style above
Line 68: Line 78:
   * [[https://gist.github.com/Lomanic/06c1a2d873dfbd9be93db7c965117f91|sonoff_s20_multiwifi_matrix_events.ino]]   * [[https://gist.github.com/Lomanic/06c1a2d873dfbd9be93db7c965117f91|sonoff_s20_multiwifi_matrix_events.ino]]
   * [[https://gist.github.com/Lomanic/dba3cd9f93161cc1acc32c83197298eb|sonoff_s20_wifimanager_longpress_matrix_events.ino]]   * [[https://gist.github.com/Lomanic/dba3cd9f93161cc1acc32c83197298eb|sonoff_s20_wifimanager_longpress_matrix_events.ino]]
 +  * [[https://gist.github.com/Lomanic/3ac81aa6bb5ce4cdb88da3a76fe4aa1c|sonoff_s20_wifimanager_longpress_matrix_events_webserver_admin.ino]]
 +
 +Subsequent versions on [[https://github.com/Lomanic/presencebutton|Github Lomanic/presencebutton]].
  
 ===== Resources ===== ===== Resources =====
projets/fuz/presence_button.txt · Last modified: 2023-02-02 22:06 by 127.0.0.1