Tag Archives: LEDE

LEDE on Linkit 7688 Duo – Timecheck example

After the Python ad Firmata example

Firmata and Python

in this example we use the following programming model

duo-yun-bridge

We enable the board to work like Arduino Yun

Linkit 7688 Duo Arduino Yun

As specified in the Mediatek link, you must enable the bridge on the board; from a terminal in Lede run

At the reboot go to the Arduino Ide and choose File->Examples->Bridge->TimeCheck

timecheck_arduino-1-6-5We used the 1.6.5 Arduino Ide; we had issues whith the 1.8 version to build the sketch.

From the Arduino Ide, after the code upload, go to Tool->Serial Monitor to open the serial monitor

timecheckThe serial monitor window shows the current time.

After that, to run the other examples , disable the bridge setting with the commands

LEDE on Linkit 7688 Duo – Firmata and Python

After the python test in the previous article

LEDE on Linkit 7688 Duo – MPU-MCU Uart communication

here we describe how to do the same operation using the Firmata  python library

Firmata Protocol

In this case, the programming model is the following

duo-firmata-archAs first step,  described in the Mediatek article

Using Firmata with Python

we install the Firmata python library; in a linux terminal on LEDE run

In the Arduino IDE choose File->Examples->Firmata->StandardFirmata

arduinofirmataMake the following change in sketch code:

Look for the code

Firmata.begin(57600);
  while (!Serial) {

and replace it with

  Serial1.begin(57600);
  Firmata.begin(Serial1);
 
  while (!Serial1) {

Save the file and perform the compilation and upload on the Linkit 7688 Duo.

In a linux terminal  in Lede create the blink_with_firmata.py file and copy the following code inside

Save and quit.

Always in a linux terminal run now

The LED on the card should turn on and off.

Below is the link to download the two files  ready for the Link 7688 Duo

 Lede Python Firmata files

In the next article we’ll enable the board to work like Arduino Yun

LEDE on Linkit 7688 Duo – Timecheck example

LEDE on Linkit 7688 Duo – MPU-MCU Uart communication

After the building and installion of the LEDE firmware on the Linkit 7688 Duo card

Installation and configuration of Lede image on Linkit 7688 Duo

let’s test the functionality of some features on the card.

You can find the Mediatek article with the  programming model

Programming model

As a first example we treat the one on the Mediatek site as described in the title of the article

Linkit 7688 DUo MPU-MCU Uart Connection

which corresponds to the following programming model

duo-primitive-uart

As first step, Arduino IDE is configured as described in the link

Arduino IDE for Linkit 7688 Duo

the following code is uploaded on the Linkit 7688 Duo

This code manages  the LED by the MCU according to the commands that the MCU receives at the Serial1  port.

Logic is handled instedad by python code that runs on Linux; create a file for this purpose, such as blink.py in a linux command shell on the board, with the following code

Running the code

the LED on the card should turn on and off continuously.

In the next example we’ll use the Firmata python library to perform the same operation

 LEDE on Linkit 7688 Duo – Firmata and Python

Installation and configuration of Lede image on Linkit 7688 Duo

After you have attached to the board the support devices,  as specified in the previous article

Linkit 7688 Duo Connections

and built the image

Lede Image for Linkit 7688 Duo

we upload the image to the device.

Following the documentation availble at the link

Update the firmware with a USB drive

to update the firmware copy the lede-ramips-mt7688-LinkIt7688-squashfs-sysupgrade.bin file to the root directory of a FAT32 USB drive and rename it as lks7688.img.

Attach, now,  the USB drive to the HOST port of the board with an OTG cable and follow the steps

  1. Press and hold the on-board WiFi button.
  2. Press the MPU reset button once, while holding the WiFi button.
  3. Keep holding the WiFi button for about 5 seconds. Do not release until the orange LED for WiFi is off.  DO NOT press the WiFi button longer than 20s or it will upgrade the bootloader.
  4. The device will automatically reboot after firmware update is complete.

aggiornamento7688duo

You can control the operation via the USB TTL serial connected to the PC and activated on the enabled Com port  with the following settings

  • Port:  Enabled COM
  • Speed: 57600
  • Data Bits: 8
  • Stop Bits: 1
  • Parity: None
  • Flow Control: XON/XOFF

putty-configurationUse, for example, putty to connect, press Enter if the screen is not active,  and to check the steps the system is runnig when upgrading

aggiornamento

When the orange LED starts blinking at a lower frequency the card is ready to be used

On the Lede system, the wireless card is disabled by default, while Lan is operational, but only accessible via a Breakout board

Linkit Breakout

To enable the wireless card connect with putty (screen on Linux) to the previously connected USB TTL serial and  go to the /etc/config folder; edit the network file and add at the end the following section

Save and run

Edit the wireless file and add at the end the section

where Access Point and password indicate the Access Point name and password; the wireless security setting is wpa2.

Save and run

Enable the wireless, running

Access the Lede interface with the address assigned by the Access Point

lede-luciSet the password and access to the Lede management.

In this firmware, the leds on the board  are not synchronized with wireless operations, unlike from OpenWrt firmware with the Mediatek proprietary interface and drivers.

In the next article, we will give some examples of interfacing with the arduino IDE,  based on the tutorial on the Mediatek site using this custom Lede  image

 LEDE on Linkit 7688 Duo – MPU-MCU Uart communication

LEDE building for Linkit 7688 Duo

After OpenWrt image building using the Mediatek SDK

OpenWrt building for Linkit 7688 and 7688 Duo

this article describes how to generate a LEDE image for the Linkit 7688 Duo.

The steps on how to compile LEDE are available at the link

LEDE Building

Clone the code from the github in a shell command window,  always from the  Linkit folder

run

Create the src folder under Linkit and extract the compressed file

Feed for Linkit

This feed was created from Mediatek one, eliminating the binary drivers  dependency.

Copy the file to the src folder and uncompress it

Go to the Lede folder and copy the feeds.conf.default file  as feeds.conf

Run

Update the feeds  for the packages

Install the packages

Configure the kernel executing

Use the following settings

  • Target System: Mediatek Ralink MIPS
  • Subtarget: MT7688 based boards
  • Target Profile: Mediatek  LinkIt Smart 7688

menuconfigledeIn the Base system section enable mtk-linkit

mtk-linkitbasesystemSave and exit.

Run the building

where x is the number of cores to use in the building.

At the end of the process the generated image is available in the  bin/targets/ramips/mt7688/  folder as lede-ramips-mt7688-LinkIt7688-squashfs-sysupgrade.bin.

The built firmware is available here

Lede Image for Linkit 7688 Duo

WARNING: The image installation on the device is at your own risk. We accept no responsibility if the installation leads to  malfunction or block of the device.

If you upgrade the board using an usb key, you need to rename the lede-ramips-mt7688-LinkIt7688-squashfs-sysupgrade.bin file in lks7688.img.

This firmware may have malfunctions as it is not thoroughly tested and based on drivers under development.

In the next articles we’ll upload the images to the board and configure them

Installation and configuration of the Openwrt Image on Linkit 7688 and 7688 Duo

Linkit 7688 Duo Connections

After the board specifications summary

Linkit 7688 and 7688 Duo Development Boards

this article describes how to connect to the board the following components that will be used later:

  • Micro USB OTG to the Host port
  •  USB  TTL Serial Device
  • 5 V power supply   to the port USB Power

The following diagram shows the connections to the board

Linkit connections

The table below shows the connections between the USB  TTL Serial device and the board

USB TTL PinLinkit Pin
RXUART_TXD2
TXUART_RXD2
GNDGND

In the netxt article we will show how to build the firmware for the Linkit 7688 and Linkit 7688 Duo

OpenWrt building for Linkit 7688 and 7688 Duo