HUB
Sign inSign up

2smartdev/esphome

By 2smartdev

•Updated almost 5 years ago

ESPHome image with 2Smart Cloud integration

Image
0

1.6K

2smartdev/esphome repository overview

⁠Local development

⁠Prerequirements

You need have device connected and .yml file changed after updates.

⁠Why it may be needed

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.

⁠Comands

⁠OSX/Windows

  1. 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
    
  2. Use docker image to compile the binaries:

    docker run --rm -v current_directiry:/config -it 2smartdev/esphome /config/device_example.yml compile
    
  3. 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"
    
  4. When process completed turn off and on device again.

  5. If everything is okay it should appear in web-interface and mobile app.

⁠Linux
  1. 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
    
  2. 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
    
  3. When process completed turn off and on device again.

  4. If everything is okay it should appear in web-interface and mobile app.

  1. 2Smart Cloud ESPHome documentation⁠
  2. Official ESPHome documentation⁠
  3. How to create a Wi-Fi switch to control via a mobile app and Telegram bot⁠
Tag summary
Recent tags
Content type
Image
Digest
Size
147.3 MB
Last updated
almost 5 years ago
docker pull 2smartdev/esphome:latest