Replies: 17 comments 1 reply
-
Definitely!
Yeah, it's a different chip, but shouldn't really be all that different compared to zbminir2 - project configuration wise. The only thing tying it to EFR32MG21 is the pin configuration and one reference to the EFR32MG21A020F768IM32 component to pull in chip specifics. Hardware wise it's fairly similar: it has a led and two button inputs - it just needs slightly different handlers for the buttons. I can see only two gotchas:
In any case, you've nerd sniped me into buying a SNZB-01P to see whether we can get that supported ;) Disclaimer: might take some time, I'm a bit busy and I'd like to get zbminir2 finished up too..
So it doesn't support bindings out of the box? What do the short/long/double press actions look like over the air? (Thanks for adding detailed photos, that's really helpful) |
Beta Was this translation helpful? Give feedback.
-
Mission accomplished 😎
OTA is much less important on this device. In a case with zbminir2 firmware updates (without OTA) require extraction of mini from the wall box, which can be a lot of work. The remote button is a totally different case. For those lucky who have PCBite reflashing even doesn't require disassembly. And for others it should be possible to leave short thin wires in battery compartment for later use. Therefore my suggestion: OTA is a low priority.
Yes, what a pity. Some reviewers mentioned that the previous version ("01" without "P") did support binding but not the new one.
Let me do some sniffing and I'll write back.
I'm willing to experiment with the device. How high are chances to totally brick the device if using wrong configuration (for example flashing into wrong memory address etc.)? I've noted that the zbminir2 firmware consists of two parts: bootloader and the main program. Can the device be flashed again even if previously flashed with bad bootloader? |
Beta Was this translation helpful? Give feedback.
-
It sends commands from cluster OnOff to coordinator:
Example for single click:
I can bind the button to other device in Z2M and a message confirming successful binding is shown. But nothing is sent to that device - the same behaviour as with default zbminir2 firmware. |
Beta Was this translation helpful? Give feedback.
-
Got it working! 🥳 Pins
Progress
I'll upload my fork later and can make a PR if you like. |
Beta Was this translation helpful? Give feedback.
-
Uploaded my fork: https://github.com/bobo-cher/zbminir2/tree/snzb01p |
Beta Was this translation helpful? Give feedback.
-
Nice progress! Will update once I have some time to try it out myself.. For power management, be careful entering EM4 as I saw a report (n=1) of someone being unable to enter debug due to the debug subsystem being disabled in EM4. On other devices where I run into similar problems, I make sure to enter deep sleep only after a short timeout to avoid that.. |
Beta Was this translation helpful? Give feedback.
-
Update
User Guide
The small side button has therefore two modes:
Reset (disconnect from network):
After reset the device is in not joined state and can be joined again via small side button. TODO
|
Beta Was this translation helpful? Give feedback.
-
Update
User Guide (updated)
TODO
|
Beta Was this translation helpful? Give feedback.
-
Update
User Guide (updated)
TODO
|
Beta Was this translation helpful? Give feedback.
-
Update
User Guide (updated)The user guide has become too large to post it here in the discussion. It now has its own wiki-page: SNZB-01P+ User Guide. TODO
|
Beta Was this translation helpful? Give feedback.
-
Update
Power consumption measurements (somewhat confusing)I've flashed two units and got somewhat confusing results regarding power consumptions:
I cannot explain the difference in 10μA on both units. That's quite a lot of difference comparing absolute numbers. Of course I cannot trust the absolute numbers on my (20 years) old cheap multimeter. But the measurements are totally reproducible and consistent. Both units work correctly. They were erased and flashed multiple times. The 14μA of second unit is equal to what I measured with original firmware on that unit before flashing. Unfortunately I haven't measured the first unit running original firmware to compare with. Could this difference in energy consumption be caused by some faulty component (like capacitor etc.)? According to documentation on MG22 the 3μA is what you could expect in EM2 power mode (normal deep sleep). Where the additional 10μA comes from? I'll receive a third unit soon and will do measurements before and after flashing. |
Beta Was this translation helpful? Give feedback.
-
Update
|
Beta Was this translation helpful? Give feedback.
-
Update
There are two issues though:
|
Beta Was this translation helpful? Give feedback.
-
Update
|
Beta Was this translation helpful? Give feedback.
-
Please let me know how would you prefer to handle the firmware for SNZB-01P. I could create a pull request to merge it into your repository or we could keep it separate. In the latter case I would create a new repository (under my account) with an appropriate name and only with button stuff (no zbminir2 parts). Thanks. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the extensive updates! I followed along, even though I didn't get around to responding - great to see you basically got everything working. Unfortunately I haven't gotten around to testing your work - nor finishing up the missing zbminir2 features, for that matter. As for merging, functionality wise that totally makes sense. I'm not sure how to handle (if at all) the branding/marketing problem caused by naming this repository 'zbminir2' - thoughts? Looks like you've only touched the build script - so whereas I do feel bad about not having finished up missing zbminir2 features yet (soon™) - I don't think that has to be a blocker as long as we're not merging the C implementation. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the feedback. I'll be glad to merge my work into your repository. Let me know when you have more free time for this. Although I've finished the first version, I'm still finding small things to fix now and then. Doing a real life test with two buttons for the last couple of days helped. I have some thoughts for the second version like better control of dimmable lights. I might want to wait for the feedback from users first (if there will be any, ha-ha). GitHub repositories can be renamed and everything should continue to work - see Renaming a repository. The only difficult part here is to come up with a good new name 😉. To make the adoption easier I would offer releases with compiled firmwares. There is a precompiled version of patched OpenOCD for Windows, which we could point users to. The flashing of firmware for Windows users should be pretty easy then (with an extra guide of course). |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Can we use the same approach to bring direct binding to Sonoff SNZB 01P Button?
Test points TMS and TCK are connected to SWDIO and SWDCLK pins of the MCU. I tested with J-Link:
Looks promising, right?
This is a different chip, EFR32MG22, and it probably requires a different configuration of the project and J-Link config.
I haven't tried to erase the flash yet as I wanted to get your opinion first, before doing things, which may destroy the device ;)
It would be great to be able to use these buttons to control zbminir2. I have four different kinds of buttons and all of them have significant delay/latency when controlling lights via HA automations. One button supports binding to groups but it doesn't improve latency (and the button itself feels cheep and isn't that nice).
I hope with a custom firmware on Sonoff button we can get a fast working remote for lights, which is also independent from coordinator and HA.
Beta Was this translation helpful? Give feedback.
All reactions