====== Piedthon ======
This item as been lost somehow around october 2023~~
===== Goals =====
* make use of the pedestrian traffic light: make it controllable via WiFi via MQTT
===== Resources =====
* pedestrian traffic light, already hacked to run on regular AC power socket
* 1 [[webduino]]
* 2 relay module 3V
* wires (Dupont and electric cables for 220V AC)
* USB 5V charger
===== Roadmap =====
- install esp and relays to control each light individually
- secure connections using [[wp>veroboard]] or custom-made PCB
- flash [[webduino]] using Arduino IDE
- make it blink
- make it blink according to received MQTT messages
- enable wifi OTA upgrades
- add wifimanager
- make MQTT parameters configurable at runtime ([[https://github.com/prampec/IotWebConf|prampec/IotWebConf]]? see [[https://reddit.com/comments/e4pj1u|this reddit thread]] also)
===== Software =====
Code: https://git.interhacker.space/jeanjack/piedthon
The ESP listens to an MQTT channel at ''sonic.fuz.re'', described in [[:infra:mqtt]].
For testing, using [[https://github.com/shirou/mqttcli|mqttcli]]: ''%%while :; do for I in {0..3}; do mqttcli pub --host sonic.fuz.re -m "$I" -t piedthon/input; sleep 0.5; done; done%%''
or mosquitto ( package mosquitto-clients sur ubuntu ) : ''%%while :; do for I in {0..3}; do mosquitto_pub -h sonic.fuz.re -m "$I" -t piedthon/input; sleep "$J.5"; J="$I";done; done%%''
===== Hardware =====
:!: **RISK OF DEATH OR INJURY: always unplug the traffic light from mains when it is opened as the inside is not insulated at all** :!:
(Describe pinout here, components…)
{{:projets:fuz:piedthon:relays_webduino_connections.jpg?400|}}
Relay module Webduino
GND GND
VCC 3.3V
IN1 14 (relay controlling the green light)
IN2 16 (relay controlling the red light)
===== Follow-up =====
* Project created on **Fri 22-11-19** by **[[:user:lomanic|lomanic]]**