2023-02-07 16:55:21 +01:00
# IoT Platform
2023-02-13 19:06:22 +01:00
## Docker
First install DockerDesktop and `docker-compose` :
2023-02-15 09:50:11 +01:00
- https://www.docker.com/products/docker-desktop/
- https://docs.docker.com/compose/install/
2023-02-13 19:06:22 +01:00
Then you can export a path to mount as a volume and spin up the containers:
2023-02-07 16:55:21 +01:00
```sh
2023-02-13 18:42:18 +01:00
export DATA_DIR = /some/path/to/mount
2023-02-07 16:55:21 +01:00
docker-compose --file software/container/docker-compose.yml up
```
2023-02-13 18:43:13 +01:00
2023-02-15 09:50:11 +01:00
### Mosquitto
```sh
mosquitto_sub -h localhost -t '#' -p 1883
mosquitto_pub -h localhost -p 1883 -t '/' -m $(date --utc +%s)
```
2023-02-13 19:06:22 +01:00
### Grafana
You can login to Grafana: http://localhost:3000/login (admin:admin)
### NodeRed
NodeRed is running here: http://localhost:1880/
## Hardware
2023-02-19 16:40:44 +01:00
We are using HelTec Automation Wirelsess Sticks ESP32 Dev-Boards.
### PinOut
The PinOut of our version 3 modules can be found here: https://docs.heltec.org/en/node/esp32/dev-board/hardware_update_log.html#wifi-lora-32-hardware-update-logs
2023-02-17 16:35:49 +01:00
2023-02-19 16:40:44 +01:00
![PinOut ](https://resource.heltec.cn/download/Wireless_Stick_V3/HTIT-WS_V3.png "PinOut" )
2023-02-19 17:18:50 +01:00
### License
For some parts of the Heltec board you need a ["license" ](https://docs.heltec.org/general/view_limited_technical_data.html#esp32-lora-series ).
2023-02-19 16:40:44 +01:00
### USB-C
2023-02-17 16:35:49 +01:00
Our HelTec Automation Wirelsess Sticks ESP32 Dev-Boards already have USB-C. But they do not support Power Deliver (PD). If your computer tries to do PD, just plug a cheap USB hub between the board and your computer.
2023-02-13 19:06:22 +01:00
### Arduino IDE
2023-02-17 16:19:51 +01:00
2023-02-19 16:40:44 +01:00
HelTecs GitHub repo can be found here: https://github.com/HelTecAutomation/Heltec_ESP32
2023-02-13 19:06:22 +01:00
2023-02-13 19:28:29 +01:00
I had to install VCP Drivers, first: https://www.silabs.com/developers/usb-to-uart-bridge-vcp-drivers?tab=downloads
You can add their Board Manager to the boards managers URLs: https://github.com/HelTecAutomation/Heltec_ESP32/blob/master/library.json and find their libraries in the IDE (Sketch -> Include Library -> Manage Libraries... Search for "heltec esp32").
2023-02-17 16:35:49 +01:00
> These boards are already *V3* boards, so be careful selecting the right board and port (VCP).
2023-02-17 16:19:51 +01:00
![Arduino IDE ](docs/images/flash-with-arduino.png "select the right board and port" )
2023-02-17 16:33:33 +01:00
### Install esptool
Esptool is a Pyhton program to flash ESP32. As it's a Pyhton tool you can install it using `pip` :
```sh
pip install esptool
```
2023-02-13 19:28:29 +01:00
### Find the port
2023-02-17 16:34:14 +01:00
Usually you can find the used port using `esptool.py` :
2023-02-13 19:06:22 +01:00
```sh
esptool.py write_flash_status --non-volatile 0
```
2023-02-13 18:45:43 +01:00
2023-02-17 16:19:51 +01:00
#### Using MicroPython
2023-02-17 16:36:41 +01:00
Download the firmware: https://micropython.org/download/
2023-02-13 18:45:43 +01:00
2023-02-17 16:19:51 +01:00
Flash it using `esptool` : https://micropython.org/download/GENERIC_S3/
```sh
esptool.py --chip esp32s3 write_flash -z 0 ~/Desktop/GENERIC_S3-20220117-v1.18.bin
```
2023-02-13 18:45:43 +01:00
2023-02-18 17:22:40 +01:00
## Hardware sensors
2023-02-20 16:59:29 +01:00
* [Energy Monitor ](./software/firmware/energy-monitor/README.md )