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

How to renew the open network time on Zigbee coordinator? (TZ-1295) #483

Open
3 tasks done
nalves23 opened this issue Nov 15, 2024 · 3 comments
Open
3 tasks done
Labels

Comments

@nalves23
Copy link

Answers checklist.

  • I have read the documentation ESP Zigbee SDK Programming Guide and tried the debugging tips, the issue is not addressed there.
  • I have updated ESP Zigbee libs (esp-zboss-lib and esp-zigbee-lib) to the latest version, with corresponding IDF version, and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

IDF version.

ESP-IDF 5.3.1

esp-zigbee-lib version.

1.5.1

esp-zboss-lib version.

1.5.1

Espressif SoC revision.

ESP32-S3

What is the expected behavior?

When a coordinator has network in open mode to accept new Zigbee devices, after device joins, timer of open network must be renew by another 180 seconds.

What is the actual behavior?

I have a Zigbee coordinator with a physical button to open/close network for router or end devices joins the Zigbee network.
My default open network time is defined to 180 seconds. To open and close the network, I use the functions esp_zb_bdb_open_network(ZB_ZGP_DEFAULT_COMMISSIONING_WINDOW) and esp_zb_bdb_close_network(), respectively, where ZB_ZGP_DEFAULT_COMMISSIONING_WINDOW is 180.

I have a feature that after one device joins the network, I want to renew the open network time. After device joins I call the function esp_zb_bdb_open_network(ZB_ZGP_DEFAULT_COMMISSIONING_WINDOW) but the open network time doesn't renew it.
I have try it call first esp_zb_bdb_close_network() and after esp_zb_bdb_open_network(ZB_ZGP_DEFAULT_COMMISSIONING_WINDOW), but this procedure still doesn't work.

There are any function or callback that i can use to read open network timer or renew this timer when I need it?

Steps to reproduce.

  1. Open network during 180 seconds (pushed button)
  2. Put Router device in joining mode to join Zigbee network, after 60 seconds of 1
  3. Device joins and coordinator call again the function esp_zb_bdb_open_network(ZB_ZGP_DEFAULT_COMMISSIONING_WINDOW)
  4. After 180 seconds of point 1, the network close associations.

More Information.

No response

@nalves23 nalves23 added the Bug label Nov 15, 2024
@github-actions github-actions bot changed the title How to renew the open network time on Zigbee coordinator? How to renew the open network time on Zigbee coordinator? (TZ-1295) Nov 15, 2024
@xieqinan
Copy link
Contributor

Hi @nalves23 ,

I think your requirement can be achieved using the gateway example and the dimmable light example without any modifications.

The gateway running on the ESP32-S3 would behave as follows: You can observe the Network(0x1c84) is open for 180 seconds log being printed twice.

I (5699) ESP_ZB_GATEWAY: Initialize Zigbee stack
I (5709) ESP_ZB_GATEWAY: Device started up in  factory-reset mode
I (5709) ESP_ZB_GATEWAY: Start network formation
W (5889) ESP_ZB_GATEWAY: Network(0x1c84) closed, devices joining not allowed.
I (5889) ESP_ZB_GATEWAY: Formed network successfully (Extended PAN ID: 60:55:f9:ff:fe:f7:a2:ad, PAN ID: 0x1c84, Channel:13, Short Address: 0x0000)
I (6499) ESP_ZB_GATEWAY: Network(0x1c84) is open for 180 seconds
I (6499) ESP_ZB_GATEWAY: Network steering started
I (71019) ESP_ZB_GATEWAY: ZDO signal: NWK Device Associated (0x12), status: ESP_OK
I (71019) ESP_ZB_GATEWAY: ZDO signal: ZDO Device Update (0x30), status: ESP_OK
I (71119) ESP_ZB_GATEWAY: New device commissioned or rejoined (short: 0x9a67)
I (71729) ESP_ZB_GATEWAY: ZDO signal: ZDO Device Authorized (0x2f), status: ESP_OK
I (71819) ESP_ZB_GATEWAY: Network(0x1c84) is open for 180 seconds

@nalves23
Copy link
Author

Hi @xieqinan

Thank you for your feedback.

I have test it the same example that you referee and It worked well. However, in my example it didn't work again!
What I did immediately was to bring my code closer to the example code, calling the network opening at the beginning of my gateway's operation (in the ESP_ZB_BDB_SIGNAL_DEVICE_REBOOT event of the esp_zb_app_signal_handler function), it worked well:
1- Gateway starts;
2- When the even ESP_ZB_BDB_SIGNAL_DEVICE_REBOOT occurs, the function esp_zb_bdb_open_network(180) is called;
3- After 60 seconds, I associated a device, and in the ESP_ZB_ZDO_SIGNAL_DEVICE_ANNCE event, I called the esp_zb_bdb_open_network(180) function again;
4- After 180 seconds from the previous point (3) the network is closed. So it worked as I expected.

The problem occurs if I don't call the network opening function at gateway start up but if I call the network opening event randomly, with the gateway running for some time via a press button, for example.
My question is if there is any procedure that changes these settings after the gateway is initialized?

Can you try an example like mine, or has anyone already done it and had the same result?

kind regards
nalves23

@xieqinan
Copy link
Contributor

@nalves23 ,

I think this issue can be resolved more quickly, if you can provide a simple example to reproduce it.

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

No branches or pull requests

2 participants