AcSiP AI7688H User manual

Document Name AI7688H
Reference Manual
Version V 2.0
Date 2019/08/08
Document Name AI7688H
Reference Manual
Version V 2.0
Date 2019/08/08

Document Name AI7688H
Reference Manual
Version V 2.0
Date 2019/08/08
Document History
Revision
Date
Author
Description
V.1.0
160407
PW
New Create
V.2.0
190808
Ken
Update Image

Document Name AI7688H
Reference Manual
Version V 2.0
Date 2019/08/08
Index
1Introduction
2Start AI7688H development
2.1 Software setup
2.2 Power up AI7688H board
2.3 Find the AI7688H AP and connect
2.4 System Information and Upgrade Firmware
2.5 OpenWrt for advanced configuration
2.6 Access system console
3Firmware and Bootloader
3.1 Update Firmware with USB drive
3.2 Update bootloader with USB drive
3.3 Factory reset
3.4 Build Firmware from Source
3.5 Build Bootloader from Source
3.6 Rebuild Existing Kernel Packages
3.7 Bootloader and Kernel Console
3.8 Change bootloader console
3.9 Change Kernel Console
4File Storage
4.1 USB Drive and SD Card
4.2 How to mount the SD card
5Wi-Fi LED State
6Network
6.1 Reset Wi-Fi Configuration
6.2 Switch to Station mode
6.3 Switch to AP mode
6.4 Setup Wireless Router
6.5 Change Wi-Fi AP SSID with USB Drive
7Copying Files To the Board
7.1 Using SCP
7.2 Using Samba

Document Name AI7688H
Reference Manual
Version V 2.0
Date 2019/08/08
8iwpriv Commands
9AWS IoT
10 Peripheral
10.1 How to switch the Pin Mux
10.2 Basic Concepts of MRAA
10.3 Using MRAA in Python
10.4 Using UPM in Python
10.5 Using MRAA in node.js
10.6 Controlling PWM with MRAA on AI7688H
11 C/C++ Programming
11.1 Building C/C++ Programs with OpenWrt SDK
12 Using webcam and audio
12.1 Supported cameras
12.2 Audio Playback and Recording

-1-
Document Name AI7688H
Reference Manual
Version V 2.0
Date 2019/08/08
1Introduction
AI7688H integrates a 1T1R 802.11n Wi-Fi radio, a 575/580 MHz MIPSR 24KEcTM CPU,
1-port Fast Ethernet PHY, USB2.0 host, PCIe, SD-XC, I2S/PCM and 3 UARTs. AI7688H
provides two operation modes –IoT gateway mode and IoT device mode. In IoT
gateway Mode, the PCIe Express interface can connect to 802.11ac chipset for 11ac
dual-band concurrent gateway. The high performance USB 2.0 allows AI7688H to add
3G/LTE modem support or add a H.264 ISP for wireless IP camera. For the IoT device
mode, AI7688H supports SD-XC and USB2.0. AI7688H can support the I2S interface at
192kbps@24bits. In IoT device mode, it further supports PWM, SPI slave, 3rd UART
and more GPIOs.
EVK Pinout

-2-
Document Name AI7688H
Reference Manual
Version V 2.0
Date 2019/08/08

-3-
Document Name AI7688H
Reference Manual
Version V 2.0
Date 2019/08/08
2Start AI7688H development
2.1 Software setup
Download an SSH client (Windows only)
PuTTY provides Secure Socket Shell (SSH) access to the development
board operating system.
Install Bonjour Print Service (For Windows 7 only)
The AI7688H development board uses mylinkit.local as its local domain. In
Windows7, you’ll need to install Bonjour print service for mDNS.
This helps your computer discover the EK-AI7688H’s IP address with the
local domain name. For Windows 8 and later, Mac OS X and Linux, mDNS
is supported and you can use mylinkit.local.
PuTTY for Microsoft Windows.
PuTTY provides you with the system console environment using Secure
Socket Shell (SSH) access to the development board’s operating system.
WinSCP for windows
WinSCP provides you with the file transfer support under SSH protocol. You
can transfer file into AI7688H board.

-4-
Document Name AI7688H
Reference Manual
Version V 2.0
Date 2019/08/08
2.2 Power up AI7688H board
After boot up and Wi-Fi initialization completes, which takes about
30 seconds, the Wi-Fi LED goes off.
This means the system is ready to accept Wi-Fi connection –now
we can connect to it. Following Figure shows how the Wi-Fi LED
status matches the system state.

-5-
Document Name AI7688H
Reference Manual
Version V 2.0
Date 2019/08/08
2.3 Find the AI7688H AP and connect
Open browser http://mylinkit.local or http://192.168.100.1
If the board already has a password, you can press “Wi-Fi Reset button”for
at least 20 seconds then Release. Then you can configure your password
again.

-7-
Document Name AI7688H
Reference Manual
Version V 2.0
Date 2019/08/08
2.5 OpenWrt for advanced configuration
Enter your Password
OpenWrt Function

-8-
Document Name AI7688H
Reference Manual
Version V 2.0
Date 2019/08/08
2.6 Access system console
For OS X and Linux:
Open Terminal application
At the command prompt type
ssh [email protected]
Press return and enter the password you set previously in the Web UI
For Windows:
Open PuTTY

-9-
Document Name AI7688H
Reference Manual
Version V 2.0
Date 2019/08/08
3Firmware and Bootloader
3.1 Update Firmware with USB drive
copy lks7688.img file to the root directory of a FAT32 USB Drive
Attach the USB drive to the HOST port of the board with an OTG cable.
Hold the Wi-Fi button
Press the MPU Reset button once while holding the Wi-Fi button
Keep holding Wi-Fi button about 5 seconds.
Release Wi-Fi button until the Wi-Fi orange LED becomes OFF.
Do not press the Wi-Fi button for more than 20 seconds or it will upgrade the
bootloader. Wait while the Wi-Fi LED blinks fast. This takes about 3
minutes.
The device will automatically reboot after firmware update completed.

-10-
Document Name AI7688H
Reference Manual
Version V 2.0
Date 2019/08/08
3.2 Update bootloader with USB drive
USB drive must be in FAT file system or the file system cannot be
recognized by the AI7688H development platform.
Download bootloader image file, Please refer to ”09_Firmware”.
Save the bootloader file (uboot_<version>.bin) in the root directory of
a USB drive and rename it “lks7688.ldr”.
Plug the USB drive to AI7688H.
Press the Wi-Fi and MPU (Reset) button at the same time, then release
the MPU Reset button but hold the Wi-Fi button for at least 20
seconds.
After 20 seconds Wi-Fi LED will turn on. Release Wi-Fi button.
The board will start to read the bootloader (Wi-Fi LED blinks fast) and
perform the bootloader upgrade process (Wi-Fi LED blinks slowly). It
takes about 2 seconds to finish the bootloader upgrade process.
If bootloader is missing or damaged, it is no way to recovery by TFTP,
UART, or USB.

-11-
Document Name AI7688H
Reference Manual
Version V 2.0
Date 2019/08/08
3.3 Factory reset
You can reset the firmware to its original state with a factory reset.
WARNING
Performing a factory reset erases all data and system changes you've made
to the firmware, such as root password, Wi-Fi configuration and opkg
installation.
Using the Web UI
Login to WebUI, under Factory reset, click RESET.
Using the Wi-Fi reset button
Boot up the board and wait for the Wi-Fi LED to go off.
Press and hold the Wi-Fi button for at least 20 seconds then release.
The Wi-Fi LED will blink fast for 1 second, and then reboot to perform
factory reset.

-12-
Document Name AI7688H
Reference Manual
Version V 2.0
Date 2019/08/08
3.4 Build Firmware from Source
The following operations are performed under a Ubuntu LTS 14.04.3
environment and 60 GB free disk space. For a Windows or a Mac OS X
host computer, you can install a VM for having the same environment:
Download to user’s home directory
“10_SDK\10_2_OpenWRT_SDK\
AI7688H_OpenWRT_Build_FW_Setting_Tool_V1.0.tar.gz”.
tar xvfz AI7688H_OpenWRT_Build_FW_Setting_Tool_V1.0.tar.gz
(to extract file)
cd AI7688H_OpenWRT_Build_FW_Setting_Tool_V1.0
(change to the folder.)
cat Readme.txt
( install additional package to build code. )
make download
(download code from internet)
make menuconfig
Save and exit (use default configuration filename without
change it)
Start the compilation process:
make -j1 V=s
After the build process completes, the resulted firmware file will
be under
bin/ramips/openwrt-ramips-7688-LinkIt7688-squashfs-sysupgrade.bin.
Depending on the H/W resources of the host environment, the build
process may take more than 2 hours.
You can use this file to do the firmware upgrade through the
Web UI or rename it to lks7688.img for upgrading through a USB drive
3.5 Build Bootloader from Source

-13-
Document Name AI7688H
Reference Manual
Version V 2.0
Date 2019/08/08
The following operations are performed under an Ubuntu LTS 14.04.3
environment. For a Windows or a Mac OS X host computer, you can install a VM
for having the same environment:
Download the bootloader source codes:
git clone https://github.com/AcSiP/linkit-smart-7688-uboot.git
Change to the source folder:
cd linkit-smart-7688-uboot
Install the toolchain (install to path /opt) for building the bootloader:
sudo tar xjf buildroot-gcc342.tar.bz2 -C /opt/
Since the toolchain is provided in 32-bit executables, you need to install
additional packages for execution on a 64-bit machine:
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386
Start the compilation process:
make
Bootloader filename is uboot.bin.
You can rename it to “lks7688.ldr”for upgrading the system bootloader
through a USB drive.

-14-
Document Name AI7688H
Reference Manual
Version V 2.0
Date 2019/08/08
3.6 Rebuild Existing Kernel Packages
In the config menu, select the Kernel modules.
Go to Filesystems and select the kmod-fs-ext4 as M(modularizes features).
Note: other kernel packages which kmod-fs-ext4 depends on will also be
selected automatically.

-15-
Document Name AI7688H
Reference Manual
Version V 2.0
Date 2019/08/08
Follow the original build flow to continue the setup and save the
configuration for the firmware building process.
After the building process is complete, you can find the kernel packages
under bin/ramips/packages/base/ (if the package you built is not there, you
can also use find command to locate where it is)
After the building process is complete, you can find the kernel packages
under bin/ramips/packages/base/ (if the package you built is not there, you
can also use find command to locate where it is).
Copy all related kernel module packages to a USB drive.
Plug the USB drive to AI7688H and perform the opkg install command to
install all necessary kernel packages from the USB drive.
root@mylinkit:/tmp/run/mountd/sda1# opkg install kmod*.ipk
Installing kmod-crypto-core (3.18.23-1) to root...
Installing kmod-crypto-hash (3.18.23-1) to root...
Installing kmod-fs-ext4 (3.18.23-1) to root...
Installing kmod-lib-crc16 (3.18.23-1) to root..
Package kmod-lib-crc16 (3.18.23-1) installed in root is up to date.
Configuring kmod-crypto-core.
Configuring kmod-crypto-hash.
Configuring kmod-lib-crc16.
Configuring kmod-fs-ext4.
Note: if you simply install the kmod-fs-ext4, an error will occur like below.
root@mylinkit:/tmp/run/mountd/sda1# opkg install
kmod-fs-ext4_3.18.23-1_ramips_24kec.ipk
Installing kmod-fs-ext4 (3.18.23-1) to root...
Collected errors:
* satisfy_dependencies_for: Cannot satisfy the following dependencies for
kmod-fs-ext4:
* kmod-lib-crc16 * kmod-crypto-hash *
* opkg_install_cmd: Cannot install package kmod-fs-ext4.
From these information, we can know what additional kernel packages are
also needed for kmod-fs-ext4 under bin/ramips/packages/base/

-16-
Document Name AI7688H
Reference Manual
Version V 2.0
Date 2019/08/08
3.7 Bootloader and Kernel Console
The Bootloader console and Linux kernel console are configured to serial port
UART2(UART_TXD2 and UART_RXD2) at baudrate 57600
[04060C0F][04060C0C]
DDR Calibration DQS reg = 0000898A
U-Boot 1.1.3 (Sep 10 2015 - 05:56:31)
Board: Ralink APSoC DRAM: 128 MB
relocate_code Pointer at: 87f68000
flash manufacture id: c2, device id 20 19
find flash: MX25L25635E
*** Warning - bad CRC, using default environment
============================================
Ralink UBoot Version: 4.3.0.0
--------------------------------------------
ASIC 7628_MP (Port5<->None)
DRAM component: 1024 Mbits DDR, width 16
DRAM bus: 16 bit
Total memory: 128 MBytes
Flash component: SPI Flash
Date:Sep 10 2015 Time:05:56:31
============================================
icache: sets:512, ways:4, linesz:32 ,total:65536
dcache: sets:256, ways:4, linesz:32 ,total:32768
##### The CPU freq = 580 MHZ ####
estimate memory size =128 Mbytes
RESET MT7628 PHY!!!!!!
GPIOMODE --> 50054404
GPIOMODE2 --> 5540551
Please choose the operation:
1: Load system code to SDRAM via TFTP.
2: Load system code then write to Flash via TFTP.
3: Boot system code via Flash (default).
4: Entr boot command line interface.
7: Load Boot Loader code then write to Flash via Serial.
9: Load Boot Loader code then write to Flash via TFTP.
This manual suits for next models
1
Table of contents
Other AcSiP GSM/GPRS Module manuals