Dear all,
I am currently developing a sensor station looking to provide a client device with readings from several sensors.
I have created a GATT Server and a corresponding set of Services which contain the characteristics with the sensor data.
My idea is that whenever the client connects, the station will start transmitting the sensor data to the client (I am using BLE configurations) However, I have run into an issue with the actual throughout.
Currently for testing purposes I am sending 6 bytes of data at a frequency of ~50 Hz. Unfortunately, increasing the frequency will cause the buffers to fill. I am sure I am not doing something right since I am barely transmitting 300bytes/sec!
I am using the ez430-rf256x development board which contains a PAN1323 BL module and a MSP430BT5190 MCU.
This is a rough outline of what I am doing:
I have created a BTPS Scheduler function that is called every 20 msec.
In the function I perform the sensor measurements and put the data into an array to be transmitted.
The device then checks if there is an active BLE connection. If there is one, I use the GATT_Handle_Value_Notification to transmit the data to the connected client.
However,, If I decrease the function's period, say to 10 ms, I get the BL stack giving an "Alloc Failed: 29".and the data transmission stops.
I am not very familiar with BL transmission practices but the throughput Im getting seems ridiculously small so I'm sure I am doing something wrong. I was thinking maybe I should rather create a bigger data buffer that contains multiple sensor readings this way I could send a bigger packet with a single call to the Notification function. However, it seems that the Notification function can only transmit up to a certain number of bytes.
Any pointers on this would really be appreciated! Maybe having my client do a GATT Read Request would be a better option instead of the server sending notifications? On a rough estimate I need around 1.5kbps which I think it should be very doable.
Thanks for the help!