zigbee2mqtt icon indicating copy to clipboard operation
zigbee2mqtt copied to clipboard

Increase device limit beyond 48 devices

Open Koenkk opened this issue 8 years ago • 22 comments

This is currently a limitation of the firmware for the CC2531.

Some resources:

  • https://e2e.ti.com/support/wireless_connectivity/zigbee_6lowpan_802-15-4_mac/f/158/p/509541/1848708

Koenkk avatar May 08 '18 17:05 Koenkk

Is there a way to get the a link to the firmware source code with details on how to build it as well?

ciotlosm avatar May 09 '18 06:05 ciotlosm

@oskarn97 would it be possible to share any details on how you compiled this firmware?

Koenkk avatar May 09 '18 08:05 Koenkk

It is not possible to increase the device limit beyond 48 devices since to memory limitation on the Chip. I compiled the Z Stack Home with IAR Embedded Workbench with some flags required for encryption and maximum device limit.

oskarn97 avatar May 09 '18 09:05 oskarn97

Would it be possible to reduce the size of the firmware so there is more memory left for devices? http://processors.wiki.ti.com/index.php/Optimizing_Flash_and_RAM_Usage_of_Z-Stack_for_CC2530

Koenkk avatar May 09 '18 09:05 Koenkk

I doubt if NWK_MAX_DEVICE_LIST defines the maximum number of devices in the network. In this official Texas Instruments document chapter 4 Z-Stack Knobs they are talking about a 400+ nodes network while only having set NWK_MAX_DEVICE_LIST to 10. I have the feeling that when adding more routers to your network you can add more nodes to your network.

Maybe 48 devices is not the limit at all....

Koenkk avatar May 09 '18 22:05 Koenkk

Yes, the device limit refers to the number of devices that can be paired to a single coordinator. You can use more of course.

oskarn97 avatar May 09 '18 22:05 oskarn97

@oskarn97 Could you still tell us what you changed / done to compile the firmware and how to generate the .hex file ?

ioudeveldhuis avatar May 17 '18 13:05 ioudeveldhuis

I've just increased the device limit and enabled secure link join. Apart from that I did not modify the default TI Z Stack Home. bildschirmfoto 2018-05-21 um 10 28 45

oskarn97 avatar May 21 '18 08:05 oskarn97

By reducing the MAXMEMHEAP in OnBoard.h to e.g. 1000 I was able to compile with NWK_MAX_DEVICE_LIST 90.

@oskarn97 how did you enable secure link join?

Koenkk avatar May 26 '18 12:05 Koenkk

add the "TC_LINKKEY_JOIN" compile on the preprocessor option

oskarn97 avatar May 26 '18 12:05 oskarn97

@Koenkk Is it safe to reduce MAXMEMHEAP?

ptvoinfo avatar May 27 '18 06:05 ptvoinfo

@ptvoinfo we need to do some tests with it.

Koenkk avatar May 27 '18 11:05 Koenkk

I think it's not possible to reduce the heap size, I'm getting the same error as #65 in this case.

Koenkk avatar May 27 '18 17:05 Koenkk

I've created a wiki page which explains how to add more than 48 devices to your network.

Koenkk avatar May 28 '18 18:05 Koenkk

@Koenkk @oskarn97 wouldn't we solve the memory problem by using a dongle with a CC2538 SoC? It has up to 32KB instead of 8KB.

makuser avatar Dec 01 '18 15:12 makuser

@makuser maybe; but that setup is much more expensive.

For now I don't see any problem when using the CC2531/CC2530 with the current firmwares. It's stable even for larger networks.

Koenkk avatar Dec 01 '18 17:12 Koenkk

I have 32 xiaomi zigbee devices... I need to use 1 coordinator e 2 router CC2531 to manage all 32 devices?

vpomax avatar Jan 25 '19 21:01 vpomax

@vpomax could be a bit tricky, I would recommend adding another CC2531 router to be sure.

Koenkk avatar Jan 26 '19 19:01 Koenkk

Shouldn't it be possible to use 44 devices with one CC2531 without router with the alternative firmware from https://github.com/Koenkk/Z-Stack-firmware/blob/master/coordinator/CC2531/alternatives/max_devices/?

cmorlok avatar Jan 26 '19 20:01 cmorlok

@cmorlok yes, but note that that firmware could have some downsides. It has less memory available which could lead to freezing and less responsive devices.

Koenkk avatar Jan 26 '19 20:01 Koenkk