Yocto, cURL and SFTP

I am new to Linux development, and am trying to get SFTP working using cURL.
I was following some instructions under various forum posts about rebuilding Legato with updated cURL libraries with SFTP enabled.

I noticed that over the weekend, a lot of the documentation related to Yocto has disappeared.

Am I going the right way about this? Is there an easier way to get SFTP working under Legato?
And why has the documentation related to this been taken down?

Yes I am using a MangOH, but I felt this question was more appropriate here. Yes it needs to be SFTP, yes I have tried (and succeeded) using FTPS.

I have since learned that I should have been looking in: http://legato.io/legato-docs/16_10_3/
for my legato docs (because it matches my legato version).

Every version that I checked with the exception of 17.09 includes the yocto documentation: https://github.com/legatoproject/legato-docs/

As of 17.09 the Yocto documentation has moved to The Source, cf http://legato.io/legato-docs/latest/releaseNotes17090.html

The Yocto doc is now here: https://source.sierrawireless.com/resources/legato/linuxoverview/

So I got this working last week, and thought I would post a reply for the benefit of anyone else trying to get the same (or similar) working with Legato.
I did this using a Linux virtual machine.
I am using a MangOH green.

1. Download source.
The Linux source that I downloaded is located at: https://source.sierrawireless.com/resources/legato/downloads/
I downloaded the source file SWI9X15Y_07.12.09.00

2. Modify curl recipe
Browse to ./yocto/poky/meta/recipes-support/curl/curl_7.37.1.bb
Add “libssh2” option to PACKAGECONFIG.
e.g PACKAGECONFIG ??= "${@bb.utils.contains(“DISTRO_FEATURES”, “ipv6”, “ipv6”, “”, d)} gnutls zlib libssh2"
This can also be done with a .bbappend file, or by adding libssh2 to DISTRO_FEATURES.

3. Modify libssh recipe - optional
Browse to ./yocto/meta-openembedded/meta-oe/recipes-support/libssh2/
Replace libssh2_x.x.x.bb with libssh2_1.8.0.bb from here:

Also delete the libssh2 folder from the same directory (it contains patches that are no longer needed).

4. Make the build
Browse to ./yocto and run the command "make image_bin"
This could take a few hours the first time you run it, so be prepared. Every time you make a small change after this, it will only take a minute or so.
From inside my virtual machine this took about 2-3 hours.

5. Apply the update
Applying the update doesn’t work well (it failed for me) from inside the virtual machine.
Using winscp or similar, copy the file “boot-yocto_wp85.cwe” off the virtual machine and on to your windows environment.
Using Developer studio connect to the device and then go to device>Flash Firmware from external file.
Select the cwe file from earlier and apply the update.

6. Verify the update
SSH in to the device and run "curl -V"
You should see an output similar to:
"curl 7.37.1 (arm-poky-linux-gnueabi) libcurl/7.37.1 GnuTLS/3.3.5 zlib/1.2.8 libssh2/1.8.0
Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp scp sftp smtp smtps telnet tftp
Features: IPv6 NTLM NTLM_WB SSL libz TLS-SRP "
Curl now supports sftp!

To use SFTP in the Httpget sample, I needed to modify the .adef file to include the following:
/usr/lib/libssh2.so.1 /usr/lib/
/usr/lib/libssl.so.1.0.0 /usr/lib/
There may be a better way to get all this to work, I am new to developing for Linux/Legato/MangOH and this worked for me. Hopefully this can help someone in a similar situation.


Please share the libssh2_1.8.0.bb file

If you read through the previous post you will find it there.
If all you are trying to do is get sftp working then upgrading libssh2 is not important.

I should note that the above is tested and works for the WP8548, but does not work on the WP77XX.
When you try to use sftp under the WP77XX libssh2 will return an error.

Sierra wireless will also not help you out at all in any of this, so you are on your own if you want it working on one of these modules.