ESPHome image with 2Smart Cloud integration
1.6K
You need have device connected and .yml file changed after updates.
It may be usefull, if you are testing your firmware configuration and making lot of changes to .yml file.
It's much faster to compile new firmware with changes locally.
Open folder after unzipping downloaded archive in terminal (there should be config file device_example.yml and folder with build):
$ cd <unzipped_archive>
$ ls -la .
total 2136
drwx------@ 12 user group 384 Mar 15 12:52 .
drwx------@ 34 user group 1088 Mar 15 12:52 ..
-rwxr-xr-x@ 1 user group 3684 Mar 15 10:51 2smart.sh
-rwxr-xr-x@ 1 user group 4228 Mar 15 10:51 2smart_docker.sh
-rw-r--r--@ 1 user group 12248 Mar 15 10:51 2smartota.py
-rw-r--r--@ 1 user group 4145 Mar 15 10:51 README.md
-rw-r--r--@ 1 user group 8192 Mar 15 10:51 boot_app0.bin
-rw-r--r--@ 1 user group 15872 Mar 15 10:51 bootloader_dio_40m.bin
-rw-r--r--@ 1 user group 704 Mar 15 10:51 device_example.yml
-rw-r--r--@ 1 user group 143640 Mar 15 10:51 esptool.py
-rw-r--r--@ 1 user group 876992 Mar 15 10:51 firmware.bin
-rw-r--r--@ 1 user group 3072 Mar 15 10:51 partitions.bin
Use docker image to compile the binaries:
docker run --rm -v current_directiry:/config -it 2smartdev/esphome /config/device_example.yml compile
Upload compiled binaries to device:
python3 esptool.py \
--chip esp32 \
--port /dev/cu.SLAB_USBtoUART \
--baud 115200 \
--before default_reset \
--after hard_reset \
write_flash \
-z \
--flash_mode dio \
--flash_freq 40m \
--flash_size detect \
0x1000 bootloader_dio_40m.bin \
0x8000 partitions.bin \
0xe000 boot_app0.bin \
0x10000 firmware.bin"
When process completed turn off and on device again.
If everything is okay it should appear in web-interface and mobile app.
Open folder after unzipping downloaded archive in terminal (there should be config file .yml and folder with build):
$ cd <unzipped_archive>
$ ls -la .
total 2136
drwx------@ 12 user group 384 Mar 15 12:52 .
drwx------@ 34 user group 1088 Mar 15 12:52 ..
-rwxr-xr-x@ 1 user group 3684 Mar 15 10:51 2smart.sh
-rwxr-xr-x@ 1 user group 4228 Mar 15 10:51 2smart_docker.sh
-rw-r--r--@ 1 user group 12248 Mar 15 10:51 2smartota.py
-rw-r--r--@ 1 user group 4145 Mar 15 10:51 README.md
-rw-r--r--@ 1 user group 8192 Mar 15 10:51 boot_app0.bin
-rw-r--r--@ 1 user group 15872 Mar 15 10:51 bootloader_dio_40m.bin
-rw-r--r--@ 1 user group 704 Mar 15 10:51 device_example.yml
-rw-r--r--@ 1 user group 143640 Mar 15 10:51 esptool.py
-rw-r--r--@ 1 user group 876992 Mar 15 10:51 firmware.bin
-rw-r--r--@ 1 user group 3072 Mar 15 10:51 partitions.bin
Use our custom ESPHome docker image to compile and flash the firmware:
docker run --rm -v current_directory:/config --device=/dev/ttyUSB0 -it 2smartdev/esphome /config/device_example.yml run
When process completed turn off and on device again.
If everything is okay it should appear in web-interface and mobile app.
docker pull 2smartdev/esphome:latest