mangOH Green sample apps & tutorials



Over the course of the next few weeks you will be seeing a series of sample apps and tutorials from our side.
The overall process will looks something like this:

a. Github code release for a topic. This will allow intermediate/advanced users to know how to code for a certain topic
b. Tutorial to follow within the next 3-4 weeks.This will give more fundamental understanding of what was done

As a starting point, we will focus on the hardware interfaces on the mangOH Green platform. Here is a list of interfaces (in order) that will be looked at through sample apps releases that are coming shortly
b. ADC
c. I2C
d. Audio (voice call)
f. SPI

If you think you need more understanding on topics that we might be missing, please list them here. We will add them to the queue.


Sample to send /receive serial data from RS232 and send it to 3G

Hello Ashish,

Is there a timeline for either a UART tutorial/demo or a UART API for the C Runtime Library.



Currently working on gps,low power, SMS and spi tutorial.
Will be doing uart tutorial after that. Will have that for sure before the end of the year if not earlier



It would be great if you provide sample showing basic TCP/ UDP connections to remote servers

Also samples showing how to save “File” on Flash,



I found that UDP/ TCP connections can be made easily using standard Linux C sockets. Legato supports all the usual libraries and headers like inet.h and tcp.h.

Save file to flash can mean different things - save to external flash memory ? Then it’s just writing to a USB port, again using sockets.



Thanks for your answer,

Regarding Flash I would like some example to write in the internal Flash memory of WP85



If you want to save values and strings, like to save parameters and settings, use the config tree, try the example in the legato documents:

the config tree is flash memory. But you can’t use it to write files. Use the directory and file interface to create and save files. They persist after power cycling so they must be stored in flash memory too.



you can use legato atomic api for writing to flash.

Most of the documentation available on following page:

If you need some code sample, you may look at unit test(I know it is not quite standard, but you may get some idea from there) which is located :




Can you send me a laundary list of sample apps that you would like to see? We will look at sorting out the requests and provide them as we work through them.



A sample app to configure apn, serial port and gpio’s over a http server and av interface



that atomic file api, le_atomFile.h, does’t exist in my legato framework (16.7.0) - neither in the Linux version or the windows version.

Is it supposed to be missing ?


Hello @asyal,

A UART demo would be great, if possible with using the MUX control as well.



This git command shows the tags that come after le_atomFile.h was introduced.

for r in $(git rev-list $(git log --follow --diff-filter=A --find-renames=40% --pretty='%H' framework/c/inc/le_atomFile.h)..); do git tag -l --points-at=$r; done

If you run this, you will see that le_atomFile.h was not introduced until Legato 16.10.


Hi Ashish,

How about a tutorial for setting up and using an SD card on mangOH?

I’ve run the command mux 9, rebooted, can see /dev/mmcblk0 and /dev/mmcblk0p1, but where to from here? Do we write directly to one of those /dev/? Do we need to mount first? If so, which commands do we use, etc.




We will start working on this on an ongoing basis.



Hello Asyal

When the new examples will be available inside developper Studio?

Regardin UDP/ TCP connections have to be used with the standard Linux C sockets as Happytunna told us. Legato supports all the usual libraries and headers like inet.h and tcp.h.
So Legato platform is not going to provide a IP library similar to the one provided with the OPEN AT platform. Is this rigth? Wll there not e API´s for TCP/UDP connections?





There are currently no plans within the mangOH team to implement TCP or UDP APIs. If you feel like this is something that would add value, then I would suggest making a feature request within the Legato forum.


Hi Ashish,
Where can I find these tutorials?
Thank you,