Post

Replies

Boosts

Views

Activity

A proper design approach for implementing a data logger using BLE in an iOS app.
Thank you for always reading my questions. This time, I'd like to ask some specific questions to gain a deeper understanding of iOS CoreBluetooth. In the previous question, we learned that although iOS can perform BLE scanning in the background, it is not suitable for use as a data logger. I was also taught that when using it as a data logger, the iOS app should use GATT communication, and that instead of reading data from the device one by one, it is recommended to store large amounts of data on the device and connect at an appropriate time (such as when the iOS app enters the foreground) to retrieve the data all at once. My requirements are the same as last time. I want to send data from a device equipped with some kind of sensor via BLE and display it in a graph in the iOS app. Data should be acquired every few to tens of seconds and reflected immediately in the graph. Measurements may take up to 24 hours at most. I would like to avoid making any major changes to the device. Also, it is unclear whether there will be enough memory for the data logger for 24 hours. Therefore, I am first looking for an appropriate communication method for the iOS app. iOS is smart and convenient, so I think users will check the measurement status every time they use this iOS app.Therefore, I want to be able to check the changes from the start of measurement to the present in a graph as soon as the app is launched. I would like to measure data from multiple devices (e.g. 5 devices) at the same time. I have a question based on the above requirements. When thinking about the best way to avoid making changes to the device, the only way I could come up with, as someone with insufficient iOS technology, is to keep the connection open via GATT communication and continue to obtain data. However, does iOS GATT communication have any limitations in this regard? Will the OS automatically disconnect GATT communication at a certain time? Also, if that happens, is there a way to automatically reconnect and obtain the data? Is it possible to smoothly obtain data using iOS GATT communication without any particular restrictions even in the background? Are any other permissions required? Regarding the sixth requirement. Until last time, with BLE scanning, even if there were multiple devices, the iOS app could measure the data for as many devices as it wanted, but this time, how many devices can be read? In the case of GATT communication with iOS CoreBluetooth, can multiple devices maintain a long connection? Or is it basically better to have one device per connection when creating such an app for iOS? I would like to know if there are any restrictions or points to be careful of when using GATT communication with multiple devices. I'm sorry for broadening my question, but if neither question 1 nor question 2 works, it will put a burden on the design of the device. If data is stored on the device, is it possible to automatically and periodically connect to the device at a set time interval (for example, once an hour, allowing for some margin of error) when the iOS app is in the background, and obtain log data from the device? If you can think of any other best methods, please feel free to let me know. Also, I'd be happy if you could reply with any reference materials or URLs. Please note that our response may be delayed.
0
0
95
May ’25
Is it possible for iOS to continue BLE scanning even when the app goes into the background?
Nice to meet you, I'm currently trying to create an app like a data logger using BLE. When a user uses the above app, they will probably put the app in the background and lock their iPhone if they want to collect data for a long period of time. Therefore, the app I want to create needs to continue scanning for BLE even when it goes into the background. The purpose is to continue to obtain data from the same device at precise time intervals for a long period of time (24 hours). In that case, can I use the above function to continue to read and record advertising data from the same device periodically (at intervals of 10 seconds, 1 minute, or 5 minutes) after the app goes into the background? Any advice, no matter how small, is welcome. Please feel free to reply. Also, if you have the same question in this forum and it has already been answered, I would appreciate it if you could let me know.
3
0
148
Apr ’25
About the specifications of scan response acquisition in the background state
As a result, I judged this phenomenon to be an iOS bug. In a technical article by some knowledgeable people, CoreBluetooth said that when it goes into the background, it goes into passive scanning instead of active scanning. So I actually checked. First, send the advertised data on the BLE module board. Next, when the app side receives the advertised data, it skips the scan request. When the BLE module board receives a scan request, it will send a scan response. As a result, the strange thing was that the app was able to get the scan response whether it was in the foreground or the background. But it was one of confusion rather than joy. As a test, if the BLE module board side changes the data packet of the scan response while the application side is in the background state and resends it, the application side does not acquire the changed data. For some reason it returns the past scan response data acquired in the foreground. Why is the specification to return the past scan response? Or am I doing something wrong? I saw the official documentation about this, but there is no description anywhere in the iOS specification. I don't care about any information, so I would like to borrow wisdom from all the experts. thank you.
1
0
569
Jun ’23