IOT: Difference between revisions
Jump to navigation
Jump to search
(→ESP32) |
|||
(24 intermediate revisions by the same user not shown) | |||
Line 9: | Line 9: | ||
[[https://mosquitto.org/ Mosquitto ]] | [[https://mosquitto.org/ Mosquitto ]] | ||
===== Manage Users ===== | |||
* Create Password File | |||
<pre> | |||
mosquitto_passwd -c /etc/mosquitto/passwd <user_name> | |||
</pre> | |||
* Add a new user | |||
<pre> | |||
mosquitto_passwd -b passwordfile user password | |||
</pre> | |||
* Update configuration file to use the password file | |||
==== Vernemq ==== | ==== Vernemq ==== | ||
Line 49: | Line 61: | ||
==Hardware== | ==Hardware== | ||
===ESP8266=== | |||
[[https://www.amazon.ca/gp/product/B01M8F95QH/ref=oh_aui_detailpage_o06_s00?ie=UTF8&psc=1 NodeMCU Lua ESP8266 ESP-12 WeMos D1 Mini WIFI 4M Bytes Development Board Module]] | [[https://www.amazon.ca/gp/product/B01M8F95QH/ref=oh_aui_detailpage_o06_s00?ie=UTF8&psc=1 NodeMCU Lua ESP8266 ESP-12 WeMos D1 Mini WIFI 4M Bytes Development Board Module]] | ||
[[File:Wemos-d1-mini-esp8266.jpg |center|Mini D1 Pinout]] | |||
[[https://www.adafruit.com/product/2471 Adafruit HUZZAH ESP8266]] | [[https://www.adafruit.com/product/2471 Adafruit HUZZAH ESP8266]] | ||
Line 57: | Line 72: | ||
* UART (upload à partir de la liaison série) GND 3.3v GND | * UART (upload à partir de la liaison série) GND 3.3v GND | ||
* SDIO (démarrage à partir d'une carde SD) peu importe peu importe 3.3v | * SDIO (démarrage à partir d'une carde SD) peu importe peu importe 3.3v | ||
===ESP32=== | |||
====ESP32 D1 mini==== | |||
[[File:Esp-Wroom-32.png|center|alt=Esp32 Wroom Pinout]] | |||
[[File:Esp32-wroom-32 datasheet.pdf|frame|alt=Esp32 Datashee]] | |||
====ESP32 Dev Nodemcu==== | |||
[[File:Esp-wroom-32-aideepen-pinout.jpg|alt=Esp32 Aideepen Pinout]] | |||
==IDE Arduino== | ==IDE Arduino== | ||
Line 105: | Line 129: | ||
* Upload Speed -> 115200 | * Upload Speed -> 115200 | ||
==== ESP23 MCU 2.8 Inch Smart Display ==== | |||
# If the port is not visible and get "usbfs: interface 0 claimed by ch341 while 'brltty' sets config #1" | |||
# Identify the vendor with lsusb -> Bus 001 Device 017: ID 1a86:7523 QinHeng Electronics CH340 serial converter | |||
# Disable the rule in /usr/lib/udev/rules.d/85-brltty.rules | |||
<pre> | |||
# Device: 1A86:7523 | |||
# Baum [NLS eReader Zoomax (20 cells)] | |||
###Nr001 ENV{PRODUCT}=="1a86/7523/*", ENV{BRLTTY_BRAILLE_DRIVER}="bm", GOTO="brltty_usb_run" | |||
</pre> | |||
# Reboot | |||
* Board URL (in the preference) [https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json] | |||
* Tools -> Boards -> "ESP32 Dev Module" | |||
* CPU Frequency: 240 Mhz (Wifi/BT) | |||
* Flash Mode: "DIO" | |||
* Flash Size: "4MB (32Mb)" | |||
Arduino Runs On: "Core 1" | |||
Events Run On: "Core 1" | |||
Programmer: "Esptool" | |||
* Upload Speed -> 115200 | |||
==== Wio Terminal ==== | ==== Wio Terminal ==== | ||
* Get Started | |||
# [https://wiki.seeedstudio.com/Wio-Terminal-Getting-Started/ Get Started] | |||
# [https://wiki.seeedstudio.com/Wio-Terminal-Displaying-Gyro/ Display Gyro Demo] | |||
* Library to load: sketch -> Include Library -> Add .ZIP Library | * Library to load: sketch -> Include Library -> Add .ZIP Library | ||
Line 116: | Line 165: | ||
# [https://github.com/Seeed-Studio/Seeed_Arduino_atWiFiClientSecure.git Seeed_Arduino_atWiFiClientSecure.git] | # [https://github.com/Seeed-Studio/Seeed_Arduino_atWiFiClientSecure.git Seeed_Arduino_atWiFiClientSecure.git] | ||
* Additional Board | * Additional Board: File > Preferences -> Additional Boards Manager URLs: | ||
# [https://files.seeedstudio.com/arduino/package_seeeduino_boards_index.json package_seeeduino_boards_index.json] | # [https://files.seeedstudio.com/arduino/package_seeeduino_boards_index.json package_seeeduino_boards_index.json] | ||
# Install additional boards: Tools > Board > Board Manager and Search Wio Terminal in the Boards Manager | |||
* Setup | * Setup | ||
# Tools -> Boards -> | # Tools -> Boards -> Seeeduino Wio Terminal | ||
# Cpu Frequency -> 120 Mhz | # Cpu Frequency -> 120 Mhz | ||
# Upload Speed -> | # Upload Speed -> | ||
==ESPHome== | |||
[https://esphome.io/ ESPHome] | |||
===ESPHome Installation=== | |||
====Docker option Dashboard==== | |||
* Get Docker Image | |||
<syntaxhighlight lang="Bash"> | |||
docker pull ghcr.io/esphome/esphome | |||
</syntaxhighlight> | |||
* Create a container and share port 6052 | |||
====Docker option command line==== | |||
* Create a project | |||
<syntaxhighlight lang="Bash"> | |||
docker run --rm -v "${PWD}":/config -it ghcr.io/esphome/esphome wizard livingroom.yaml | |||
</syntaxhighlight> | |||
====Local ESPHome Installation==== | |||
* Validate Python istallation | |||
<syntaxhighlight lang="Bash"> | |||
python3 -m venv venv | |||
</syntaxhighlight> | |||
* Create pythin virtual environement | |||
<syntaxhighlight lang="Bash"> | |||
source venv/bin/activate | |||
</syntaxhighlight> | |||
* Install ESPHome | |||
<syntaxhighlight lang="Bash"> | |||
pip3 install esphome | |||
</syntaxhighlight> | |||
* Validate ESPHome istallation | |||
<syntaxhighlight lang="Bash"> | |||
esphome version | |||
</syntaxhighlight> | |||
===Upload ESPHome Bin=== | |||
==== ESPHome Commande Line ==== | |||
esphome run configfile.yaml | |||
==== ESPHome Dashboard ==== | |||
* Connect to ESPHome docker port 6052 hppt://localhost:6052 with Chrome ! | |||
* Install from web using Plug into this computer | |||
==TroubleShooting== | ==TroubleShooting== |
Latest revision as of 02:03, 3 June 2024
Composant
Server
MQTT server
Mosquitto
[Mosquitto ]
Manage Users
- Create Password File
mosquitto_passwd -c /etc/mosquitto/passwd <user_name>
- Add a new user
mosquitto_passwd -b passwordfile user password
- Update configuration file to use the password file
Vernemq
[VerneMq ]
Manage Users
- Create or replace password file
vmq-passwd -c /etc/vernemq/vmq.passwd username
- Add a user to an existing password file
vmq-passwd -a /etc/vernemq/vmq.passwd username
- Delete User
vmq-passwd -D /etc/vernemq/vmq.passwd username
Show plugins
Show plugins vmq-admin plugin show
Enable Plugin vmq-admin plugin enable --name=vmq_acl
Disable a plugin vmq-admin plugin disable --name=vmq_acl
Blynk
[Blynk ]
Access
- Your Admin url is https://yourserver:9443/admin
- Your Admin login email is admin@blynk.cc
- Your Admin password is admin
Hardware
ESP8266
[NodeMCU Lua ESP8266 ESP-12 WeMos D1 Mini WIFI 4M Bytes Development Board Module]
Mode GPIO0 GPIO2 GPIO15
- Flash (démarrage normal: exécution du programme installé en Flash) 3.3v 3.3v GND
- UART (upload à partir de la liaison série) GND 3.3v GND
- SDIO (démarrage à partir d'une carde SD) peu importe peu importe 3.3v
ESP32
ESP32 D1 mini
File:Esp32-wroom-32 datasheet.pdf
ESP32 Dev Nodemcu
IDE Arduino
Configuration
General
- File -> Preferences -> Additional Boards Manager URLs :
- Tools -> Boards -> Boards Manager:
- Search for ESP8266
- Install Esp8266 by Esp8266 Community
NodeMCU Lua ESP8266 ESP-12 WeMos D1 Mini WIFI 4M Bytes
- Tools -> Boards -> "WeMos D1 R2 & Mini"
- CPU Frequency 80 Mhz
- Upload Speed -> 115200
Adafruit HUZZAH ESP8266 breakout
- Tools -> Boards -> "ESP32 Dev Module"
- CPU Frequency 80 Mhz
- Upload Speed -> 115200
HiGrow
- Tools -> Boards -> "Adafruit HUZZAH ESP8266"
- CPU Frequency 80 Mhz
- Upload Speed -> 921600
- Flasj Mode - DIO
Huzzah Reset
- Hold down the GPIO0 button, the red LED will be lit
- While holding down GPIO0, click the RESET button
- Release RESET, then release GPIO0
- When you release the RESET button, the red LED will be lit dimly, this means it's ready to bootload
Lolin NodeMcu v3
- Tools -> Boards -> "NodeMcu 1.0 (ESP-12E" Module)
- CPU Frequency 80 Mhz
- Upload Speed -> 115200
ESP23 MCU 2.8 Inch Smart Display
- If the port is not visible and get "usbfs: interface 0 claimed by ch341 while 'brltty' sets config #1"
- Identify the vendor with lsusb -> Bus 001 Device 017: ID 1a86:7523 QinHeng Electronics CH340 serial converter
- Disable the rule in /usr/lib/udev/rules.d/85-brltty.rules
# Device: 1A86:7523 # Baum [NLS eReader Zoomax (20 cells)] ###Nr001 ENV{PRODUCT}=="1a86/7523/*", ENV{BRLTTY_BRAILLE_DRIVER}="bm", GOTO="brltty_usb_run"
- Reboot
- Board URL (in the preference) [1]
- Tools -> Boards -> "ESP32 Dev Module"
- CPU Frequency: 240 Mhz (Wifi/BT)
- Flash Mode: "DIO"
- Flash Size: "4MB (32Mb)"
Arduino Runs On: "Core 1" Events Run On: "Core 1" Programmer: "Esptool"
- Upload Speed -> 115200
Wio Terminal
- Get Started
- Library to load: sketch -> Include Library -> Add .ZIP Library
- Seeed_Arduino_atWiFi
- Seeed_Arduino_FreeRTOS
- Seeed_Arduino_atUnified
- esp-at-lib esp-at-lib esp-at-lib
- Seeed_Arduino_mbedtls
- Seeed_Arduino_atWiFiClientSecure.git
- Additional Board: File > Preferences -> Additional Boards Manager URLs:
- package_seeeduino_boards_index.json
- Install additional boards: Tools > Board > Board Manager and Search Wio Terminal in the Boards Manager
- Setup
- Tools -> Boards -> Seeeduino Wio Terminal
- Cpu Frequency -> 120 Mhz
- Upload Speed ->
ESPHome
ESPHome Installation
Docker option Dashboard
- Get Docker Image
docker pull ghcr.io/esphome/esphome
- Create a container and share port 6052
Docker option command line
- Create a project
docker run --rm -v "${PWD}":/config -it ghcr.io/esphome/esphome wizard livingroom.yaml
Local ESPHome Installation
- Validate Python istallation
python3 -m venv venv
- Create pythin virtual environement
source venv/bin/activate
- Install ESPHome
pip3 install esphome
- Validate ESPHome istallation
esphome version
Upload ESPHome Bin
ESPHome Commande Line
esphome run configfile.yaml
ESPHome Dashboard
- Connect to ESPHome docker port 6052 hppt://localhost:6052 with Chrome !
- Install from web using Plug into this computer
TroubleShooting
sync
- Try to load a new project