Connecting to Movesense - ios

I have powered on the Movesense and built the iOS app and installed on my device. I refresh the device list, see a Movesense and tap to connect. From the Device tab in the app, I tap "Connect device", but the wheel spins but never seems to connect. Any ideas?
Other info that may indicate where the issue is: when tapping on the Logging tab and selecting Start data logging, I get the error "The operation couldn't be completed. ([wb] Failed to get resource error 404.) I see the same error when attempting to "Set device time" on the Time and HR tab.
movesense

There is an iOS BLE bug that manifested itself when we updated the device bluetooth stack to BLE 4.2 (Nordic Semiconductor SoftDevice 3.0.0). That combination caused the BLE connection getting stuck in service discovery phase.
The fix requires that you flash the latest Movesense device application to the sensor, not just the latest mobile app (actually just the sensor software update is needed because the fix/workaround is there).
So, please flash your sensor with the latest software and you should be able to connect just fine also with iPhone. If you are still having problems, please make an issue in the bitbucket movesense-mobile-lib project.
Full disclosure: I work for Movesense team

Related

How to debug an app on iPhone without internet

I'm using Xcode 10.1, and I don't have a checkbox whether I want to connect through network or not on my device page (which was there in Xcode 9 and Xcode 10 beta). Search "connect via network xcode" on google images if you don't know what I mean.
However, I must debug the offline flow of my app (which is written in React-Native btw). Not just no-internet-connection, but turning off wifi and mobile-data, which will trigger a status change. By using the developer settings of the iPhone, I can make every call fail (100% loss), but cannot change the internet-status of the phone.
So I want the debugger to stay connected and either be able to:
debug the old-school way through the cable (if I turn off internet now, I get a red error screen and nothing is possible anymore), so I can disable wifi and mobile-data,
or simulating that status change on the phone.
Btw, I cannot use a simulator, since the app requires Bluetooth.
Thanks in advance!
Edit:
The checkbox is not there for older iPhone devices. With iPhone 7s, I do see the checkbox "connect via network". But enabling or disabling does not change the fact that your iPhone needs internet to debug. If I disable internet on the phone I get the following error:
Ok, I've found the problem. We are testing on a iPhone5, which is no longer officially supported by Apple. Which means that Apple has decided to cut features for iPhone5 so you would buy a new one (wonderful strategy =/). Hence debugging with a cable is no longer supported on iPhone5.
We tested with a iPhone6 from a colleague, and everything works fine.
Edit:
Altough the checkbox is there, and I can disable wifi for connection... The moment I turn off internet on the phone, the app crashes and says: "Runtime is not ready for debugging: make sure packager runtime is running"... so no solution yet...

App discovers bluetooth devices only when ran from Xcode

I'm working with a fork of this project for Empatica E4 wristbands and I'm unable to make the discover devices work without running the app from Xcode. The situation can be replicated with the original sample project.
When I ran the project through Xcode, I can see the list of nearby devices.
However, when I close the app and ran in from the phone (instead of clicking "play" on Xcode), I can't see any device.
Should I configure something on the Project or own a developer account? Right now I'm not paying a developer account but I thought I could do this without using Xcode to run the app. Thanks.
In short: I can open the app without connecting the phone to XCode but I can't discover devices when I'm not connected to XCode.
More details.
When executed through Xcode on the iphone, the device discover works. On the logs, we can see:
E4tester [didUpdate] status 2 • kBLEStatusScanning
bluetoothd Received XPC message "CBMsgIdScan" from session "Empatica.E4testerCV-central-313-24"
bluetoothd Received 'start scan' request without duplicates for all UUIDs from session "Empatica.E4testerCV-central-313-24"
bluetoothd State of application "Empatica.E4testerCV" is now "foreground-running"
However. When the app is opened on the iPhone (instead of ran via Xcode), we get the following log messages:
E4tester [didUpdate] status 0 • kBLEStatusNotAvailable
E4tester Task <EA813C26-F662-461C-8C47-A97FA7E32BA4>.<0> response ended
E4tester Task <EA813C26-F662-461C-8C47-A97FA7E32BA4>.<0> done using Connection 1
The important detail here is the kBLEStatusNotAvailable status, which contrasts with kBLEStatusScanning. According to their docs this means The iOS device does not support Bluetooth LE, or the Bluetooth LE module is not active. but the device does support BT LE and is enabled.
I opened an issue on their repository.
You need developer's account for testing Xcode apps in devices.
Developer account will give certificates and provisioning to run app in device. There is 2 certificates develop and distribution.
In your case you don't have any apple account. so maybe u are using freee provisioning
Please read this one to understand free provision:
Test iOS app on device without apple developer program or jailbreak
Maybe the capabilites on free provision is limited on debug mode *(runned from xcode)
In the end I got a direct answer from Empatica support team which I think is perfect since I sought an answer from credible and/or official sources.
Still, I would like to thank Antonio for his useful answer as well as Scriptable and Hichem for their messages.
The answer from Empatica E4 team is the following:
#carlosvega If you are working with an iPhone with iOS 11 or 12 you
should add the string NSBluetoothPeripheralUsageDescription in the
Info.plist file. The sample code has been created a while ago before
the privacy string was mandatory.
-- Empatica Engineering Team

Bluetooth Transmitting Legacy Name

I am working on an mbed powered Bluetooth Low Energy project. I have been developing various GATT services, however, I have now found my project has got "stuck" on a previous service. What ever program I download onto the device, a Service is broadcast with the name "HRM_SEC". I have repeatedly changed the name from this.
I have installed known working examples of default Heart Rate Monitor Example. I have installed blank programs without bluetooth service definition etc.
However, the name of this prior service is persisting.
I have reinstalled my ios app - LightBlue - incase it was a casheing thing. By reinstalled I mean deleted and then downloaded from app store.
I can't connect to these services. New programs are being installed, as I am getting the expected serial feedback.
Why is this happening and What can I do?
I have just tried using the LightBlue app on a different iPhone and I am getting the expected behaviour. How can I purge the stored data from the LightBlue app. I have tried deleting it, then doing a reset (holing lock and home button), then when it has rebooted I re-downloaded the app from the app store. What else can I do to clear which ever info is being stored by LightBlue?
This seems to be an underlying iOS issue, as my other apps are also now using this legacy name. I have tried disabling and then enabling Bluetooth, but this hasn't worked. Any other ideas?
I have submitted an iOS bug report. This is really annoying, as I cannot use my iPhone to test an app I am working on. Any ideas for workarounds?

iOS BLE disconnecting right after connection, only restarting device helps

My app uses BLE (Bluetooth 4) to connect to a physical peripheral.
My users and I have repeatedly encountered a bug where, at some point, the app stops connecting to the peripheral - you can see an indication that the BLE peripheral is discovered and the connection was established, but then few seconds after, the connection is dropped.
Things go back to normal only after restarting the iDevice.
I’ve done a very long work on checking it and researched this issue thoroughly, until I got to the conclusion that this must be a bug in iOS (tested with 7.1, but probably occurs on 8.0 as well).
My tests and findings:
Occurs with every BLE supporting iDevice.
Occurs with both my own BLE peripheral and with other 3rd party BLE products, both known to work perfectly in normal cases.
It can sometimes work well for even 50 launches, but then eventually it’ll fail.
Network & factory settings reset did not help.
Tested and occurred with various applications: ##
My own app.
Clean new Xcode project that’s only scanning for peripherals and trying to connect to the first and only discovered peripheral.
Apple’s BLE example app: Health Thermometer (with relevant modifications since I don’t have this particular peripheral).
3rd party apps, including the generic LightBlue.
Important note: Every one of the options above worked perfectly for a while (multiple launches), at some point suddenly stopped and then worked again after a restart of the device.
The connection procedure seems to fail when trying to discover the peripheral’s services - i.e. it gets discovered and connected normally, but when initiating discovery of services, it stops responding (didDiscoverServices isn't called).
I have of course tried many approaches found online with no luck.
Can anyone shed some light on this problem?
Is it a known issue?
Was it fixed in a recent iOS update?
Is it going to be fixed?
You can imagine the negative affect such an issue has on my users’ experience, as BLE connection is essential to the product.
I'll appreciate your advice and suggestions on how to solve it.
Thanks!
Update:
Apple responded to my tech support request:
Bottom line(s):
They said they had fixed some BLE related bugs in iOS 8 and urging us to test if it still happens in iOS 8.
They said to start with that and if not, try to diagnose the problem with a utility app they provide.
So far for me it didn't happen with iOS 8, but on the other hand I can see posts about other Bluetooth issues, that are not necessarily related but who knows.
Full answer:
I’m responding to your finding that you and your customers find that
after some point of use, iOS BLE fails to maintain a connection. You
indicate that the problem was identified with iOS 7.1. There have been
issue regarding iOS BLE which have been reported and have been fixed
with iOS 8.0. To best determine whether your issue has been addressed,
of course the simplest means would be to install iOS 8 and to see if
the issue can be replicated. However, as you report that you can
replicate the problem on your deivce with iOS 7.1 the first thing
would be to obtain the Bluetooth Server profile, install it to your
deivce, replicate the problem, then obtain a BLE Server log when the
problem occurs. The profile will have the BLE server report additional
logging details which can help to report issues that the server
encounters. We can see if the issue is one which has been reported
previously. Something to consider is that for all new bug report
issues, Core Bluetooth engineering is requesting that all issues be
regressed with the currently shipping version of iOS - that is 8.0.
For customers with iOS 7.x, there will be no more iOS 7 updates - all
software fixes and bug fixes will be with iOS 8. For this reason, only
issues which are reported with iOS 8 will be investigated. You can
obtain the BLE server profile from the Apple Developer bug report web
page https://developer.apple.com/bug-reporting/ios/bluetooth/. The
instructions for installing the profile and capturing the log, are
presented on the web page. If you capture a log with iOS 7.x, you can
send it to me for review. However, this will be somewhat of an
academic exercise - to know if iOS solves the issue, or whether it
persists, we will need to see if the issue occurs under iOS 8.
Something to keep in mind, once you update a device to iOS 8, you will
not be able to restore it to a previous version. I’m happy to
review your results. If however, the problem persists under iOS 8,
it’s best to submit a bug report to get Core Bluetooth engineering’s
attention on this matter. You can submit a bug report using the Apple
Developer bug report web page. - http://bugreport.apple.com
So it looks like the problem is solved with recent iOS update (either 8.0 or 8.1).

Socket Mobile SDK cannot reconnect to the device

We have an application that's using a Socket Mobile scanner (a CHS 7Xi, in particular) to scan bar codes from a variety of sources. We're using the latest SDK. It appears that sometimes—not always—when the app resigns and then regains active status, the SDK is unable to reconnect to the device. We get a few error notifications through the delegate protocol (specifically, ESKT_UNABLEINITIALIZE), and then nothing. Fixing this usually involves quitting the app, restarting the scanner, and starting over.
Does anyone have any idea why that might be, or how we can prevent this?
EDIT: hrm. The problem described in this Socket Talk blog post sounds familiar. Though it claims that the issue was long-since fixed in the SDK we're using (10.0.9.10686).

Resources