update esphome

This commit is contained in:
kev 2024-01-03 18:42:13 +08:00
parent 456582ddcb
commit 9d4acb2fe5
5 changed files with 74 additions and 2 deletions

View File

@ -11,4 +11,24 @@ $ docker-compose up -d
$ curl http://127.0.0.1:6052
```
## flashing new device
```bash
$ udevadm info -q property -n /dev/ttyACM0 --property=ID_SERIAL
$ docker compose exec esphome bash
>>> cd /config
>>> esphome ibeacon.yaml run
====== [SUCCESS] Took 253.61 seconds ======
INFO Successfully compiled program.
Found multiple options for uploading, please choose one:
[1] /dev/ttyACM0 (USB JTAG/serial debug unit)
[2] Over The Air (esphome-esp32c3-ibeacon.local)
(number): 1
INFO Successfully uploaded program.
INFO Starting log output from /dev/ttyACM0 with baud rate 115200
^C
>>> ping esphome-esp32c3-ibeacon.lan
>>> exit
```
[1]: https://esphome.io/

40
esphome/data/ibeacon.yaml Normal file
View File

@ -0,0 +1,40 @@
#
# See:
# - https://esphome.io/components/esp32.html
# - https://esphome.io/components/esp32_ble_beacon.html
# - https://registry.platformio.org/platforms/platformio/espressif32/boards
#
esphome:
name: esphome-esp32c3-ibeacon
platform: esp32
board: dfrobot_beetle_esp32c3
logger:
api:
password: !secret api_password
ota:
password: !secret ota_password
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
domain: .lan
mqtt:
broker: broker.hivemq.com
port: 1883
#username: !secret mqtt_username
#password: !secret mqtt_password
esp32_ble_beacon:
type: iBeacon
uuid: "00000000-0000-0000-0000-000000000000"
major: 11111
minor: 22222
min_interval: 100ms
max_interval: 100ms
measured_power: -59
tx_power: 3

View File

@ -0,0 +1,6 @@
api_password: secret
ota_password: secret
wifi_ssid: OpenWrt
wifi_password: secret
mqtt_username: esphome
mqtt_password: secret

View File

@ -1,9 +1,15 @@
version: "3.8"
services:
esphome:
image: esphome/esphome
image: esphome/esphome:stable
ports:
- "6052:6052"
volumes:
- ./data:/config
environment:
- ESPHOME_DASHBOARD_USE_PING=true
### FOR THE FIRST-TIME ONLY ###
#devices: #
# - /dev/ttyACM0 #
###############################
restart: unless-stopped

View File

@ -20,7 +20,7 @@ chmod +x cc2538-bsl.py
./cc2538-bsl.py --help
ls /dev/ttyUSB*
udevadm info -q property -n /dev/ttyUSB0 --property=ID_MODEL
udevadm info -q property -n /dev/ttyUSB0 --property=ID_SERIAL
./cc2538-bsl.py --bootloader-sonoff-usb -p /dev/ttyUSB0 -evw CC1352P2_CC2652P_launchpad_coordinator_20230507.hex
```