OTA Application Update via Bluetooth

Hello,

for one of our setups, we would like to update our application image via a local Bluetooth OTA Update mechanism because we will have a Bluetooth connection and no Internet connection. Is it possible to do such manual updates from within the application? Any experiences or best practices here?

Thanks a lot and best regards,
Flo

Hello @getty23 Thank you for your message! welcome to the balena forums!

Could you tell me more details about your needs? e.g. how are you going to download the latest release? There is a device with Internet connectivity and the others are connected to this on a star topology?

I would like to understand your use case and think on a solution for you.

Hi @mpous , thanks for your quick feedback.
We plan to have an IoT device which is connected via Bluetooth to a mobile. Because the IoT device itself does not yet have an Internet connectivity (planned for later) we are not able to run updates the “normal” way. Therefore it would be fantastic to be able to update the application via the app and Bluetooth. A bit unconvinient but similar to this approach: OTA Update Process (Bluetooth Low Energy) | Alexa Skills Kit

In this sense it would be a star topology.

Thanks for your support

Another question to have a clear idea of the scenario, what device are you going to use connected over BLE to the mobile phone?

We want to use an Raspberry Pi (probably a Zero)

Hello @getty23 thanks for giving more details. Is there any other requirement why you would not use WiFi connectivity for example?

If you would use WiFi connectivity on the Pi Zero (W) then it would work automatically with a mobile phone offering WIFi signal.

Hello @mpous it could be that the device is not within a WIFI. In such cases, we need to control it as well.
Sending an updated package via Bluetooth should be possible but how do we install it manually on a balena device (from within the device). Any idea on that?

Hey @getty23

we have experimented updating firmwares using bluetooth via a gateway device running balena, not updating balena devices from mobile phones over bluetooth.

My recommendation would be (if you don’t have energy requirements) to use WiFi on your devices, so they can get automatically connected to balenaCloud when there is WiFi / Internet. Or the second recommendation is to build a mobile application compatible with balenaCloud that could manage the bluetooth from the phone device.

Keep us updated if you use a workaround to solve this problem.

Thanks for your hints.
We will definetly continue experimenting here and I’ll keep you updated.
Though, you might be able to help me with one question: Can I trigger an update from within the device? So imagine I transfer the new image to the device, how can I install it?
Thanks

Hi

As I understand, you want to basically update the application when it’s offline. Have you taken a look at our offline updates > Is that something that could work for you?

Thanks @anujdeshpande . This goes into the right direction but what can I do if I just want to update an application (container)? What is the best approach for that?

Hi there, it’s not possible to update a single container if that’s what you are asking. An application update is considered to be a set of images being updated. That said we use delta updates, so if there are changes to a single container then the delta for the other containers will be 0 bytes.

Regarding your original question, I have shared internet connection with a device via USB tethering in the past so I’m curious if the same could be done via bluetooth, tbh I’m not sure NetworkManager can do it so I’ve asked a team member with much more knowledge to chime in, we’ll let you know what he says.

Would that work for your use case? If you could share internet via bluetooth then the device would be online and it wouldn’t be any different from it connecting via WiFi. Though again, I’m not sure this is currently possible.

Thanks for your reply. I think sharing Internet via Bluetooth is not possible for us.

Would it be possible to update the set of images for an application?

I’m sorry I’m not sure I understand what you mean, can you expand on your question?

In the meantime we do not have this as a requirement anymore.
Anyway it would be interesting to know if it iss possible to update an balena application manually without the cloud? So assume we manually transfer the container to the device. Could we install the application from within the device?

We do offer offline updates, but it involves reflashing an SD card and inserting it into the device.

You can find more info about that here, but it doesn’t sound like like that’s what you’re looking for.

I do not believe it is currently possible to update a balena device without losing data without an internet connection. But you would only need the internet connection during the update.

It would probably be possible to do this, but would involve quite a lot of work for the Balena team. If you want, feel free to open an issue on the balena supervisor repo.

Thanks a lot for your help and support :slight_smile: