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

8dB defaultDBmTX #162

Closed maagedmazyek closed 3 years ago

maagedmazyek commented 3 years ago

Is it possible to make use of the 8dB (NRF52840) and have a more stable connection?

Anyway I tried to set defaultDBmTX = 8; in Config.h (latest firmware), and it results in a reboot-loop of the firmware.

mariusheil commented 3 years ago

Hi,

I would need to look into this with more detail, but it is probably rebooting because the SoftDevice does not accept the given value. The error probably happens in FruityHalNrf::BleStackInit where the method RadioSetTxPower is called. It probably returns an error code, so you should check if that value was correctly translated by our HAL or not and what the returned error is. Just add a log statement there and you will find out.

Actually, from looking at the implementation of RadioSetTxPower, I can see that the value of 8 is not properly mapped by our HAL to the nRF52840. We will fix that, I created a ticket. In the meantime, you should be able to add the value yourself.

BTW: Reboots are often just happening because we are manually resetting the chip. Always have a look at the reboot reason on startup. This happens if the Stack returns some error that is not critical at all, but FruityMesh decides it does not have proper error handling in this place and then issues a reboot command.

Marius

maagedmazyek commented 3 years ago

Ah, this looks simple. I was not sure if RadioSetTxPower is the only spot. I will report.

maagedmazyek commented 3 years ago

It works. First impression: more stability / greater range, but this has to be tested more.

Next thing I'm going to do is to measure the energy consumption difference. Im expecting 20-40% increase here.

mariusheil commented 3 years ago

Hi, I am closing this now, feel free to reopen it if something pops up again.