BLE Extension: Modifying connection interval? / Timing issues PSoC/PRoC?

244 views
Skip to first unread message
Assigned to ewpa...@gmail.com by gerri...@gmail.com

hoeni84

unread,
Mar 13, 2018, 5:08:43 AM3/13/18
to MIT App Inventor Forum
Dear all,

I have already successfully read data from a PSoC (BLE 4.1) Device to AppInventor Apps using the BLE components. So when I was lately confronted with a new device (PRoC BLE4.2) developed by a colleague, I thought it's a piece of cake. And actually I can read dataf rom the new device from it's several sensors, but unfortunately it seems like this data is never updated - so every time I read I get the same value.. :(

The app still works well with earlier prototypes / devices.
And the new prototype works well with Cypress' CySmart App - so I know that the firmware of the device works in general.
The only thing that is different, is that we are running much higher sampling rates and shorter connection intervals (currently desired are 10ms). 

Has anyone of you faced similar issues?
Does anyone know if it is possible to modify the connection interval of the BLE extension in AppInventor? 

Every answer is appreciated.. ;)

Thanks, Sebastian

gerrikoio

unread,
Mar 13, 2018, 6:33:31 AM3/13/18
to MIT App Inventor Forum
Hi Sebastian

I have both PSoC 4.1 and 4.2 devices but have not played with connection timings. Interesting issue you've raised as not sure the AI2 BLE notification block can handle the higher frequency data stream. What are you doing with the data inside the app, as your app may not be able to process it quickly enough if data arriving at 10ms intervals? Are these connection timings and sampling rates critical for your app. It may be a case of trial and error and adjust the timing intervals.

hoeni84

unread,
Mar 14, 2018, 6:38:53 AM3/14/18
to MIT App Inventor Forum
Hi gerrikoio (and everybody else ;) ),

Thanks for your message and your interest in the topic.
Actually the app is just a side project, so the data stream / throughput is defined by the "real" application (PRoC to PSoC communication) and not really discussable - so, unfortunately we don't want to reduce the sampling rate and connection timing, if it's possible...

But, I made some progress in understanding my problem. As you already suspected I figured out that the change to BLE 4.2 and the PRoC  aren't the problem - I established successfull a communication.

The problem is definitely the throughput of data - in detail the MTU size is one problem. It seems that this is fixed to 23 bytes. And I need 43... ;). With a smaller datapackage of 20bytes it works..
This question was also discussed in: https://groups.google.com/forum/#!category-topic/mitappinventortest/app-inventor-extensions/oQPTBjIckJU
but unfortunately there seems to be no solution.

As i understand so far the MTU size is negotiated between central (in this case Android) and peripheral during pairing.
Is there any possibility to send requests to the GATT via the AppInventor?

Same goes for the connection interval - apparently GATTrequesting "ConnectionPriority" might be the answer..


So, does anybody have an idea if it is possible to manipulate the connection / GATT parameters using AppInventor?

As usual all answers / thoughts are appreciated ;)
Sebastian


Reply all
Reply to author
Forward
0 new messages