iOS App v1.1.0 Available


#1

We released our iOS app at version 1.0, and we knew there was a very annoying trait to it. iOS only allows apps to work in the background in certain ways, and while BLE is one of those ways, it would still suspend our app in between BLE events. When our app is suspended, the TCP socket to the Particle cloud is closed. This essentially means that bluz will connect, and stay connected, just fine while the bluz app is held open in the foreground. However, the moment you switch apps, go to the home screen, or just lock your phone, the Particle cloud connection would timeout soon thereafter and bluz would no longer be connected. So if you have connected bluz on an iPhone, and then tried to switch to the Particle app to use Tinker, for example, and noticed your bluz stopped working by the time you got there, this is the trait you experienced.

Well, no more!

We are happy to say that v1.1 of the iOS app is in the app store, freshly approved through the process (after 9 excruciating days) just now. This does away with the previous annoying trait by asking for background modes after each BLE event. That means our app always gets extended in background mode until the next BLE event, meaning the socket never gets closed, and bluz should now stay connected indefinitely no matter what you do! (Well, ok, don’t shut off the iPhone or turn Bluetooth off, that would stop it from working :smile:)

So, why didn’t we release this feature in v1.0? Well, we were a bit concerned it wouldn’t go through the approval process. While what we are not doing isn’t illegal or anything, or even against the Apple policies, it also isn’t explicitly allowed. There are gray areas in their approval process, and this seemed to fall into that bucket. So we released v1.0 so people would have something when bluz arrived, making sure to quickly follow it up with this fix.

So please, if you have been using the iOS app and were frustrated by this behavior, you will not have to worry anymore! Enjoy v1.1

Also, there is now an option to do automatic reconnects, meaning the app will automatically reconnect to your previously connected bluz boards if they disconnect for any reason. This is a bit experimental still, but seems to work so far through our testing.


Bluz / Gateway pairing
#2

It’s working great! Now I can use the Particle app to Tinker with the BlueDK I/O :smile:

A couple things I noticed:

  • I had a blinking LED app previously flashed, so the Particle app saw BluzDK online, but not running Tinker. I tried to reflash Tinker via the app and something went to BluzDK and it reset, but when it came back online it did not register Tinker functions. Looking a little closer, I see that BluzDK is recognized as a Photon which is incorrect. I had Tinker in a Build IDE app, and flashed that. :boom: it was working as Tinker. Once it’s recognized in the app as BluzDK, it will also likely need to have a known app for Tinker associated with it. Not sure what your plans are for apps or if you’d like to use the Particle app, but I’ve discussed this with the Particle Team and we are tracking the issue internally :wink: I’d suggest pinging us about the issue directly since I can’t personally speak for mobile / cloud team priorities right now. Another way to get Tinker on BluzDK:
    particle compile bluz ~/Downloads/application.cpp --saveTo tinker-bluz.bin && particle flash <device name> tinker-bluz.bin

  • When I connect BluzDK to the Particle Cloud, I can switch apps, go to home screen and even lock my phone and it stays connected. If I flash an app OTA and BluzDK resets, I press reset or remove and restore power; BluzDK does not automatically reconnect to the Particle Cloud. It requires me to connect via the Bluz app again. Is there a firmware command I can call in setup() to reconnect to the Cloud after reboot… even if I got an alert to connect again on my phone that would be ok. It would allow me to be reminded to reconnect in the event of a disconnect, instead of having to remember.


#3

Thanks for testing!

Yes, I noticed the “flash tinker from the app” issue as well. I was debating whether or not to ping Particle since, well, it’s their app and they don’t need to support bluz in it. It would be a shame to re-make a Tinker app, though, just for bluz when everything else works except for the recognition of the board. I will ping the mobile team and see what we could do about that.

As for the reconnection, BLE is the opposite of Wifi, bluz can’t and doesn’t automatically reconnect, the gateway has to initiate a connection. We added this to the app where it will always reconnect automatically, though it is a bit experimental at the moment as I didn’t get a chance to fully test. To turn it on, go to your phones Settings menu and scroll down until you see the bluz app. There is a checkbox in the menu for Automatically Reconnect which should be turned off. Turn that on, then kill/restart the app. Now it should automatically reconnect every time bluz disconnects, including after flashing firmware.

That last part is still news so consider yourself a beta tester for that feature!


#4

It works! Tested flashing an app OTA, hard reset and removing and re-applying power. I totally forget to look for hidden settings on apps. This is great, also can’t wait to see how the gateway fairs. Thanks for a great product!