Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feat] Support .hec firmware format from Aeotec devices #37

Closed
larstobi opened this issue Nov 30, 2020 · 21 comments · Fixed by zwave-js/node-zwave-js#1194 or zwave-js/node-zwave-js#2470
Assignees
Labels
wontfix This will not be worked on

Comments

@larstobi
Copy link
Contributor

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
When I try to update Aeotec Smart Switch 6 ZW096 with firmware downloaded from Aeotec n .hec format, I get the error message:

Error while calling api beginFirmwareUpdate: Unable to extract firmware from file: could not detect firmware format

Describe the solution you'd like
Correctly detecting the format and converting it to a usable format, and begin FW upgrade process.

Describe alternatives you've considered
None.

Additional context
EU firmware downloaded from link at the bottom of this page:
https://aeotec.freshdesk.com/support/solutions/articles/6000205150-update-smart-switch-6-firmware-via-homeseer-

@larstobi larstobi added the enhancement New feature or request label Nov 30, 2020
@robertsLando
Copy link
Member

@AlCalzone This is for you :) Also I suggest to move the guessFirmwareFormat function in zwave-js

@AlCalzone
Copy link
Member

*.hec files are firmware files that were encrypted with the Homeseer encryption utility. Both the utility and the code to decrypt that is closed source. I've seen threads where it has been speculated that they use a simple encryption with a fixed key, but no hard evidence.
So in short: nothing we can do until someone reverse-engineers the encryption.

You can however ask the Aeotec support for their updater utility (which we can extract the firmware from).

@AlCalzone AlCalzone added wontfix This will not be worked on and removed enhancement New feature or request labels Nov 30, 2020
@robertsLando
Copy link
Member

You can however ask the Aeotec support for their updater utility (which we can extract the firmware from).

Or ask them to give us the docs to do it 😄

@AlCalzone
Copy link
Member

Except Homeseer !== Aeotec. As far as I understand, they provide manufacturers with an encryption utility so they can upload encrypted firmware. Only the Homeseer software can decrypt these files.
From my experience, they'll give you the updater exe when you ask for it. In my case I wanted to update my WallMote but didn't find the files to do that.

@roflmao
Copy link

roflmao commented Nov 30, 2020

@robertsLando
Copy link
Member

I think that we can close this so?

@larstobi
Copy link
Contributor Author

larstobi commented Dec 4, 2020

@AlCalzone I asked Aeotec for the unencrypted firmware files, but they don't wish to give access to those files, because that will expose the source code, they say, and it's confidention to Aeotec.

I'm not sure how firmware upgrade is implemented on the devices, but I would think there at least should exist a public key in the devices that can verify a signature on the firmware code in order to verify it's publisher. In that case, exposing the code would not really be a problem, unless they are worried about competition looking at the disassembled machine code and picking up trade secrets. Which I guess is what they are most worried about.

From looking inside the .exe file in the source of for instance the Smart Switch 6 firmware updater tool, I found a string saying "ZW096_Smart_Switch_6_EU_V1_04_hex__TargetZwave__". Maybe that means we should be able to extract the firmware?

@AlCalzone
Copy link
Member

If you have an updater exe, you can probably just plop it into the zwave-js update method. It will try and extract the firmware for you.

@robertsLando
Copy link
Member

@AlCalzone What if he just rename the .hec to .exe?

@larstobi
Copy link
Contributor Author

larstobi commented Dec 4, 2020

@robertsLando Probably not, since it's encrypted, or at least obfuscated.

@AlCalzone so, you mean the format guesser will search through and look for the start of the Intel Hex file? I decompiled the .exe and found lots of references to Intel hex.

@AlCalzone
Copy link
Member

AlCalzone commented Dec 4, 2020

Yes, the format guesser will check if the exe file has two markers we expect and extractFirmware will then look for the firmware where it usually is in the file.
@robertsLando That won't work as the exe file needs to have a specific structure.

@larstobi
Copy link
Contributor Author

larstobi commented Dec 7, 2020

@robertsLando @AlCalzone
I tried to update the Aeotec Smart Dimmer 6 right now and just dropped the SmartDimmer_6_EU_C_V1_07.exe file directly to the "Begin firmware upgrade" function. It Just Worked. Wow. :-D

@larstobi
Copy link
Contributor Author

larstobi commented Dec 7, 2020

However, ZW096_Smart_Switch_6_EU_V1_04.exe does not work. I get "Error while calling api beginFirmwareUpdate: Unable to extract firmware from file: could not detect firmware format"

@AlCalzone
Copy link
Member

Could you send me that file please?

@larstobi
Copy link
Contributor Author

larstobi commented Dec 8, 2020

@larstobi
Copy link
Contributor Author

larstobi commented Dec 8, 2020

@AlCalzone you can easily get it from the above link, but if there are problems, I can send it to you on Slack. :-)

@larstobi
Copy link
Contributor Author

larstobi commented Dec 8, 2020

Link for other countries as well, in the bottom of this page https://aeotec.freshdesk.com/support/solutions/articles/6000235856-how-to-update-smart-switch-6-z-wave-firmware-

@AlCalzone
Copy link
Member

@larstobi the failing exe files should be handled by zwave-js/node-zwave-js#1194. Since that branch depends on the GBL one, I'll either have to merge them without waiting for your test or just wait for confirmation.

@AlCalzone
Copy link
Member

I've merged the branches, so the current zwave-js master should work.

@psarossy
Copy link

psarossy commented Apr 24, 2021

I'm trying to use this method do update my MultiSensor 6 US units, but nothing happens after I select the .exe file, the picker window disappears, and there's nothing in the log with that node, even with DEBUG level logging enabled..,
Any ideas?

@AlCalzone the encryption has been reverse engineered, but not sure if it's ok to post it here...

@AlCalzone
Copy link
Member

@psarossy you can contact me via the email in my profile if you have some info to share.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
5 participants