projets:fuz:presence_button
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
projets:fuz:presence_button [2019-11-01 23:52] – [Hardware] Lomanic | projets:fuz:presence_button [2019-12-02 00:24] – [Software] link to glitch Lomanic | ||
---|---|---|---|
Line 6: | Line 6: | ||
</ | </ | ||
- | ===== What does it look like? ===== | ||
- | |||
- | In the meatspace, a button sets the hackerspace in OPEN mode. It does light a 🚨 beacon 🚨 which is pretty amazing. It also makes this status available to a [[: | ||
- | |||
- | FIXME Unfortunately, | ||
===== Hardware ===== | ===== Hardware ===== | ||
* some glorious esp8266 in a Sonoff S20 power plug (NodeMCU v0.9 for development) | * some glorious esp8266 in a Sonoff S20 power plug (NodeMCU v0.9 for development) | ||
- | * another esp8266 to check when the S20 goes down (Fuz closing) | ||
To flash a Sonoff S20, solder the pins on the left of the push button, connect your USB-to-Serial convertor (RobotDyn CH340G in this case) to the headers like in the image below (from top to bottom, GND, TX, RX, 3.3v VCC), push Sonoff button while plugging in your USB-to-Serial convertor in your PC and then release the push button after a few seconds (check out [[https:// | To flash a Sonoff S20, solder the pins on the left of the push button, connect your USB-to-Serial convertor (RobotDyn CH340G in this case) to the headers like in the image below (from top to bottom, GND, TX, RX, 3.3v VCC), push Sonoff button while plugging in your USB-to-Serial convertor in your PC and then release the push button after a few seconds (check out [[https:// | ||
Line 22: | 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' | 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' | ||
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 '' | + | You can also use '' |
+ | Using a FTDI as below is more practical as it's able to properly power the Sonoff S20. **Don' | ||
+ | |||
+ | {{: | ||
+ | |||
+ | ===== Software ===== | ||
+ | |||
+ | See [[https:// | ||
+ | |||
+ | See [[https:// | ||
===== 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 56: | ||
- **TODO** | - **TODO** | ||
- **TODO** https:// | - **TODO** https:// | ||
- | - **DOING** <del>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:// | + | - **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:// |
- | - **TODO** needs a publicly accessible server to serve an image/API (probably the same server as previous step), include the image/JS on fuz.re | + | - **ALMOST DONE** check out [[https://github.com/ |
- ?? | - ?? | ||
- **TODO** | - **TODO** | ||
- | Today the elementary functionalities described in step 2 are implemented [[https:// | + | Today the button can notify on Matrix when it's pressed after initialization or after being notified on Matrix, and a server registers pings from the button to notify on Matrix that the Fuz is closed. |
Next steps: | Next steps: | ||
+ | - investigate random crashes after some time, integrate the awesome [[https:// | ||
- 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 a HTTP/HTTPS proxy | + | - resolve HTTPS locally instead of relying on an HTTP/HTTPS proxy |
- | ===== Arduino sketch | + | ===== Arduino sketch |
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 76: | Line 80: | ||
* [[https:// | * [[https:// | ||
* [[https:// | * [[https:// | ||
+ | |||
+ | Subsequent versions on [[https:// | ||
===== Resources ===== | ===== Resources ===== |
projets/fuz/presence_button.txt · Last modified: 2023-02-02 22:06 by 127.0.0.1