Custom BLE service freezes bangle while peripheral to iPad #7782
-
I have an unexpected problem getting a custom BLE peripheral service working on the Bangle js2 from a "central" iPad. It works completely when the central device is an Android phone. I am working on extending my Umpire Ball Counter app to connect to a cricket scoring app commonly used for scoring cricket matches in the UK. The app is the ECB's Play Cricket Scorer app (PCS) which is available on Google Play and the Apple app store. The app offers an "External Scoreboard" feature which sends updates to bespoke cricket scoreboards via Bluetooth. It turns out that the protocol is very simple and I've successfully ported the service and characteristic UUIDs discovered by the team at https://buildyourownscoreboard.wordpress.com/optional-play-cricket-scorer-app-integration/ This works well when I run the PCS app on my Google phone and connect my Bangle js2 as the external scoreboard to the app in its match settings (see link above). My umpire app interprets the values sent by PCS and updates a js object with the simple numbers which would appear on a physical scoreboard but also interprets the sequence of scoreboard updates to infer the runs or extras scored on each ball of the over... happy days! However, when I tried to connect from the iPad version of PCS app the Bangle app freezes. It seemingly doesn't respond to touch or btn actions whilst connected. However, when I disconnect my "scoreboard" in the PCS match settings, the touch and btn events appear to fire all at once, and scoreboard events via Bluetooth even appear to have taken effect. The problem is that while I can debug on Android, as the terminal in Chrome can connect to the Bangle after I've made the "scoreboard" connection, I can't debug on the iPad, so I don't know if there is an exception occurring or something else going on. Any ideas? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 13 replies
-
The code is simple enough to post here (but isn't ready for app review
|
Beta Was this translation helpful? Give feedback.
-
My next step was going to be to test coded phy from iOS, which probably isn't supported but I do need the long range when umpiring some 45m from the central device. |
Beta Was this translation helpful? Give feedback.
-
Is that code enough to reproduce the problem completely? And your Bangle.js firmware is up to date? One thing I guess might be an issue is if you're writing a lot of log information to the console? Maybe the fact that the iPad connects via Bluetooth but then doesn't request information from the Bluetooth UART service means that Bangle.js stores everything you're outputting via I honestly thought I had added something to work around that (detecting when notifications are enabled and ignoring console.log calls if not) but maybe there's something about iOS that's confusing it. So maybe try one of:
Note that with the last 2 you won't be able to connect/flash the Bangle while your app is running because the console gets moved out the way |
Beta Was this translation helpful? Give feedback.
Is that code enough to reproduce the problem completely? And your Bangle.js firmware is up to date?
One thing I guess might be an issue is if you're writing a lot of log information to the console? Maybe the fact that the iPad connects via Bluetooth but then doesn't request information from the Bluetooth UART service means that Bangle.js stores everything you're outputting via
console.log/print
and then when the output buffer gets full it stalls?I honestly thought I had added something to work around that (detecting when notifications are enabled and ignoring console.log calls if not) but maybe there's something about iOS that's confusing it.
So maybe try one of:
cons…