AK5nowman/WyzeSense

How to use WyzeSenseUpgrade

Closed this issue · 11 comments

I'm having trouble (in Windows) figuring out the right "device path" to pass to the Program.cs script in order to flash my spare V1 bridge 🤔 Could you offer some guidance?

I haven't messed with it at all on windows so I'm not currently sure. I run ubuntu in a VM (oracle box)

Fair enough.

I'm failing to compile WyzeSenseUpgrade/Program.cs in Debian however, using Mono's mcs command. I get the following error:

Program.cs(141,33): error CS1001: Unexpected symbol `,', expecting identifier
Program.cs(141,39): error CS1001: Unexpected symbol `)', expecting identifier
Compilation failed: 2 error(s), 0 warnings

From this line:

(bool, uint) chipCrc32;

Wow somehow missed this. One day I’ll get better at the internet…

You will need to compile this with .Net 5, and not mono. What I do is compile it on my Windows desktop, targeting Linux, and just copy the file over.

Would this be the firmware file to flash?

HclX/WyzeHacks#111 (comment)

I did flash that firmware, and was able to get WyzeSenseApp running as well. It appears to be connected to my dongle, but I'm getting a lot of:

[Warning    ](5/20/2021 3:03:18 PM) - [Dongle][WriteCommandAsync] Command Timed out - did not receive response in alloted time

I always get this after typing in scanon, as well as pretty much any other command, so I'm not sure what I'm doing wrong, but I can't get a sensor to pair to it either.

What linked was a dump of the flash from the v2 hub itself. I can’t remember if the firmware for the cc1310 was in one of the squash files. I can’t add it to the repo when I get home this evening.

The first thing it does it query the dongle for a few pieces of system information. If you are getting the command time out then the dongle is not responding. If you used the wrong file when you flashed it, and it actually let you flash that could be why.

I'd appreciate a good firmware to flash 😁 I don't really have the means to pull it from my own Hub, but am quite interested in seeing what happens with the keypad, at the very least 👍

@drinfernoo I've committed what I used to flash my v1 hub

Alright, went ahead and tried to flash using that firmware, and it seemed to be working (lasted way longer than the other one 😅), but then threw this error:

*********************
***Reseting Device***
*********************
[sendCmd] Write Raw: 03 25 25
Requesting CRC32
[sendCmd] Write Raw: 0F 29 27 00 00 00 00 00 02 00 00 00 00 00 00
[getCRC32] Getting Resp
[getCmdResponse] Attempting to read 3 bytes
[getCmdResponse] Read raw data: 02 00 CC
[getCRC32] Getting Resp Data
[getCmdResponseData] Read raw data:  (0/0)
Unhandled exception. System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at WyzeSenseUpgrade.Program.getCmdResponseData(Int32 DataLength) in /storage/WyzeSense/WyzeSenseUpgrade/Program.cs:line 437
   at WyzeSenseUpgrade.Program.getCRC32(UInt32 Address, UInt32 Length) in /storage/WyzeSense/WyzeSenseUpgrade/Program.cs:line 529
   at WyzeSenseUpgrade.Program.Main(String[] args) in /storage/WyzeSense/WyzeSenseUpgrade/Program.cs:line 173
   at WyzeSenseUpgrade.Program.<Main>(String[] args)

Now I'm not seeming to be able to try again, and get stuck with:

root@ERROL:/storage/WyzeSense/WyzeSenseUpgrade/bin/Debug/net5.0# ./WyzeSenseUpgrade /dev/hidraw0
Requesting Upgrade Mode
Read raw data: 07 55 AA 43 03 13 01 58 31 0D 0A 55 AA 53 03 32
Read data: 55 AA 43 03 13 01 58
Requesting Auto Baud
[getCmdResponse] Attempting to read 3 bytes
[getCmdResponse] Read raw data: 11 53 54
auto baud resp = (False, False)
Requesting Ping
[getCmdResponse] Attempting to read 3 bytes

Fantastic. Looks like it is because I'm executing a command after I asked to reset the device.

Looks like the upgrade was successful though - did you try running the sense app?

Actually, it does seem to work! I had thought the error I had sent previously meant something had gone wrong 😅 I can now pair sensors to it and get events back. Now, I'd like to figure out how to get this bridge working with WyzeSense2MQTT... so I'll take it back over there.