Friday, November 11, 2016

Getting Started with the MangOH Green and Legato 16.07 on Ubuntu 16.04.1

IMAG1544-1.jpg

The MangOH Green is a board developed by Sierra Wireless to allow for easy development with their WP modules. These modules are specifically built for mobile/cellular IoT and have both cellular and GPS radios built into the chip. The MangOH Green runs a Linux application framework called Legato. Sierra Wireless has been working hard to keep the software moving forward. This has produced a number of versions each with subtle changes, and while there is a starter's guide for Legato that document has now become partially dated. This along with the relative newness of the manGO board and unique approach there is not a lot information to be found searching online, this however has been changing. As mangOH/legato becomes more popular the online content will also become more plentiful

With first hand experience as well as great help, from both the forums and mangOH personal,  in getting my MangOH board running I have decided to document the steps I followed to get the newest virtual machine version  “mangOH Dev using Legato 16.07 on Ubuntu 16.04.1” up and running.

The first thing to mention is the password for this version of the VM has been changed from “legato” to “mangoh”. While this has not been documented this was asked on the forums and has been answered. NOTE: This is only for 16.07 but moving forward the password will either be removed altogether or remain as “mangoh”.

The overall process follows a few basic steps each of which will be further explained below. The first step is to download and install the VM from mangOH. Then the firmware on the mangOH board should be updated. In the VM the environment variables are added to the batch file, the repository is updated, legato is updated and installed on the mangOH board. Finally the timerLed demo is compiled and installed on the mangOH board and the application is started. Each of these steps are explained in better detail in the steps below. It should be noted that steps 1 - 12 should only need to be done the first time the mangOH board is used. After the first time either 11 and 12 can be used or 13 - 15 can be used to add a new application to the mangOH board. Steps 16 - 19 always needs to be done to have the Legato application started on the mangOH board.

  1. Download VM from the mangOH site
  2. Attach the mangOH board to the PC and update the firmware
    1. Download the “Generic” Windows EXE file
    2. Double click the executable (run the file with the board attached to the PC)
    3. Follow the onscreen instructions (it may take some time). If the system hangs for more than 20 minutes do a power cycle on the board and restart.
2016-11-09 17_39_39-C__Users_Kas_AppData_Local_Temp_RarSFX0_fdt.exe.png

  1. Install the VM
    1. Follow the step #4 “Prepare your computer for Legato development” in either - “mangOH Fundamentals— Windows (Linux VM) + Legato CLI
These PDFs can be found under “getting started” on at the mangOH site

In the VM
  1. Open the VM and add  “source ~/legato/packages/legato.sdk.latest/resources/configlegatoenv” to .bashrc file
    1. Open a terminal window
    2. $edit .bashrc
    3. Scroll down to the bottom of the press the “insert” key on your keyboard
    4. Add the “source…” line at the very bottom of the file (after the last “fi”)
    5. Lastly enter “:wq” this will save and exit the editor
(Note: Moving forward to to Legato 16.10 this step will no longer be needed)
2016-11-09 20_15_56-mangOH Dev using Legato 16.07 on Ubuntu 16.04.1_1-Test [Running] - Oracle VM Vir.png

  1. cd mangOH/
  2. repo sync
2016-11-09 23_33_58-mangOH Dev using Legato 16.07 on Ubuntu 16.04.1_1-Test [Running] - Oracle VM Vir.png

  1. cd legato/
  2. source ~/legato/packages/legato.sdk.latest/resources/configlegatoenv
(This step is not needed if close and then reopen the terminal)
  1. make wp85
2016-11-09 23_24_00-mangOH Dev using Legato 16.07 on Ubuntu 16.04.1_1-Test [Running] - Oracle VM Vir.png

  1. Add timerLed.adef to mangoh.sdef
    1. Open emacs
    2. file->Open file
    3. mangOH->mangOH->mangoh.sdef
    4. Under “apps:{“ add “$MANGOH_ROOT/samples/tutorials/hardwareInterfaces/gpio/timerLed.adef”
    5. Save and close emacs
2016-11-09 21_07_34-Program Manager.png



  1. instlegato wp85 192.168.2.2
2016-11-09 23_27_47-mangOH Dev using Legato 16.07 on Ubuntu 16.04.1_1-Test [Running] - Oracle VM Vir.png

  1. cd mangOh/mangOH/samples/tutorials/hardwareInterfaces/gpio/TimerLed/
  2. mkapp -t wp85 timerLed.adef
2016-11-09 23_30_20-mangOH Dev using Legato 16.07 on Ubuntu 16.04.1_1-Test [Running] - Oracle VM Vir.png

  1. app install timerLed.wp85.update 192.168.2.2
2016-11-09 23_32_00-mangOH Dev using Legato 16.07 on Ubuntu 16.04.1_1-Test [Running] - Oracle VM Vir.png

  1. ssh root@192.168.2.2
  2. app status (should see “[stopped] timerLed”)
2016-11-09 23_18_10-mangOH Dev using Legato 16.07 on Ubuntu 16.04.1_1-Test [Running] - Oracle VM Vir.png

  1. app start timerLed
2016-11-09 23_20_48-mangOH Dev using Legato 16.07 on Ubuntu 16.04.1_1-Test [Running] - Oracle VM Vir.png

  1. You should now see the LED next to SW200 and the reset switch blinking

I have tested these steps out on a new install of the VM and have not encountered any issues. If you do have any issues or or have any comments regarding the process please share them in the comments below.

I would like to mention that the constant addition of new APIs for the mangOH board have made programing the board that much easier. As someone with a background in embedded code on microcontrollers, digging into the kernel to get to the GPIOs or other ports would be a quite a feat. The mangOH team is also working to add more demos, thi would allow someone wanting to create a prototype to have numerous starting points as well as projects that they could merge to get a usable prototype for the concept they are trying to display.

As I keep working with this board I will hopefully add more blogs giving over my experience with working with the mangOH Green board.


1 comment:

  1. Hello Elie,

    I did not use Developer Studio, I had to many issues with it. I ended up using the console to do all my programing, compiling and uploading. That being said I believe a number of things have changed and been upgraded since I last messed around with the board. Due to a few issues I've had to but this board aside, I will be getting back to this as well as the MangOH Red shortly all going well.

    The best solution I can offer is to either post your question will a decent amount of detailing the MangOH forums and wait for a response (they are pretty good there). Alternatively try using my information above (steps 13 - 19) but note that the location of TimerLED has been moved so you will have to look around for it.

    I hope this helps, if not let me know and I will see what else I can do.

    Kas

    ReplyDelete