jrowberg / bglib

BGLib implementation for Bluegiga BLE Bluetooth Smart modules
Other
240 stars 170 forks source link

CRP Example with Arduino101/Processing3 in python mode #24

Open mjs513 opened 8 years ago

mjs513 commented 8 years ago

Hi Jeff

First thanks a million for the python library. I am trying to get the bglib_test_crp_collector.py example to work with Processing3 in python mode using the Arduino101 board and having only partial success.

It gets through reading the advertising packet and discovering the service but never connects to the Arduino101. I tested example in python and of course it works like a charm. I also tested the scanner example under processing/python mode and it works fine.

Don't know of anyone trying this with the BLED112 dongle so any help would be appreciated. I am attaching the files for reference. BLEPython.zip

Here is how far it gets. It never gets the the 05 packet to trigger the event.

Baudrate: 115200
=>[ 00 01 03 00 00 ]
<=[ 00 03 03 00 00 86 01 ]
=>[ 00 02 06 01 00 00 ]
<=[ 00 02 06 01 00 00 ]
=>[ 00 00 06 04 ]
<=[ 00 02 06 04 00 00 ]
=>[ 00 05 06 07 C8 00 C8 00 01 ]
<=[ 00 02 06 07 00 00 ]
Scanning for BLE peripherals...
=>[ 00 01 06 02 01 ]
<=[ 00 02 06 02 00 00 ]

Thanks Mike

mjbrown commented 8 years ago

It looks like you aren't getting any advertisements in your scan. If you were, you'd get some long messages from the dongle like these: COM7: 2016-05-23 21:02:11,414 - bgapi - INFO - EVT-GAP Scan Response - RSSI:-40 - Packet Type:0 - Sender:00:07:80:78:a5:b8 - Address Type:0 - Bond:0 - Data:020106 COM7: 2016-05-23 21:02:11,596 - bgapi - DEBUG - <=[ 80 21 06 00 C9 00 40 20 F4 70 EC F4 01 FF 16 02 01 06 02 0A 04 0F 09 42 6C 75 65 4D 6F 20 4C 69 66 65 50 4F 34 ] COM7: 2016-05-23 21:02:11,596 - bgapi - INFO - EVT-GAP Scan Response - RSSI:-55 - Packet Type:0 - Sender:f4:ec:70:f4:20:40 - Address Type:1 - Bond:255 - Data:020106020A040F09426C75654D6F204C696665504F34 COM7: 2016-05-23 21:02:11,790 - bgapi - DEBUG - <=[ 80 21 06 00 CE 00 40 20 F4 70 EC F4 01 FF 16 02 01 06 02 0A 04 0F 09 42 6C 75 65 4D 6F 20 4C 69 66 65 50 4F 34 ]

Note: This log is from a different BGAPI python library, available on pypi (pip install bgapi).

mjs513 commented 8 years ago

Hi Mike

Sorry for not getting back to you sooner but I have had a family medical emergency that has taken precedence. I came across the library that you mentioned but it did not have a good example for using CRP and the examples required me using two BLED112s when I just wanted to use the Arduino101 board and the PC. Anyway, Jeff's library seems to work fine when run under Python - no issues. But the problem is occurring when I move it over to Processing 3.0 in Python mode that it seems to be failing and I do not have a clue how to trace where the problem lies. I don't re ally want to try converting another library to run under Processing at this point.

Mike