You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mynewt.apache.org by Pritish Gandhi <pr...@aylanetworks.com> on 2017/03/07 23:15:49 UTC

MyNewt: NimBLE: Question regarding large file transfer over Bluetooth

Hi All,
Disclaimer: I don't know much about Bluetooth so I might sound like a novice

I've been thinking about writing an application to transfer an OTA image
over Bluetooth and am wondering what would be the best way to go about it.
I was looking at the generic Object Transfer Services in the Bluetooth Spec:
https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.service.object_transfer.xml

And it seems to suggest that this service uses a separate L2CAP connection.
I wonder whether NimBLE supports this or any other file transfer protocol
over Bluetooth.
Has anyone tried this or some other means of doing an OTA over Bluetooth?
Thanks in advance for the replies,
Pritish

Re: MyNewt: NimBLE: Question regarding large file transfer over Bluetooth

Posted by Pritish Gandhi <pr...@aylanetworks.com>.
That's a lot for your answers Amit, Chris, and Łukasz. I'll investigate your proposed solutions further and get back to you if I have any more questions.
Really appreciate all the help.
-Pritish

> On Mar 8, 2017, at 6:47 AM, Łukasz Rymanowski <lu...@codecoup.pl> wrote:
> 
> Łukasz

Re: MyNewt: NimBLE: Question regarding large file transfer over Bluetooth

Posted by Łukasz Rymanowski <lu...@codecoup.pl>.
Hi Pritish,

On 8 March 2017 at 04:05, Christopher Collins <ch...@runtime.io> wrote:

> Hi Pritish,
>
> On Tue, Mar 07, 2017 at 03:15:49PM -0800, Pritish Gandhi wrote:
> > Hi All,
> > Disclaimer: I don't know much about Bluetooth so I might sound like a
> novice
> >
> > I've been thinking about writing an application to transfer an OTA image
> > over Bluetooth and am wondering what would be the best way to go about
> it.
> > I was looking at the generic Object Transfer Services in the Bluetooth
> Spec:
> > https://www.bluetooth.com/specifications/gatt/viewer?
> attributeXmlFile=org.bluetooth.service.object_transfer.xml
> >
>

I think that using Object Transfer Service for OTA is a overkill. IMHO you
need custom profile
using L2CAP LE CoC which are already in place as Chris mentioned.

Not sure what device you want to use for sending new image. For now Android
and iPhone
does not support L2CAP LE CoC.

> And it seems to suggest that this service uses a separate L2CAP
> connection.
> > I wonder whether NimBLE supports this or any other file transfer protocol
> > over Bluetooth.
> > Has anyone tried this or some other means of doing an OTA over Bluetooth?
>
> I'm not familiar with the object transfer service, but it looks like it
> would work pretty well for this.  Łukasz has added support for
> connection oriented channels to nimble, so I think the required
> functionality is all there.  This service looks rather complicated,
> though, so there may be a fair amount of work involved in implementing
> it.
>
> Alternatively, Mynewt already supports file transfer using the newtmgr
> protocol (NMP).  NMP is a simple request-response protocol described in
> more detail here:
> http://mynewt.apache.org/latest/os/modules/devmgmt/newtmgr/
>
>
I'm not familiar with newtmgt yet, but if that uses BlueZ for Linux, it
probably could make use of
L2CAP LE CoC to speed up OTA.

This works today, but it is not particularly well suited to large data
> transfers over BLE.  The need to wait for a response to each file chunk
> prevents the kind of throughput that a BLE link can support.
>
> Chris
>


BR
Łukasz

Re: MyNewt: NimBLE: Question regarding large file transfer over Bluetooth

Posted by Christopher Collins <ch...@runtime.io>.
Hi Pritish,

On Tue, Mar 07, 2017 at 03:15:49PM -0800, Pritish Gandhi wrote:
> Hi All,
> Disclaimer: I don't know much about Bluetooth so I might sound like a novice
> 
> I've been thinking about writing an application to transfer an OTA image
> over Bluetooth and am wondering what would be the best way to go about it.
> I was looking at the generic Object Transfer Services in the Bluetooth Spec:
> https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.service.object_transfer.xml
> 
> And it seems to suggest that this service uses a separate L2CAP connection.
> I wonder whether NimBLE supports this or any other file transfer protocol
> over Bluetooth.
> Has anyone tried this or some other means of doing an OTA over Bluetooth?

I'm not familiar with the object transfer service, but it looks like it
would work pretty well for this.  \u0141ukasz has added support for
connection oriented channels to nimble, so I think the required
functionality is all there.  This service looks rather complicated,
though, so there may be a fair amount of work involved in implementing
it.

Alternatively, Mynewt already supports file transfer using the newtmgr
protocol (NMP).  NMP is a simple request-response protocol described in
more detail here:
http://mynewt.apache.org/latest/os/modules/devmgmt/newtmgr/

This works today, but it is not particularly well suited to large data
transfers over BLE.  The need to wait for a response to each file chunk
prevents the kind of throughput that a BLE link can support.

Chris

Re: MyNewt: NimBLE: Question regarding large file transfer over Bluetooth

Posted by amit mehta <gm...@gmail.com>.
On Wed, Mar 8, 2017 at 12:15 AM, Pritish Gandhi
<pr...@aylanetworks.com> wrote:
> Hi All,
> Disclaimer: I don't know much about Bluetooth so I might sound like a novice
>
> I've been thinking about writing an application to transfer an OTA image
> over Bluetooth and am wondering what would be the best way to go about it.
> I was looking at the generic Object Transfer Services in the Bluetooth Spec:
> https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.service.object_transfer.xml
>
> And it seems to suggest that this service uses a separate L2CAP connection.
> I wonder whether NimBLE supports this or any other file transfer protocol
> over Bluetooth.
> Has anyone tried this or some other means of doing an OTA over Bluetooth?
> Thanks in advance for the replies,
> Pritish

In past, I spent considerable time on BLE OTA on nRF51 based custom
board. Good news was that Nordic provides the bootloader (source code
available) for the peripheral (which you may have to modify a bit to suit
your needs) and central side android application (nRF Connect, source
code NOT available). The BLE OTA design is explained in depth on Nordic's
infocenter [1], perhaps it can be still useful to you.

[1] http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v11.0.0%2Fexamples_ble_dfu.html

Thanks,
Amit

-- 
Sent from Bahamas, while drinking chi-chi and piña colada.