-
Notifications
You must be signed in to change notification settings - Fork 41
Use ZDO converter for Mgmt_NWK_Update_req
#102
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
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #102 +/- ##
=======================================
Coverage 98.84% 98.84%
=======================================
Files 44 44
Lines 3800 3801 +1
=======================================
+ Hits 3756 3757 +1
Misses 44 44
Continue to review full report at Codecov.
|
I'm fine with it. What happens when you send the request to ezsp coordinator? |
Zigpy ends up receiving it: 2021-11-23 14:51:00.765 ubuntu bellows.ezsp.protocol DEBUG Send command sendUnicast: (<EmberOutgoingMessageType.OUTGOING_DIRECT: 0>, 0x0000, EmberApsFrame(profileId=0, clusterId=56, sourceEndpoint=0, destinationEndpoint=0, options=<EmberApsOption.APS_OPTION_ENABLE_ROUTE_DISCOVERY|APS_OPTION_RETRY: 320>, groupId=0, sequence=7), 8, b'\x07\x00\xf8\xff\x07\x02\x01')
2021-11-23 14:51:00.768 ubuntu bellows.uart DEBUG Sending: b'607721a9602a15b259944a1daa5592099d4e27ace5c9608b0539648bfd15e77e'
2021-11-23 14:51:00.783 ubuntu bellows.uart DEBUG Data frame: b'0777a1a9602a1570d7577e'
2021-11-23 14:51:00.783 ubuntu bellows.uart DEBUG Sending: b'8160597e'
2021-11-23 14:51:00.784 ubuntu bellows.ezsp.protocol DEBUG Application frame 52 (sendUnicast) received: b'00c2'
2021-11-23 14:51:00.789 ubuntu bellows.uart DEBUG Data frame: b'1777b1a9112a15b259ac4a25aa1593499c8cd8abedce9874fac1637103793da69ff77e'
2021-11-23 14:51:00.789 ubuntu bellows.uart DEBUG Sending: b'82503a7e'
2021-11-23 14:51:00.790 ubuntu bellows.ezsp.protocol DEBUG Application frame 69 (incomingMessageHandler) received: b'0000003800000040010000c2ff000000ffff070700f8ff070201'
2021-11-23 14:51:00.790 ubuntu bellows.zigbee.application DEBUG Received incomingMessageHandler frame with [<EmberIncomingMessageType.INCOMING_UNICAST: 0>, EmberApsFrame(profileId=0, clusterId=56, sourceEndpoint=0, destinationEndpoint=0, options=<EmberApsOption.APS_OPTION_ENABLE_ROUTE_DISCOVERY|APS_OPTION_RETRY: 320>, groupId=0, sequence=194), 255, 0, 0x0000, 255, 255, b'\x07\x00\xf8\xff\x07\x02\x01']
2021-11-23 14:51:00.790 ubuntu bellows.uart DEBUG Data frame: b'2777b1a96b2a15b259944a1daa5592099d4e2769e5ce6728727e'
2021-11-23 14:51:00.791 ubuntu zigpy.zdo DEBUG [0x0000:zdo] ZDO request ZDOCmd.Mgmt_NWK_Update_req: [NwkUpdate(ScanChannels=<Channels.ALL_CHANNELS: 134215680>, ScanDuration=2, ScanCount=1)]
2021-11-23 14:51:00.791 ubuntu bellows.uart DEBUG Sending: b'83401b7e'
2021-11-23 14:51:00.791 ubuntu zigpy.zdo DEBUG [0x0000:zdo] Unsupported ZDO request:ZDOCmd.Mgmt_NWK_Update_req
2021-11-23 14:51:00.792 ubuntu bellows.ezsp.protocol DEBUG Application frame 63 (messageSentHandler) received: b'00000000003800000040010000c2080000'
2021-11-23 14:51:00.793 ubuntu bellows.zigbee.application DEBUG Received messageSentHandler frame with [<EmberOutgoingMessageType.OUTGOING_DIRECT: 0>, 0, EmberApsFrame(profileId=0, clusterId=56, sourceEndpoint=0, destinationEndpoint=0, options=<EmberApsOption.APS_OPTION_ENABLE_ROUTE_DISCOVERY|APS_OPTION_RETRY: 320>, groupId=0, sequence=194), 8, <EmberStatus.SUCCESS: 0>, b''] You can try it yourself: diff --git a/zigpy_znp/tools/energy_scan.py b/zigpy_znp/tools/energy_scan.py
index e05f0c1..fac5101 100644
--- a/zigpy_znp/tools/energy_scan.py
+++ b/zigpy_znp/tools/energy_scan.py
@@ -8,7 +8,8 @@ import zigpy.zdo.types as zdo_t
import zigpy_znp.types as t
from zigpy_znp.tools.common import setup_parser
-from zigpy_znp.zigbee.application import ControllerApplication
+from bellows.zigbee.application import ControllerApplication
LOGGER = logging.getLogger(__name__)
@@ -20,7 +21,7 @@ async def perform_energy_scan(radio_path, num_scans=None):
app = ControllerApplication(config)
try:
- await app.startup(read_only=True)
+ await app.startup()
except RuntimeError as e:
LOGGER.error("Could not start application: %s", e)
LOGGER.error("Form a network with `python -m zigpy_znp.tools.form_network`") |
Ah, so much d doesn't support it and forwards to the app. |
This decouples the zigpy-znp energy scan tool from the zigpy-znp API. It will be moved into zigpy-cli in a future release.
Mgmt_NWK_Update_req
.@Adminiuga Thoughts about making this work with bellows? How about a method in zigpy with a default implementation?
Bellows can then override it to use the appropriate EZSP command.