listeningdaemon/arduino/MQTT/readme.md

25 lines
782 B
Markdown
Raw Normal View History

2024-10-29 13:46:41 +00:00
# Running the Arduino side
The arduino listens to MQTT messages, and acts accordingly. Each arduino can serve a different purpose, for instance, running motor shields, or turning a fan on/off.
### 1. Create your own "secret.h" file, following this format
```C++
#define VITRINE_SSID "";
#define VITRINE_WIFI_PASS ""
#define MQTT_ARDUINO_USERNAME ""
#define MQTT_ARDUINO_PASS ""
```
### 2. Select your board to compile with. As I always forget which boards to select, here's my cheat sheet:
| Arduino | Board |
| ------------- | ------------- |
| ArduinoWifi | LOLIN(WeMos) D1 R1 |
| ... | ... |
### 3. Do something with the make files
arduino-cli compile -b arduino:avr:uno --build-property "build.extra_flags=\"-DMY_DEFINE=\"hello world\"\"" /home/user/Arduino/MySketch