Skip to content

Initial to DIY firmware

In order to use your own OTA firmware, you need to overwrite the original OTA password, which makes it impossible to overwrite the original OTA firmware directly with your own firmware. Because the OTA key of the original firmware is not public, for the initial overwrite, you'll have to touch the sensor entity and connect it to your computer device.
Here are some ways to make initializing the firmware possible.

Pre-compile initialization firmware~

If you need a factory firmware that we have compiled, this is one of our recently compiled firmware, it due to a bit of a rush, please consider just using it to overwrite the ota key with, the overwritten key will be:

ota:
  # This won't work for the original firmware(we use diffrent ota password),
  # so if you want to turn it into your own OTA, 
  # make sure to completely flash your custom yaml in the firmware once.
  # after that, you may always ota with your own password.
  password: "all-things-in-their-being-are-good-for-something" # words by Socrates

Downloads
factoryToEnterDIY_V2023_0715_1.bin

Rewirte use esphome on pc~

This is one of the easiest ways: - Make sure the 1u sensor is working properly: able to access the network, able to connect ha. - No need to open the box, can't get into dfu mode. - You will need to install esphome on your computer, either in a python virtual environment or directly in the original environment.

We found that using the addon method of esphome trying to write to a usb device that is not on the ha machine will not work. But if you plug the S2 into a usb port on a host machine that is in HA, then it seems like it might have a chance of success.

The downside of it is that there are some chances that it may not boot into swipe mode.

Operation Procedure: - Plug the sensor into the computer and make sure it is working properly.
- Prepare your initial source code for esphome, which can be downloaded from our github and put into your esphome config directory.

  • Click Install and select [Plug into the computer running ESPHome Dashboard].

  • chooice S2

  • The installation will fail after the initial compilation, but it doesn't matter, wait 2 seconds, because at this point the device is already in download mode, but the usb port is disconnected.

  • Click RETRY and now there is a chance to write in the swipe mode again.

  • The second time will be flashed successfully, and then prompt the serial port to close, at this time you can see the sensor flashing light, then the firmware has been written.

Rewirte use esptool.py~

This method uses Loxin's command line brushing tool, esptool.py. You'll need to first install an esptool.py to your computer

esptool link

install use pip

$ pip install esptool

download a pre-factory firmware(you can use ours at downloads,or make you own.)

Go to the directory where you downloaded the initial firmware

cd /home/mydiypath

Use the following commands for simple brushing, if you are on Windows please use the corresponding com port, the following example is on a mac

esptool.py --port /dev/tty.usbmodem01 write_flash 0x0 factoryToEnterDIY-screek-humen-sensor-1u-230715_1.bin

Using the swipe command above, there will be two scenarios that you can try depending on the situation:

  • If you're not in dfu mode, but the firmware is running normally, it will need to be flashed twice, the first time it will go into the bootloader:
  • If the twice approach doesn't work, then manually go into dfu mode (turn on the box, hold down the 1 button, and press rst), then perform a swipe, and manually re-power up the box after the swipe (either by pressing rst or by re-plugging the usb). Then the flashing can also be completed.