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

Zigbee Koenkk firmware 20240710 for Sonoff Zigbee ZBPro #22076

Merged
merged 1 commit into from
Sep 2, 2024

Conversation

s-hadinger
Copy link
Collaborator

Description:

Zigbee, latest firmware for CC2652P customized for the Sonoff ZBPro - especially the BSL pin is changed because it is non-standard compared to Launchpad CC2652P.

Berry code patched to accept this firmware.

It is untested yet, I can't find my device right now. Any feedback to confirm it's working is welcome.

Checklist:

  • The pull request is done against the latest development branch
  • Only relevant files were touched
  • Only one feature/fix was added per PR and the code change compiles without warnings
  • The code change is tested and works with Tasmota core ESP8266 V.2.7.7
  • The code change is tested and works with Tasmota core ESP32 V.3.0.4
  • I accept the CLA.

NOTE: The code change must pass CI tests. Your PR cannot be merged unless tests pass

@s-hadinger s-hadinger merged commit b6e81c1 into arendst:development Sep 2, 2024
1 check passed
@Joylancer
Copy link

Hab es mal ausprobiert.
Berry Updates (.be) und neue FW geladen.
es kommt folgende Fehlermeldung:

Welcome to the Berry Scripting console. Check the documentation.
import sonoff_zb_pro_flasher as cc
cc.load("SonoffZBPro_coord_20240710.hex")
cc.check()
FLH: Starting verification of HEX file
BRY: Exception> 'value_error' - size of payload is not a mutliple of 4: 0x02BAD8
stack traceback:
: in function parse
: in function check
: in function main

@Joylancer
Copy link

kleiner Fehler meinerseits, nach Update der xxx.be hatte ein reboot gefehlt, momentan flasht das Gerät gerade, gebe Feedback.

@Joylancer
Copy link

19:58:20.338 FLH: Starting verification of HEX file
19:58:39.820 FLH: Verification of HEX file OK
19:58:47.875 MQT: tele/TCPZBBridgePro/STATE = {"Time":"2024-09-05T19:58:47","Uptime":"0T00:01:04","UptimeSec":64,"Heap":148,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"MqttCount":1,"Berry":{"HeapUsed":9,"Objects":155},"Wifi":{"AP":1,"SSId":"kein_Internet_","BSSId":"B0:F2:08:A8:F3:D5","Channel":1,"Mode":"HT40","RSSI":100,"Signal":-33,"LinkCount":1,"Downtime":"0T00:00:08"}}
19:58:47.880 MQT: tele/TCPZBBridgePro/SENSOR = {"Time":"2024-09-05T19:58:47","ESP32":{"Temperature":33.9},"TempUnit":"C"}
19:58:56.703 FLH: cc2652_flasher rx=23 tx=19 rst=15 bsl=22
19:58:56.729 FLH: Flashing started (takes 5-8 minutes during which Tasmota is unresponsive)
20:06:42.176 BRY: Exception> 'value_error' - len must be a multiple of 4
20:06:42.177 stack traceback:
20:06:42.178 : in function flash
20:06:42.179 : in function main

@s-hadinger
Copy link
Collaborator Author

Can you please confirm that the new Zigbee firmware works fine? I couldn't test on my side

@Joylancer

@Joylancer
Copy link

Joylancer commented Sep 5, 2024

@s-hadinger
i can´t test, flash fails with error, or can i ignore this message
after this message i re-flashed the 20220219 firmware, not testing

19:58:56.729 FLH: Flashing started (takes 5-8 minutes during which Tasmota is unresponsive)
20:06:42.176 BRY: Exception> 'value_error' - len must be a multiple of 4
20:06:42.177 stack traceback:
20:06:42.178 : in function flash
20:06:42.179 : in function main

@sfromis
Copy link
Contributor

sfromis commented Sep 5, 2024

Looks like line 11186 of SonoffZBPro_coord_20240710.hex is not for a multiple of 4 bytes.

:0DBAD8000CFF0400014503011E483033003F

@FoX2V
Copy link

FoX2V commented Sep 9, 2024

@s-hadinger i can´t test, flash fails with error, or can i ignore this message after this message i re-flashed the 20220219 firmware, not testing

19:58:56.729 FLH: Flashing started (takes 5-8 minutes during which Tasmota is unresponsive) 20:06:42.176 BRY: Exception> 'value_error' - len must be a multiple of 4 20:06:42.177 stack traceback: 20:06:42.178 : in function flash 20:06:42.179 : in function main

have same error.

@thogitnet
Copy link

For a workaround you can remove all lines with if (len % 4 != 0) raise "value_error", "len must be a multiple of 4" end oe apply the follow patch.

for me it worked fine. note that there is no message and it can take a good 8 minutes until something visible happens again...

patch cc2652_flasher.be < cc2652_flasher.be_patch

File: cc2652_flasher.be_patch

--- cc2652_flasher.be	2024-09-06 09:51:40.939854966 +0200
+++ patch/cc2652_flasher.be	2024-09-06 12:12:40.614491705 +0200
@@ -248,7 +248,6 @@
   end
 
   def cmd_memory_read(addr, len)
-    if (len % 4 != 0) raise "value_error", "len must be a multiple of 4" end
     if len > 128      raise "value_error", "len is bigger than 128" end
     var b = bytes("2A")
     b.add(addr, -4)
@@ -273,7 +272,6 @@
   # end
 
   def cmd_download(addr, sz)
-    if (sz % 4 != 0) raise "value_error", "len must be a multiple of 4" end
     if sz > 128      raise "value_error", "len is bigger than 128" end
     var b = bytes("21")
     b.add(addr, -4)
@@ -285,7 +283,6 @@
 
   def cmd_send_data(data)
     var sz = size(data)
-    if (sz % 4 != 0) raise "value_error", "len must be a multiple of 4" end
     if sz > 128      raise "value_error", "len is bigger than 128" end
     var b = bytes("24")
     b += data
@@ -336,7 +333,6 @@
   # higher level
   def flash_write(addr, data)
     var sz = size(data)
-    if (sz % 4 != 0) raise "value_error", "len must be a multiple of 4" end
     if sz > 128      raise "value_error", "len is bigger than 128" end
 
     var ret

@s-hadinger
Copy link
Collaborator Author

Thanks I will do the patch accordingly

@s-hadinger
Copy link
Collaborator Author

It is fixed now

hawa-lc4 pushed a commit to hawa-lc4/Tasmota-dev that referenced this pull request Sep 16, 2024
@timurlan75
Copy link

No work.
FLH: Starting verification of HEX file
BRY: Exception> 'index_error' - string index out of range
stack traceback:

: in function parse

: in function 'check`

: in function main

@s-hadinger
Copy link
Collaborator Author

This pr is closed. Please open a new discussion with details about what you tried

@timurlan75
Copy link

I'm a regular user. I wanted to update. I replaced all the files. Unfortunately, it doesn't work.

@s-hadinger
Copy link
Collaborator Author

I already told you to open a new thread with the details. You have provided no details.

@timurlan75
Copy link

#22257

@mox1
Copy link

mox1 commented Oct 18, 2024

I can confirm that so far this firmware works. I have not rigorously checked my ~10 or so Zigbee devices, but Zigbee2mqtt is looking normal after flashing.

There is a lot of steps , tips, tricks that I have pieced together in order to get this to work, in no particular order:

  1. The filesystem does not have enough space to have two coordinator files. In the tasmota file manager, I click the "edit"
    button on the old firmware and just delete all the data (creating a 0 byte file). I have not found an easy way to delete a file.
  2. You need to Tasmota AutoConf back to the NON TCP version. This version is required for the flasher (pins are setup differently.)
  3. You WILL need to edit the file as above. I had to edit two files. Basically remove ALL code that tries to check if its a multiple of 4.
  4. I never actually got a confirmation on the Berry scripting console. I let it site for ~20 minutes (0 errors), Then I went to the regular Tasmota console and saw a "FLASH OK" type message (not exact wording).
  5. From there I needed to reboot Tasmota and let it come up in NON TCP mode. Check the console and you will see messages about "Coordinator configured" (Again not exact message).
  6. Once it comes up correctly in non TCP mode, you can then use AutoConf to go to TCP mode and then Zigbee2mqtt will start working.

SonoffZBPro_coord_20240710.hex

import sonoff_zb_pro_flasher as cc
cc.load("SonoffZBPro_coord_20240710.hex")
cc.check() 
#This will take 1-3 minutes and report back what happened.
cc.load()
#this might take 8-15 minutes and will *NOT* report status back, check Tasmota Console

@sfromis
Copy link
Contributor

sfromis commented Oct 18, 2024

The easy way to delete a file is to click on the 🔥 icon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants