Esp-homekit-devices: Flashing Tasmota device OTA with esp-homekit-devises

Created on 23 Dec 2019  Ā·  104Comments  Ā·  Source: RavenSystem/esp-homekit-devices

Is it possible to flash a device that is running Tasmota with esp-HomeKit-devices OTA? When I try to upgrade the firmware with main.bin from HAA I get an error: ā€œ Magic byte is not 0xE9ā€. Thanks for any help on this!

HAA

Most helpful comment

The process is very easy but if you haven't done so before it might feel complicated. You will need a raspberry with WLAN capability and a secondary device with wifi capabilities (i.e. mobile, tablet,pc). I had a rpi 2 with a usb wifi adapter, but it should work with rpi3/rpi4.

To my understanding, all devices running tuya software are looking for a known SSID network when are in pairing mode. Once they are connected to that network, they can be updated. This is exactly what the tuya-convert does. It creates an AP on the RPi and emulates the update process. It can serve Tasmota, ESPurna or any other software we like, in our case LCM which will lead us to HAA.

Note: this process may lead to a bricked/faulty device. It worked for me, but may not work for somebody else. I won't be able to provide help if something goes wrong and your device is bricked. If you want to take the risk though, then here are the steps I followed:

1) First of all I strongly suggest to prepare a SD card with the latest clean Raspbian OS and no other software on it. Raspberry should be connected via LAN cable to your network because its WIFI will be used for creating an AP. As soon you are able to log into the raspberry you should be good to proceed with the next commands.

2) run the following commands:

# git clone https://github.com/ct-Open-Source/tuya-convert
# cd tuya-convert
# ./install_prereq.sh

During the above steps, I was asked to deactivate some processes. I confirmed everything with "Y" as I didn't mind. You are suggested to do the same. That's why working on a brand new Raspbian installation matters.

3) Make sure your wifi adapter is identified as "wlan0" by running the following command
# iwconfig

If by any chance your wifi adapter is identified as "wlan1" you will need to use your favorite editor and correct the following file. In that case, the command would be :
nano config.txt

4) Download the file from this link and put it into folder ~/tuya-convert/files/

5) You are now able to start the AP process by giving the next command:
./start_flash.sh
Wait until you reach to a point where it says "3. Press ENTER to continue"

6) Take your secondary device and connect to a wifi network called "vtrust-flash". I don't know why this is needed but I did it as this was part of the process. There will be no other use for the secondary device.

7) Take your smart IoT device and put it into pairing/setup mode. For me, all I needed to do was press the button for a few seconds. Then the led started blinking fast.
Risk mode ON

8) Press Enter to the rpi terminal and watch the process. It will take a few seconds. Mainly, the process backup the current factory firmware and then loads a temporary firmware to the device that will help you load the third party firmware you want. I believe this is the point where no restart is allowed as it would negatively affect the whole process.

9) As soon as the previous process is completed, a few options are offered. Option '0' loads the original firmware back. Option '3' will load the thirdparty.bin (supposingly you did copy the file in step 4). Press 3 and wait. The process will take a few seconds and once done the IoT device will restart.

This was it. If you search for Wifi networks you will find LCM-xxxx, the rest of the process is well known.

Extra Notes to keep in mind:
Please be extra careful in what you do. Since those IoT devices do not offer serial PINs like Sonoff devices, it will be very difficult to solder wires and flash using the normal method.

Although the tuya-convert process saves the original firmware, if you run all steps of the above guide, you will end up with LCM firmware hence you won't be able to go back to original firmware without soldering wires.

Good luck!

All 104 comments

Did you erased the old firmware first?

Search vglucas repo here in github ... you'll find an homekit flasher

I did it using this ct-Open-Source/tuya-convert#389 (comment)

Would you please share the steps you followed to install HAA using the Tasmota firmware update method? After the installation you have OTA functionality through LCM?

Tasmota is not Tuya, but you can try using firmware from "Tuya-Convert OTA Version":
https://github.com/RavenSystem/esp-homekit-devices/wiki/Installation#third-party-installation-tools

After the installation you have OTA functionality through LCM?

Yes, you install LCM firmware and then you setup repo, wifi...

And please, comment and results. ;)

Sure! Stay tuned :)

Good news! I have used the steps as described by @tonysprenk on the reddit page and LCM was installed on my Blitzwolf BW-SHP6.

Many thanks! Very helpful!

May I add a suggestion? When device is in Setup mode, a LED could be slowly blinking to show the status? It would be very helpful because LCM takes a few minutes to complete and when you have no serial connection to the device you are blind :)

Can you explain here each step?

Sure, just give me a few time to write a mini guide :)

The process is very easy but if you haven't done so before it might feel complicated. You will need a raspberry with WLAN capability and a secondary device with wifi capabilities (i.e. mobile, tablet,pc). I had a rpi 2 with a usb wifi adapter, but it should work with rpi3/rpi4.

To my understanding, all devices running tuya software are looking for a known SSID network when are in pairing mode. Once they are connected to that network, they can be updated. This is exactly what the tuya-convert does. It creates an AP on the RPi and emulates the update process. It can serve Tasmota, ESPurna or any other software we like, in our case LCM which will lead us to HAA.

Note: this process may lead to a bricked/faulty device. It worked for me, but may not work for somebody else. I won't be able to provide help if something goes wrong and your device is bricked. If you want to take the risk though, then here are the steps I followed:

1) First of all I strongly suggest to prepare a SD card with the latest clean Raspbian OS and no other software on it. Raspberry should be connected via LAN cable to your network because its WIFI will be used for creating an AP. As soon you are able to log into the raspberry you should be good to proceed with the next commands.

2) run the following commands:

# git clone https://github.com/ct-Open-Source/tuya-convert
# cd tuya-convert
# ./install_prereq.sh

During the above steps, I was asked to deactivate some processes. I confirmed everything with "Y" as I didn't mind. You are suggested to do the same. That's why working on a brand new Raspbian installation matters.

3) Make sure your wifi adapter is identified as "wlan0" by running the following command
# iwconfig

If by any chance your wifi adapter is identified as "wlan1" you will need to use your favorite editor and correct the following file. In that case, the command would be :
nano config.txt

4) Download the file from this link and put it into folder ~/tuya-convert/files/

5) You are now able to start the AP process by giving the next command:
./start_flash.sh
Wait until you reach to a point where it says "3. Press ENTER to continue"

6) Take your secondary device and connect to a wifi network called "vtrust-flash". I don't know why this is needed but I did it as this was part of the process. There will be no other use for the secondary device.

7) Take your smart IoT device and put it into pairing/setup mode. For me, all I needed to do was press the button for a few seconds. Then the led started blinking fast.
Risk mode ON

8) Press Enter to the rpi terminal and watch the process. It will take a few seconds. Mainly, the process backup the current factory firmware and then loads a temporary firmware to the device that will help you load the third party firmware you want. I believe this is the point where no restart is allowed as it would negatively affect the whole process.

9) As soon as the previous process is completed, a few options are offered. Option '0' loads the original firmware back. Option '3' will load the thirdparty.bin (supposingly you did copy the file in step 4). Press 3 and wait. The process will take a few seconds and once done the IoT device will restart.

This was it. If you search for Wifi networks you will find LCM-xxxx, the rest of the process is well known.

Extra Notes to keep in mind:
Please be extra careful in what you do. Since those IoT devices do not offer serial PINs like Sonoff devices, it will be very difficult to solder wires and flash using the normal method.

Although the tuya-convert process saves the original firmware, if you run all steps of the above guide, you will end up with LCM firmware hence you won't be able to go back to original firmware without soldering wires.

Good luck!

Thanks to @peros550 @tonysprenk @RavenSystem @kueblc
today I already flash 4x Gosund SP111-2 to Tasmota with tuya convert but later I read about esp-homekit-device and this is what I want.

but I want to know can I flash the esp-homekitFW with Tasmota ?
or I need to use tuya convert again ?
how can I bring the SP111 Plugs back I pairing mode to use tuya convert again but flash it with the thirdparty.bin?

Thanks for the Guide!

As far as I’ve tried it’s not possible. There is a ā€œupgradeā€ mechanism built into tasmota where you can upload a .bin file but it won’t take main.bin from HAA and whenever I’ve uploaded compiled HAA firmware (https://github.com/ct-Open-Source/tuya-convert/wiki/Flash-a-multipart-binary) it has bricked the device. So proceed with caution. Tuya-convert can only be used on a device running Tuya firmware. Just thinking of it now you might be able to upload the firmware used by ESPOTA (https://blog.stigok.com/2018/06/13/esp8266-ota-updates-command-line.html) through the tasmota upgrade mechanism after which you can use ESPOTA to upload esp-HomeKit-devices main.bin. Good luck!

My English is Not Good and i can Not connect the SP111 with FTDI (Serial)

Is there no way to go back from Tasmota to other FWs? (without Serial)

@tonysprenk
i Need to Open the sp111 case and solder cable to some Points..?
or can i make ESPOTA Same way as i did with tuya convert ?

You would need an intermediate firmware in between Tasmota and ESPOTA as they use different bootloaders. The intermediate firmware we use in tuya-convert could be modified for this purpose. I may be able to help put that together.

@kueblc hey this sound like very good news! If possible please give us some help on how to go from tasmota to LCM

I'm very keen to test the process and report back. I have a few spare sonoff basic running tasmota ready for test :)

I had some time today so I took a closer look. I was mistaken earlier in saying that an intermediate firmware would be needed, turns out the eboot in Tasmota can be used to do the upgrade just fine.

Older versions of Tasmota (<7.1.2.6) should be able to upload the assembled multipart binary as is. Newer versions of Tasmota include a Tasmota version check. Assuming you want to upload a Tasmota firmware, this ensures they are compatible versions. If you try uploading a different firmware, you'll get a very unhelpful "incompatible" error message.

Luckily we can trick the version check pretty easily as it just looks for some magic bytes. All we need to do is append this marker with a high "version number" and it will be accepted by Tasmota. The magic sequence is A55AA55A FFFFFFFF 5AA55AA5.

I've gone ahead and made the above modifications to the multipart homekit binary, tested and working fine on my development board. Attached here if you would like to try it for yourself.

homekit-from-tasmota.zip

and this i can Flash from every TasmotaFW to the homekitFW?
or is this for tuya convert?

You can install from Tasmota (or any other Arduino based ESP firmware) and also with tuya-convert.

I try it from Tasmota 8.1.0 it but not working also with the tasmota-minimal.bin 8.1.0

Upload Failed
Program flash size is larger than real flash size

I try 1 Gosund SP111 Plug to Downgrad from 8.1.0 to 7.2.0 all OK.
then I try to go from 7.2.0 to 7.1.1 and then after the update the Plug not come back and stop working.

I see that I forgot to change flash settings back from my development board. I fixed this and just updated the link, download the updated binary and try again.

i Flash the next Gosund Sp111 from Tasmota to HAA with the new File (updated link) and i see now the AP LCM-XXXX but I not can connect to it.

maybe same problem here:
https://github.com/HomeACcessoryKid/life-cycle-manager/issues/18
https://github.com/RavenSystem/esp-homekit-devices/issues/703

i solved the Problem the AP have IP 192.168.4.4 but I need to connect to 192.168.4.1
what OTA resorsitory need to use?
now this stand inside: HomeACcessoryKid/ota-demo
or change it to: RavenSystem/haa. ?

I can Not finished the AP Setup i always come back to the AP Settings (Waiting 10 Minute After Click Join Network)

I’ve had this same problem with every device I flashed from tasmota even before @kueblc made the special firmware. Looks like the firmware is not written to the esp in the right way. See issue #650 . In that issue we came to the conclusion that the only option would be to open the device and flash it by serial so soldering wires to it to connect it to a computer.

If you are connecting by wire and are able to retrieve a backup of the firmware, I can use this to further debug what went wrong. Can you clarify if this is an issue only when starting from Tasmota or does it occur when converting from Tuya firmware?

I don’t have the ability to connect by wire, yet. If and when I do I will post a backup.

If you are connecting by wire and are able to retrieve a backup of the firmware, I can use this to further debug what went wrong. Can you clarify if this is an issue only when starting from Tasmota or does it occur when converting from Tuya firmware?

Hi kueblc,
You can find backup of the firmware below.
[https://1drv.ms/u/s!AiTGTuFwWDphk0qJ0zK8yA7sp05j?e=1cxuqq]

This (homekit-from-tasmota.zip) has been uploded to sonoff basic via firmvare verison 8.1.0.3 OTA upload firmware function.
As mentioned above, I connected to device through 192.168.1.4 but "join" button does not seem to trigger any action and I could not proceed. Let me know if I can help further.

Couldn't wait any longer, so here's my trial.
I've flashed Sonoff T1 wall switch from Tasmota 8.1.0 to LCM/HAA using recent "homekit-from-tasmota.zip".
Serial log including upgrade, LCM config via Serial and then WiFi Manager:
https://pastebin.com/pX5h0rkG
Backup of the flash running kueblc's custom LCM:
https://yadi.sk/d/kNQU4B6wr1UnVw

Most interesting parts are:

  1. WiFi setup indeed does nothing and goes round and round:
>>> wifi_config: wifi_config_server_on_settings_update: Update settings, body = ssid=Sweet+Home&password=SSID1PASS&otarepo=RavenSystem%2Fhaa&otafile=main.bin&otabeta=0
>>> wifi_config: wifi_config_station_connect: No configuration found
>>> wifi_config: Client disconnected
  1. LCM has an option to input WiFi and repo settings directly into serial console. With this custom binary it leads to BSOD:
Enter the wifi password or <enter> to skip
Result:
Fatal exception (28): 

Just a reminder how a good LCM OTA looks like: https://pastebin.com/dR5NAXDk
Specifically it doesn't have this at LCM boot:
WARNING: Could not initialize sysparams (1)!

@kueblc

Thank you @unscel and @i3laze for collecting this data. I apologize for the late response, for we have had a recent loss in the family. I will try to get around to this later this week. Please feel free to ping me if I do not follow up soon.

@kueblc, my deepest sympathies to you and your family.

@kueblc my thoughts go out to you and your family!

I am sorry for your loss Colin.

Thank you all.

I was able to work on this a bit today. Unfortunately, I had the same symptoms whether I used the posted binary or a clean install on a freshly wiped flash.

My hope was that the difference would become apparent when comparing a working backup with a corrupted one. Would someone be able to provide a backup of LCM that is configured and working as expected on your hardware?

Thank you all.

I was able to work on this a bit today. Unfortunately, I had the same symptoms whether I used the posted binary or a clean install on a freshly wiped flash.

My hope was that the difference would become apparent when comparing a working backup with a corrupted one. Would someone be able to provide a backup of LCM that is configured and working as expected on your hardware?

Hi @kueblc ,
There it is https://1drv.ms/u/s!AiTGTuFwWDphk0zZJ_l1wjmmsBej?e=6Dajxv

Link above didn't work for me.. _(actually does by copy&paste)_

So.. here's same Sonoff T1 erased and flashed with just vanilla LCM (rboot+blank_config+otaboot):
https://yadi.sk/d/gQ0C1wkBze1h4g

By the way, LCM development is in progress and there might be extra fixes useful for the task:
https://github.com/HomeACcessoryKid/LCMdev/releases

@kueblc any news on this?

Was anybody successful on installing HAA on a device running tasmota using OTA?

Was anybody successful on installing HAA on a device running tasmota using OTA?

@peros550,
Last image released by @kueblc was missing some variables and didn’t boot past LCM.
Since then a new OTA Boot image was released by RavenSystem. Hope will have this new one, when @kueblc returns back on track.

So I also managed to "brick" a Gosund SP111 with the image @kueblc provided. The device boots with the LCM-* AP, I can set the OTA repo and Wifi credentials, but upon clicking Join, nothing happens. No reboot, no activity, nothing in the netcat log.
I've successfully flashed a Teckin SP22 with TuyaConvert and a self-assembled image containing the three bin files. This same working file was not accepted by Tasmota OTA (claiming that it is too large for the flash after I appended the magic string). Although the file from @kueblc was larger than the one I cobbled together.

Is there an image to get off of Tasmota that won't brick?

My sonoff R1 was running Tasmota and I was able to successfully flash HAA using the serial connection. (First erase flash then flashing the 3 files).

My sonoff R1 was running Tasmota and I was able to successfully flash HAA using the serial connection. (First erase flash then flashing the 3 files).

Serial is old school! This thread is about migration using wireless OTA. No luck so far(

hi guys, i own a sonoff mini with tasmota and would like to switch to haa. is it possible via tuya converter?
regards

Once you flash the device and connect to the WIFI that it creates, you enter in the IP to be able to configure your wifi settings, correct?

  1. Is this where I can set a PIN for HomeKit?
  2. If you ever need to change your home's wifi...does the device go back into pairing mode the same method used originally? For a smart bulb it is usually a series of turning the power on and off.

@tonysprenk @i3laze et al

I've rebuilt an OTA upgrade image using the latest release from @RavenSystem using the process documented here. I've also appended the magic sequence as described here so you should be able to upload this to a device running Tasmota. YMMV.

Tested on a dev board, it seems to work fine, though the initialization took a while, ~10 minutes, and restarted multiple times. I haven't tested any function beyond setup as I do not have homekit.

Try at your own risk,
homekit-from-tasmota.zip

Greatly appreciated! :-)

Will give it a try later today.

I get "Upload Failed" with the reason "Program flash size is larger than real flash size" while trying to flash this to a Tasmota 8.1.0.2 device, which is where I failed last time when I tried the steps @kueblc linked myself.

i think kueblc forgot ā€žto change flash settings back from the development boardā€œ
same bevor ...

maybe :)

I’ve just upgraded Tasmota 6.6.0 pretty easy (few manual reboots might be needed).
However I need a valid JSON to go beyond HAA Setup webpage, so I can’t confirm I saved a config (previous issue) and reached the final working state yet.

@Crazor @Rocket200

Here is a copy with adjusted flash settings

homekit-from-tasmota.zip

@kueblc Thank you, that worked! Now I have to re-read how to set those beasts up...

@Crazor @Rocket200

Here is a copy with adjusted flash settings

homekit-from-tasmota.zip

I confirm the latest one worked flawlessly, without power resets (while you're on steady 5V :)
Tasmota: .bin upload -> 10 sec -> HAA Setup mode WiFi SSID is online!

Although then after initial JSON and WiFi configuration HAA-Installer flashes both HAA-OTA to 2.2.3 and HAA 1.9.2 itself for 5-10 minutes. Don't you worry guys - it then boot eventually.

I humbly ask @WizBangCrash to add this Tasmota (and Sonoff DIY) migration path/binary into Wiki.

Does that mean we could potentially use the Sonoff DIY mode to flash Tasmota and then once Tasmota is installed flash Ravencore OTA?

I’m not familiar with Sonoff DIY mode introduced in R3 generation, but looks like now you can flash a vanilla Sonoff device to Tasmota, then to HAA wirelessly, all without a serial cable :)

You might even try skipping the Tasmota part by flashing homekit.bin by kueblc directly to vanilla Sonoff DIY (although be ready for a USB-serial recovery). Please report your success.

I’m not familiar with Sonoff DIY mode introduced in R3 generation, but looks like now you can flash a vanilla Sonoff device to Tasmota, then to HAA wirelessly, all without a serial cable :)

You might even try skipping the Tasmota part by flashing homekit.bin by kueblc directly to vanilla Sonoff DIY (although be ready for a USB-serial recovery). Please report your success.

I'm tempted to give this a try. What is special about the HomeKit.bin by kueblc?

@allenmehrer,

rebuilt OTA upgrade image using the latest release from @RavenSystem using the process documented here. I've also appended the magic sequence as described here so _you should be able to upload this to a device running Tasmota_.

@allenmehrer,

rebuilt OTA upgrade image using the latest release from @RavenSystem using the process documented here. I've also appended the magic sequence as described here so _you should be able to upload this to a device running Tasmota_.

Well bummmer. I flashed the custom bin with the sonoff ota firmware tool and the sonoff mini went dark. No lights. No connection. No custom WiFi ssid to log into.

@allenmehrer,

rebuilt OTA upgrade image using the latest release from @RavenSystem using the process documented here. I've also appended the magic sequence as described here so _you should be able to upload this to a device running Tasmota_.

Well bummmer. I flashed the custom bin with the sonoff ota firmware tool and the sonoff mini went dark. No lights. No connection. No custom WiFi ssid to log into.

Bad luck, sorry.
Tool? There was also a WebGUI option for that :)
Please post a serial output, what’s going on during boot.

Here is my issue with sonoff mini.

  • flashed Tasmota v8.2.0 lite.
  • upgraded to latest bin from @kueblc
  • had to restart mini a lot of (>10) times before installer would load. HAA-xxxx WiFi AP would be visible, but installer page would fail to load.
  • finally after loading setup page and configuring wifi mini connected to my WiFi, but I can't add it to HomeKit or bring it back to setup mode.

I can ping it on my wifi, but can't add it to HomeKit, load webpage, or bring it to (emergency) setup mode.

// I'm waiting for new usb ttl

Something definitely not good with all those Minis.
My Shelly.Cloud 1 and 2.5 were flashed OTA from Tasmota 6 just fine.

Have you guys ever flashed a mini manually to HAA via serial cable?
It might not be the issue with the OTA, but generally unstable behavior.

Please, hook up a serial cable and give us some serial output to think about.

Sorry I didn't get serial output. I got frustrated trying to solder serial cable to mini, so as soon as I got everything soldered I just flashed it again and everything is working like it should. I'll try to 3D print mount for mini so I can easily hook it up and redo OTA flow again.

I think that homekit-from-tasmota.zip file must be updated with last haaboot.bin.

I’m not familiar with Sonoff DIY mode introduced in R3 generation, but looks like now you can flash a vanilla Sonoff device to Tasmota, then to HAA wirelessly, all without a serial cable :)

Tried direct vanilla sonof mini in DIY over OTA by following https://blog.bilka.sk/how-to-flash-sonoff-mini-in-mac-os/ (but directly with homekit-from-tasmota.bin). But no luck (box remind dark, no SSID visible, no console logs), so had to solder tiny UART, luckily "normal" HAA flash worked.

@kueblc Could you please refresh the image with latest haaboot.bin one last time?

Thanks @kueblc for this. I think the flashing part worked for me using your bin, but I might have stupidly messed something up.

I have a Feit smart plug that I initially flashed with Tasmota. I then decided I wanted HomeKit instead so I came here.

Everything worked great for me and I got to the HAA setup screen. I got too excited and entered in the WiFi settings and clicked save without entering anything for the JSON. The device rebooted and connected to my router but obviously I can't do anything with it because nothing is configured. Is there any way I can force it to go back into setup mode or am I out of luck? I tried using the emergency setup mode described here but it just immediately connects to my WiFi.

@i3laze would it be possible for you to see if emergency setup mode works for you? I really hope there is a way to salvage this without having to open it up.

ā€œDon’t panicā€ was written on some book cover ;)

@amikapoor Check the Wiki about setup mode:
https://github.com/RavenSystem/esp-homekit-devices/wiki/Setup-Mode#entering-setup-mode

@i3laze thanks for the quick response!

That's actually the exact link I posted in my comment and the first thing I tried. I can't get back in setup mode with the buttons (since I didn't configure the json) or using the emergency setup mode.

My current state is:

  • HAA flashed
  • I configured WiFi and nothing for the json
  • Clicked save
  • It rebooted and connected to my WiFi
  • Now I can't control the outlet or put it back in setup mode using buttons or emergency setup

I just wanted to see if emergency setup mode works for anyone else

So, there are few options:
A. You’ve really completed setup and now you can discover the HAA device in Home.app and pair with it. After this it might get emergency working fine.
B. You didn’t complete setup (as empty json isn’t valid choice) and you should reset power and search for HAA WiFi again.

Most probable:
C. You’ve completed initial setup and now you should calmly wait aprox. 10 min (as I mentioned few times above) for device to download and flash both latest OTA and HAA binaries. Then only it shows up as available for pairing in Home.app and emergency will work.
I suggest you reset power and sit tight for a while.

A. It's been plugged in for about 20 min since I last unplugged it and I just tried to add the accessory and it was not found
B. The only reason that I think the setup actually got completed is because it is connected to my router. Also, when I hit save once with the empty json nothing happened. Then I clicked save again and my device disconnected from the HAA network and it did not appear again and I noticed it had connected to my wifi.
C. After the behavior described in B, I waited over an hour before touching it again. After that initial hour is when I've been trying to get it back into setup mode after realizing my potential mistake of saving without a configuration. In the last couple hours I have tried multiple resets and let it stay on for 10-20 min each time but it just goes right back on my wifi with no ability to do anything else

Just figured I’d also mention that I did not select auto update when I was setting it up the first time

@amikapoor in the list of connected devices in your router settings is the device identified as HAA-XXXXXX or as unknown?

If it’s the first one: try emergency setup mode.

If the second one: probably something went wrong during flashing and the device will have to be reflashed by wire.

@amikapoor, with empty JSON device should boot to setup mode... after OTA downloads all the binaries.
Try http://DeviceIP once again.

The next step is serial cable, sorry. This .bin had a disclaimer YMMV :/
You’re welcome to post current serial output before reflashing your smart plug.

Thanks for the replies guys. I really appreciate your help.

The device name shows up as tasmota. I noticed this from the start but I just figured it was my router just caching the name or something. Using a separate network scanner, I can confirm it says tasmota for sure.

When this all went downhill one of the first things I tried was going back to the tasmota configuration page and it didn’t work and it still isn’t. Sounds like something went wrong with the flashing right? I’m just confused how the HAA installer booted up and now it’s back to saying tasmota. I also wonder if this was caused by the empty json or something else.

I’ve managed to get the device open end it looks like it’s an ESP8285 so I guess my next step will be to order the device I need to flash it, unless I can find some way to reset tasmota.

Weapon of choice, PL2303 adapter:
http://s.aliexpress.com/ji6VjEZ3

Check some local online stores for it.
Extra Male<>Male cable might be needed, as most serial inputs are Female (holes)..

I just realized, I may have a USB to RS-232 cable laying around somewhere from a previous project. Do you have any idea if I could cut that up and use that somehow?

Although lots of USB-Serial adapters such as yours are built on PL2303 chip, I couldn’t Google a retrofit scheme.
It’s a 3$ adapter, used regularly. Just find it nearby and get it delivered)

So I did next test with new sonoff mini.
1) flash from vanilla mini via [OTA] to tasmota (https://blog.bilka.sk/how-to-flash-sonoff-mini-in-mac-os/) OK
2) flash from tasmota to homekit-from-tasmota.bin (md5 c5f3bea97c7630871ad1e826baed7c38) OK, HAA wifi available
3) on HAA wifi setting my wifi/ssid+pass (no json), saving - OK
4) mini got IP, correctly - can ping it,

  • but unable start setup mode (pressing buttons, diy pin,)
  • nc -kulnw0 45678 shows
Get version RavenSystem/haa_ota
NEW CONNECTION LocalPort=e372 DNS IP: 140.82.118.4 local..OK remote..OK SSL..OK set_fd to github.com port 443..OK

GET /RavenSystem/haa_ota/releases/latest HTTP/1.1
Host: github.com


OK

GET /RavenSystem/haa_ota/releases/latest HTTP/1.1
Host: github.com


HTTP returns 302 for Current ROM is 0
Compare
3.0.2 with 2.2.2 = 1
RavenSystem/haa_ota@version:"3.0.2"
Current ROM is 0
Running BOOT
Get hash
DOWNLOADING
GET /RavenSystem/haa_ota/releases/download/3.0.2/main.bin.sig HTTP/1.1
Host: github.com

NEW CONNECTION LocalPort=e373 DNS IP: 140.82.118.4 local..OK remote..OK SSL..OK set_fd to github.com port 443..OK
sent OK
HTTP returns 404
Get file
DOWNLOADING
GET /RavenSystem/haa_ota/releases/download/3.0.2/main.bin HTTP/1.1
Host: github.com

NEW CONNECTION LocalPort=e374 DNS IP: 140.82.118.4 local..OK remote..OK SSL..OK set_fd to github.com port 443..OK
sent OK
HTTP returns 404

But when checking the HAA OTA releases page, resource names should be IMHO rather haaboot.bin and NOT main.bin
https://github.com/RavenSystem/haa_ota/releases/download/3.0.2/haaboot.bin
So seems will have to solder again.

@hau21um, great job with troubleshooting. Looks like HAA installer cannot proceed as the .bin is hardcoded wrong.

@kueblc, @RavenSystem how so? what’s next?

Is this likely the same reason it failed for me?

I added a transition firmware to allow old haaboot to work. Try again.

Tried just now, but it fails on two bellow files
/RavenSystem/haa_ota/releases/download/3.0.2/main.bin.sig
/RavenSystem/haa_ota/releases/download/3.0.2/main.bin
I see otamain.bin+otamain.bin.sig, so maybe renaming those or adding that two also..?

Ups, sorry. Renamed.

This is awesome. Good job @RavenSystem, thank you. Now I'm on setup page with HAA 2.1.2/OTA 3.0.2. You saved me from this tiny soldering exercise!!!

@hau21um when you said ā€œmini got IP, correctly - can ping itā€œ, did the device still show up as a tasmota in your router? I’m just trying to figure out if we have the same problem or not

This is awesome. Good job @RavenSystem, thank you. Now I'm on setup page with HAA 2.1.2/OTA 3.0.2. You saved me from this tiny soldering exercise!!!

Well this is exciting. Care to break down how you did it? I’ve got a six pack of minis in my cart I’d be happy to buy if I can flash them OTA instead of soldering.

@hau21um when you said ā€œmini got IP, correctly - can ping itā€œ, did the device still show up as a tasmota in your router? I’m just trying to figure out if we have the same problem or not

Well, this I was not checking and also not so long log on my router. I knew my router leas IPs for some time for given MAC, so checked the IP on the router just on the beginning even before any flashing happen.

@allenmehrer Check my earlier post. Just now, after last RavenSystem's action the step 4 also finish correctly.

I have some good news from my side also.

I noticed when I plugged in my device, the HAA SSID would show up for like a second before the device would automatically connect to my network automatically. I decided to turn off my router so it wouldn’t be able to connect hoping somehow that would allow me to get into setup mode and it worked!

From here I reset the WiFi configuration and clicked save. It then disconnected me. When I reconnected I put in the JSON, put in the WiFi settings, selected update now, hit save, and now everything works.

I’m not sure if this is all working now because of Raven’s latest change or if I could’ve just done this from the start. Wish I never pried this thing open šŸ˜‚

Thanks for all your help everyone

Developer fixed the issue server-side.

Looks like Tasmota.bin was built with haa_ota v2.2.2, which still used main.bin naming.
Newest 3.0+ uses haaboot.bin naming, and main.bin was missing for 3.0+ until yesterday:
https://github.com/RavenSystem/haa_ota/releases

@RavenSystem will you now duplicate .bin with both names for ages or any workaround can be done here? Was this affecting any device running HAA OTA<3.0 or just custom build from this thread?

Until a new version of a single binary is released, I will keep the workaround to let old version running.

If anyone want to test this, please, give feedback. If it works, I will upload it to releases and I will support it for future versions.

fullhaaboot.bin.zip

If anyone want to test this, please, give feedback. If it works, I will upload it to releases and I will support it for future versions.

fullhaaboot.bin.zip

Raven, I tested this by logging into the web interface for my Tuya RGBW bulb running tasmota. When I uploaded the zip file I received the following error:

Upload Failed.
Magic Byte is not 0xE9.

If anyone want to test this, please, give feedback. If it works, I will upload it to releases and I will support it for future versions.

fullhaaboot.bin.zip

Works like charm for me! Tested on tasmota 8.2.0.6

If anyone want to test this, please, give feedback. If it works, I will upload it to releases and I will support it for future versions.
fullhaaboot.bin.zip

Works like charm for me! Tested on tasmota 8.2.0.6

Did you upload the zip file directly or the bin file within?

If anyone want to test this, please, give feedback. If it works, I will upload it to releases and I will support it for future versions.
fullhaaboot.bin.zip

Works like charm for me! Tested on tasmota 8.2.0.6

what HAA Version is here included ?
i think i flash my 4 x Gosund with a old HAA Version back to Tuya and than with tuya-convert to Tasmota and than this new File from Ravensystem.

It’s the latest but why not flash HAA straight with tuya convert? And if your going to solder wires anyway why not just flash the latest HAA straight away without tuya convert?

yes i can flash the HAA with wires directly, i forget.

HAA now included in tuya-convert?

i need to flash it again with wires or i can go easy OTA way?

i stuck on HAA 1.4 / 1.7 and can not update (github problem)

Just flash HAA straight by wire it’s the only way.

Just flash HAA straight by wire it’s the only way.

Didn't worked for you the fullhaaboot.bin.zip?

The device is running stock sonoff firmware, not tasmota.

I added Tasmota compatible binary to release files. I will support it.

https://github.com/RavenSystem/esp-homekit-devices/wiki/Installation

Was this page helpful?
0 / 5 - 0 ratings

Related issues

maciekfreak picture maciekfreak  Ā·  4Comments

noobydp picture noobydp  Ā·  5Comments

xrust83 picture xrust83  Ā·  3Comments

hmbarbosa picture hmbarbosa  Ā·  4Comments

freddair picture freddair  Ā·  3Comments