Tag Archives: OpenWrt

Installation and configuration of the Openwrt Image on Linkit 7688 and 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

OpenWrt building for Linkit 7688 and 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 openwrt-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 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.

Search for visible access points from your PC  and you should find an access point named LinkIT_Smart_7688_xxxxxx, where xxxxxx identifies the specific device.

Connect to this Access Point and access via browser at 192.168.100.1 or at mylinkit.local if you have satisfied the prerequisites

Getting started

collegamentolinkitEnter a password and access the next step

collegamentolinkit2Select OpenWrt for Advanced Configuration

collegamentolinkit3Set the password on OpenWrt

collegamentolinkit4entering it twice

collegamentolinkit5At this point, the system is configured as an Access Point. In our case, we wanted to set the Link 7688 Duo as a client of an Access Point with WPA2 security. To get this setting, if you have a visible network, go to the Network section of the main web console interface

accesso_linkit-smart_network1set the values for the Access Point and restart the system

accesso_linkit-smart_network2

If the Access Point is hidden, you should set the parameters directly in the configuration files in /etc /config.

Connect with putty to the previously connected USB TTL serial and  run the commands for Access Points with wpa2 security

 Save the settings

and activate the new configuration

Check the /etc/config/wireless file; you should see the addition of a new section, config wifi-iface ‘ap’,  to connect the board  to the access point

Now the card acts as a client and you can access it using the address released by the Access Point or by name as indicated by the documentation

Getting started

accesso_linkit-smartIn the next article, we’ll install and configure  the custom Lede firmware

Installation and configuration of Lede image on Linkit 7688 Duo

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

OpenWrt building for Linkit 7688 and 7688 Duo

After describing the general specifications of the two boards in the previous article

Linkit 7688 and 7688 Duo Development Boards

now we build the OpenWrt image from the sources. The following link describes the steps

Building the firmware from the source code

First we have to create the folder Linkit under /home/sviluppo in a shell command window in our Debian image, already used to  build OpenWrt in another article

Building OpenWrt Image

Install the prerequisites

Clone the OpenWrt repository

In the shell command window go to the openwrt folder and copy feeds.conf.default file as feeds.conf

Add the Mediatek feed for the boards

Update the feeds  for the packages

Install the packages

Configure the kernel executing

Use the following settings

  • Target System: Ralink RT288x/RT3xxx
  • Subtarget: MT7688 based boards
  • Target Profile: LinkIt7688

menuconfigSave and exit.

Run the building

At a certain point, the building generates an error for the wireless card libraries. Mediatek has not released the wireless card sources, but an sdk with compiled binaries for a kernel version  different from the one we are using in the building; the error reported is

One way to fix the problem is the following.

Go to the  /home/sviluppo/Linkit/openwrt/feeds/linkit/mtk-sdk-wifi/wifi_binary/  folder and copy the files for our kernel version

Rerun the building. At the end of the process the generated file is available in the  bin/ramips folder

linkit imageThe built firmware is available here

OpenWrt Linkit 7688 and 7688 Duo Image

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 flah drive, you need to rename the openwrt-ramips-mt7688-LinkIt7688-squashfs-sysupgrade.bin file in lks7688.img.

The image kernel for this building  is  3.18_45; If you want to use a recent kernel, you must use the opensource drivers available for the board; in the case of the Linkit 7688 Duo card, in our possession, we can rebuild the image using the Realtek rt76 drivers for the wireless network adapter and add the additional components for the Atmel MCU using LEDE, an OpenWrt fork

LEDE Project

In the next article you will build  a LEDE image for the Linkit 7688 Duo board. For the Linkit 7688 board at this time, the mraa libraries, used to interface the periphals, are not yet compatible with the latest version of LEDE and the functionality of the image is limited. There may be also bugs in the  wireless card opensource drivers, which hopefully are solved in the refinement of these drivers.

 LEDE building for Linkit 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

Linkit 7688 and 7688 Duo Development Boards

This article briefly describes the Mediatek Linkit 7688 and 7688 Duo development boards. Below the links for the two boards

Linkit 7688

7688Linkit 7688 Duo

7688duo

The  specifications of the two boards are the following

Linkit 7688

ModelLinkit Smart 7688
MPUMT7688AN, MIPS24KEc, 580MHz
RAM128 Mb DDR2
Flash memory32 Mb
GPIO22 (MT7688AN) 3,3 V
PWM4 (MT7688AN) 3,3 V
Expernal Interrupts22 (MT7688AN)
SPI1 (MT7688AN)
UART Lite3 (MT7688AN)
PowerMicro USB 5V DC or PIN 3,3 V
USB HOSTMicro USB
EthernetBy extension
Wifi1T1R 802.11 b/g/n (2.4G)
User storareMicro SDSDXC sdcard
Dimensions55.7 x 26 mm
Weight39 grams

Linkit 7688 Duo

ModelLinkit Smart 7688 Duo
MPUMT7688AN, MIPS24KEc, 580MHz
MCUAtmel AVR 8MHz
RAM128 Mb DDR2
Flash memory32 Mb
GPIO3 (MT7688AN) 3,3 V
24 (ATmega32U4)
PWM8 (ATmega32U4) 3,3 V
External Interrupts8 (ATmega32U4)
SPI1 (ATmega32U4)
UART Lite1 (ATmega32U4)
1 (MT7688AN)
PowerMicro USB 5V DC or PIN 3,3 V
USB HOSTMicro USB
EthernetBy extension
Wifi1T1R 802.11 b/g/n (2.4G)
User storageMicro SDSDXC sdcard
Dimensions55.7 x 26 mm
Weight39 grams

The two boards share the same Microprocessor (MPU MT7688AN), but in the case of the Linkit 7688 Duo this MPU  is supported by the Atmel Microcontroller (MCU ATmega32U4) for device management.

The interfacing schemes are shown with peripherals in the two cases below

linkit_smart_7688lintit_smart_7688-duo

The operating system used for both bords is OpenWrt, but the peripherals management is different. While in the case of Linkit 7688 we only rely on MPUs and specific libraries to manage the interfacing with peripherals, for the Linkit 7688 Duo the ATmega32U4 microcontroller manages the peripherals. The programming  of the ATmega32U4 is executed with the Arduino IDE by adding the Linkit 7688 Duo board support into the tool as specified at the following link

Arduino Ide support for Linkit 7688 Duo

At the followning  link there is the Mediatek documentation for the two boards

Linkit 7688 and 7688 Duo Resources

The following pages  show how the two boards can interact with the various peripherals

Linkit 7688 peripherals

Linkit 7688 Duo peripherals

At the Mediatek site, there are also examples to follow step by step to test the various features of the development boards.

The next article shows how to connect the USB OTG cable , to use with a USB drive, an USB TTL serial cable,  to monitor the device,  to the board

 Linkit 7688 Duo Connections

Building openwrt package

In the previous article

Building OpenWrt firmware

we described how to build the OpenWrt for the TP-Link TL-MR3420 V1 router. Now we show how to build a package, vsftpd, and install it using the shell command window

As for the firmware building execute

and access the section for this package, i.e.  Network->File Transfer, and enable it as moduleOpenWrtModulovsftpdSave the settings  in the .config file and execute

At the end of the task the package is available in the packages folder under the router platformOpenWrtModulovsftpdCompilatoTransfer the file on the router as root using scp (WinScp on windows) into the folder /tmp. In this case don’t update the packages repository using the web interface (if done reboot the device); log on to the router  using ssh as root and execute the command

OpenWrt offers many packages that allow you to greatly enhance the functionality of the device, but some packages require more resources, so you can install them on routers with more powerful hardware.

Building OpenWrt firmware

After the brief description of OpenWrt system in the previous article

OpenWrt

we describe now how to build the firmware for our router.

We use as tartget device the TP-Link TL-MR3420 router version 1.

This model is in the list of the supported OpenWrt devices; here is the specific documentation for this device

TP-Link TL-MR3420

From the documentation we know that the SOC is an Atheros AR7241. This information will be used in the configruation phase of the buildin envinronment.  As a preliminary operation also download the original firmware of this router from the link

Original Firmware

In the page TP-Link TL-MR3420 we find the links to two differents versions of the OpenWrt firmware:

  • Firmware used to install OpenWrt: openwrt-15.05.1-ar71xx-generic-tl-mr3420-v1-squashfs-factory.bin.
  • Firmware used to update OpenWrt: openwrt-15.05.1-ar71xx-generic-tl-mr3420-v1-squashfs-sysupgrade.bin

If we have the original firmware in our device we must utilize the first one, while in the case of updates we use the second one..

We now execute the operation described in the link

OpenWrt Building

in the Debian envinronment installed in previous article

Debian Envinronment

In a shell command window we install the prerequisites as non root user (sviluppo in our case)

We create a folder OpenWrt under the home user folder (sviluppo in our case) and clone the repository. In this build we choose the stable branch 15.05

At the end of the git task, execute

We are now ready to build the firmware of the TP-Link TL-MR3420 V1.

Execute the command

and we choose as target Target System AR7xxx/AR9xxx as described in the following screenshotsOpenWrtmenuconfigWith the following choices we change the options

  • y: we buil it.
  • m: we build it as module.
  • n: we skip it.

At the following link

OpenWrt Building

we find all the documentation about the building.

In the Target System with enter we can choose our Target PlatformOpenWrtmenuconfigAtherosWe have to install the base packages to admin the system, so we access LuCI OptionOpenWrtmenuconfigLucithen CollectionsOpenWrtmenuconfigLuciCollectionsand at the end the luci package; with this option the system installs an http server tooOpenWrtmenuconfigLuciCollectionsBaseWe choose as modules some cryptographics packages in the kernel modules sectionsOpenWrtmenuconfigKernelModulesthen Cryptographic Api modulesOpenWrtmenuconfigKernelModulesCryptoApiand at the end the following modules merged into the firmware fileOpenWrtmenuconfigKernelModulesCryptoApioptionsYou should save the configuration in a file in order to use it again later. Finally save the configuration in the .config file.

We can now exit the menuconfig and execute the following command in the shell command window

This task checks for the prerequisites.

To build the firmware we execute

in verbose mode.

At the end of the task we can find the firmware in the atheros platform under the bin folder. In our case our images are highlighted in the following screenshotOpenWrtFirmwareWe can now flash the firmware.

WARNING: Before installing the firmware verify the recovery process of your router in the event of a problem, i.e how to start in recovery mode, flash via tftp, use JTAG, etc. 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.

The OpenWrt web site describes all the vaious options to build the firmware and packages. In the next article

Building OpenWrt package

we’ll describe how to build and install from a shell window command the vsftpd package.

OpenWrt firmware

In this article we describe briefly OpenWrt

OpenWrt

As stated in the above link OpenWrt is a linux distribution for wireless devices. It is available for different routers as listed in the following page

OpenWrt Supported Devices

The firmware is an open source one, it is modular with the possibility to use various packages.

At the following link we find the documentation about packages and the opkg command

Packages

After the OpenWrt firmware installation we can login using the ssh protocol in a unix shell command and check the installed packages, installable package and so on.

The command

shows the available packages for the device.

This command works if the list of the repositories is available in the opkg.conf file,

OpenWrt packages repositories

but the same operation is available trhrough the web interface

First we log on to the router with a browserOpenWrtLoginWe access to the Software sectionOpenWrtSoftwarepngWe press the Update lists buttonOpenWrtSoftwareUpdateListThe list is loadedOpenWrtSoftwareListNow we search for a package, for example vsftpdOpenWrtSoftwareUpdateListAfter the search we can proceed to the installationOpenWrtSoftwareInstallvsftpdWe can find it among the installed packagesOpenWrtSoftwarevsftpdInstallatoIn future articles we will describe how to build the image for your router along with an additional package

Building OpenWrt firmware