bluerange-io / bluerange-mesh

BlueRange Mesh (formerly FruityMesh) - The first completely connection-based open source mesh on top of Bluetooth Low Energy (4.1/5.0 or higher)
https://bluerange.io/
Other
288 stars 109 forks source link

How to change advertising interval #199

Closed LubomirBogdanov closed 1 year ago

LubomirBogdanov commented 2 years ago

Hello everyone, I'm trying to evaluate the current consumption of a fruitymesh node. So far I measure 1.63 mA average current (using a battery simulator unit, and not a multimeter, so it should be very accurate). I have turned the UART and TERMINAL off from the featureset.

Is there a way to change the advertising interval?

In a Nordic project I would change the APP_ADV_INTERVAL macro, but in fruitymesh I can only see this macro in nrf_ble_dfu.c which is (probably) related to the bootloader and not the application.

Regards, L. B.

mariusheil commented 2 years ago

Hi,

the used advertisement, connection, etc,.... intervals are specified in the Config.h and Config.cpp and you can change them, but be aware that too much change might result in bad connection properties as we have tried to figure out good values already.

The most power consumption will come from the mesh connections. Changing the connection interval will have a significant effect. Adding slave latency to these connections will also reduce the current, but sadly we do not have this implemented yet as a lot of our customers send a lot of data through the mesh and even though FruityMesh was designed to be as power efficient as possible, it is currently not our main use-case. If you have devices that only need to report data sporadically and should consume very little energy, you can use them as leaf nodes (implemented in the firmware) or you can implement the ASSET device type, but you will need to have a gateway to manage the connectivity as we have this implemented on our Gateway and not in the firmware itself.

If you are interested in low power nodes, you should make sure that the discovery will be turned off after all nodes have been connected. Now, the difficult part is to know what "all nodes" really means. If you have a gateway, or know the number of nodes that must be connected, you can use the "set_enrolled_nodes" feature (https://www.bluerange.io/docs-internal/fruitymesh/Node.html#_setting_number_of_enrolled_nodes).

Marius

mariusheil commented 1 year ago

Hi, I will close this for inactivity, feel free to re-open it.