Advertisement

AI7688H User Manual
V.1 160407
An IOT Solution Company
-1-
Copyright@2016 AcSiP

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the Acsip AI7688H and is the answer not in the manual?

Questions and answers

Summary of Contents for IOT Acsip AI7688H

  • Page 1 AI7688H User Manual V.1 160407 An IOT Solution Company Copyright@2016 AcSiP...
  • Page 2 AI7688H User Manual Revision History Revision Date Author Description 160407 Kevin New Create Copyright@2016 AcSiP...
  • Page 3: Table Of Contents

    2. Start AI7688H development …………………..……...5 3. Firmware and Bootloader…………...……………..9 4. File Storage…………………………………………….……..19 5. Wi-Fi LED State…………………………………….…….….22 6. Network…………………………………………….………..24 7. AWS IoT…………………………………………….….…….…40 8. Peripheral………………………………………….…….…...43 9. C/C++ Programming………………………….…………..51 10. Using USB Webcam………………………………………58 11. Audio Playback and Recording…………..…………59 12. Federal Communication Commission Interference Statement………………………………………………….….61...
  • Page 4: Introduction

    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, AI7688Hsupports eMMC , SD-XC and USB2.0. AI7688H can support the WiFi high quality audio via 192kbps/24bits I2S interface and VoIP application through PCM.
  • Page 5: Start Ai7688H Development

    AI7688H User Manual 2. Start AI7688H development 2.1 Get S/W # 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 because mDNS is not Windows7, you’ll need to installBonjour print service...
  • Page 6 AI7688H User Manual 2.3 Find the AI7688H AP and connect 2.4 Open http://mylinkit.local If the board already has a password and you don’t have or lost it, You have to press “Wi-Fi Reset button” for at least 20 seconds then Release. Then you can configure your password again.
  • Page 7 AI7688H User Manual 2.5 Get system Info and Upgrade F/W 2.6 Go to OpwnWrt for advanced configuration Enter your Password Copyright@2016 AcSiP...
  • Page 8 AI7688H User Manual 2.7 Access system console For OS X and Linux: # Open Terminal application # At the command prompt type # ssh root@mylinkit.local # Press return and enter the password you set previously in the Web UI For Windows: Copyright@2016 AcSiP...
  • Page 9: Firmware And Bootloader

    AI7688H User Manual 3 Firmware and Bootloader 3.1 Flash F/W from USB drive # Download lates Firmware # Unzip it and copy the unzipped 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 WiFi button # Press the MPU reset button once while holding the WiFi button # Keep holding WiFi button about 5 seconds.
  • Page 10 AI7688H User Manual 3.2 Update bootloader USB drive must be in FAT file system or the file cannot be recognized by the AI7688H development platform. # Save the bootloader file (lks7688.ldr) in the root directory of a USB drive and name it lks7688.ldr.
  • Page 11 AI7688H User Manual  Add the AI7688H feed: $ echo src-git linkit https://github.com/MediaTek-Labs/linkit-smart-7688-feed.git >> feeds.conf  Update the feed information of all available packages for building the firmware: $ ./scripts/feeds update  Install all packages: $ ./scripts/feeds install -a  Prepare the kernel configuration to inform OpenWrt that we want to build an firmware for AI7688H: $ make menuconfig Select the options as below:...
  • Page 12 AI7688H User Manual 3.4 Build Bootloader from Source The following operations are performed under a 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:  Refer to Build_F/W_Source for installing all prerequisite packages. ...
  • Page 13 AI7688H User Manual 3.5 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. Follow the original build flow to continue the setup and save the configuration for the firmware building process.
  • Page 14 AI7688H User Manual 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 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 find command to locate where it is).
  • Page 15 AI7688H User Manual 3.6 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...
  • Page 16 AI7688H User Manual There is about 1 second for you to choose from the bootloader menu. If there is no user input, the bootloader continues into Linux kernel bootup: 3: System Boot system code via Flash. ## Booting image at bc050000 ... Image Name: MIPS OpenWrt Linux-3.18.21 Image Type:...
  • Page 17 AI7688H User Manual 3.7 Change bootloader Console If you want to use another UART port as the bootloader console, you need to modify the bootloader. # Get bootloader source code # modify the file board/rt2880/serial.h * UART registers #if defined (MT7621_FPGA_BOARD) || defined (MT7621_ASIC_BOARD) || defined (MT7628_FPGA_BOARD) || defined (MT7628_ASIC_BOARD) #define RT2880_UART1 0x0C00 /* UART Lite */...
  • Page 18 AI7688H User Manual #define SERIAL_CLOCK_DIVISOR 16 #define CONFIG_BOOTDELAY /* autoboot after 5 seconds #define CONFIG_BAUDRATE 57600 #define CONFIG_SERVERIP 10.10.10.3 #define CONFIG_IPADDR 10.10.10.123 Change this: #define CONFIG_BAUDRATE 57600 to this (change the baudrate from 57600 to 115200 as an example): #define CONFIG_BAUDRATE 115200 This will then change the bootloader console baudrate from 57600 to 115200 # Now build the bootloader and upload it to the board...
  • Page 19: File Storage

    AI7688H User Manual 4 File Storage 4.1 USB Drive and SD Card When a USB drive or SD card is inserted into AI7688H, they can be accessed under /Media/SD* or /Media/USB* (The device name displayed varies depending on the number of drives you use and the number of partitions available on the USB drive or SD card).
  • Page 20 AI7688H User Manual 5. Format the SD card. ext4 file system will be used in this example: During the formatting process, it'll prompt a confirmation: Proceed anyway? (y,n). Press "y" to continue.+ 6. Duplicate current root FS and move it to the SD card: 7.
  • Page 21 AI7688H User Manual 11. Reboot the platform. Done. Check if the setup takes effect: We can use the "df -h" command to check if the root FS is mounted successfully. When the root FS is on the on-board flash, we can see rootfs only has 11MB storage space left: After mounting the root FS on the SD card, we can see the spare space of rootfs increases: In this example, a 8GB SD card is used and the rootfs now becomes 7.2GB in size.
  • Page 22: Wi-Fi Led State

    AI7688H User Manual 5 Wi-Fi LED State After powerring up or resetting the device, the Wi-Fi LED will first blink once to indicate the bootloader is in initialization process. Following the bootloader initialization, which takes about 4 seconds, the Linux kernel is loaded and starts the bootup process. When the Linux is booting up, the Wi-Fi LED will light on steadily.It takes about 30 seconds for the Linux kernel to initialize subsystems.
  • Page 23 AI7688H User Manual The Wi-Fi LED state is an important indicator for troubleshooting network configuration issues - here's a list of common errors and how to fix them. LED state Problem Fixes Press the Wi-Fi button for at least 5 After switching to Station It has failed to join seconds and release to restore the Wi-Fi...
  • Page 24: Network

    AI7688H User Manual 6 Network 6.1 Reset Wi-Fi Configuration You can reset Wi-Fi configuration back to AP mode by press and hold WiFi button for at least 5 seconds. Note that you must release the button before 20 seconds, otherwise Factory Reset will be performed instead This can be useful when you set an incorrect password to the Station mode, or when you need to re-configure Wi-Fi settings.
  • Page 25 AI7688H User Manual Notice: if you use SSH to connect to the system console of AI7688H, you'll lose the connection once the wifi command is set. Because this command will restart the Wi-Fi driver. After the Wi-Fi restarts, connect your PC to the same wireless router as AI7688H did. Then you can connect to AI7688H with mylinkit.local by SSH again.
  • Page 26 AI7688H User Manual 6.4 Setup Wireless Router -26- Copyright@2016 AcSiP...
  • Page 27 AI7688H User Manual -27- Copyright@2016 AcSiP...
  • Page 28 AI7688H User Manual 6.5 Change Wi-Fi AP SSID with USB Drive Step 1: Create lks7688.cfg file Create an ASCII text file named lks7688.cfg with following content: wifi_ssid=THE_AP_SSID wifi_key=THE_AP_PASSWORD Change THE_AP_SSID to the AP name you want, and change THE_AP_PASSWORD to the password you want.
  • Page 29 AI7688H User Manual 6.6 Copying Files To the Board # Using SCP SCP in OS X and Linux scp command line tool should be already installed and ready to use. If it is not installed, you can use package managers such as MacPorts or Homebrew to install it. To use SCP, open the Terminal and issue following command: scp ./helloworld root@mylinkit.local:/example/helloworld In the above example, a file named helloworld from the current directory is copied to the path...
  • Page 30 AI7688H User Manual To use GUI, # start WinSCP program, select SCP for file protocol, enter mylinkit.local in the host name box, root for user name and the password you set in Web UI: # Click Yes when you see a warning window about Continue connecting to an unknown server and add its host key to a cache?.+ # Locate the file you want to transfer on the left pane (your computer) and drag it to the right , as shown below:...
  • Page 31 UCI Configuration This example shares a /IoT directory. Change the shared folder path to /IoT. In AI7688H console, type the following command: # uci set samba.media.path='/IoT' Name the shared folder MySharedFolder: # uci set samba.media.name='MySharedFolder'...
  • Page 32 AI7688H User Manual Access Samba in Windows Open file explorer and type \\mylinkit.local, you should see the MySharedFolder. Open another file explorer, drag and drop your file to MySharedFolder, as shown below: Access Samba in OS X The steps to transfer files using Samba in Mac are as follows: Open Finder and in the menu click Go >...
  • Page 33 AI7688H User Manual Connect as guest: Check Finder and you’ll see MySharedFoloder. You can now transfer files in this folder. 6.7 iwpriv Commands # Access Point Scanning -> Use set SiteSurvey = 1 to enable access point scanning. Note that it takes a while to scan nearby APs.
  • Page 34 AI7688H User Manual 6.8 MAC Address Rules for MBSSID The rules of MAC address adjustment for those virtual interfaces are: Modify the 2 bit of the most significant byte in the MAC address to 1 to make it as a locally administered MAC address. Apply a MAC mask and add number for enumerating each interface.
  • Page 35 AI7688H User Manual Wi-Fi chipset) is used in the following example, but the process is similar if you’re using a different Wi-Fi dongle. Before you start to install related packages to enable the Wi-Fi dongle, it’s recommended to install a package called usbutils that provides information on the Wi-Fi dongle. To install usbutils, you need to configure the AI7688H to the Station mode first and then execute the opkg update: and opkg install usbutils commands to install the utility:...
  • Page 36 AI7688H User Manual From the available packages you’re able to identify the driver needed which is the kmod-rt2800-usb package (One that applies to RT2870 USB device). So type the opkg install kmod-rt2800-usb command to install the related driver: After the installation process is done, switch AI7688H back to the AP mode and execute the reboot command.
  • Page 37 AI7688H User Manual Next, you’ll do the network setup for the Wi-Fi dongle by applying the modifications as shown below to make AI7688H connect to an existing AP which is connected to the Internet (assuming the AP name is the_test_ap, and its encryption mode is psk2 with password 12345678): Save this file and exit, then type the wifi command to restart the Wi-Fi interfaces.
  • Page 38 AI7688H User Manual If you see the error, please type the wifi command again to re-activate the W-Fi interfaces until there is no such error and you see a messages similar to below: If you see the above message, it means the interface is activated successfully. Note that at this point, you’ve not yet connected to the the_test_ap AP for the Internet connection.
  • Page 39 AI7688H User Manual 6.10 Query IP / MAC with the Wi-Fi button With firmware v0.9.3 and above, you can use the Wi-Fi botton to query the IP / MAC address through the UART0 port. Note: the baudrate of the UART0 is 9,600. Please configure the serial monitor software correctly to see the output from this UART port.+ The behavior of this function is: when AI7688H is under AP mode, by pressing the button will output the MAC address information to the UART0 port.
  • Page 40: Aws Iot

    AI7688H User Manual 7 AWS IoT AWS IoT is a managed cloud service on AWS cloud.You can use AWS IoT Device SDK to write programs running on AI7688H connects to AWS IoT. It provides 2 different SDKs, and their compatibility with AI7688H is shown below:...
  • Page 41 2. Locate the path to the cross compilation toolchain. If you extract the OpenWrt SDK in path WRT_SDK, the toolchain is in 3. Download the AWS IoT Embedded-C SDK. There are 2 versions. In this example we download the mbedTLS from ARM version.
  • Page 42 AI7688H User Manual 8. Modify the Makefile of the sample application. Open the Makefile and find the following line in the beginning of the file: remove the line and modify it to use the cross compilation toolchain: 9. Type make to start building the sample application. It will build an executable file subscribe_publish_sample.
  • Page 43: Peripheral

    AI7688H User Manual 8 Peripheral 8.1 How to switch the Pin Mux From the hardware aspect, AI7688H board handles all the Wi-Fi communication, USB device control, SD card access and sensor connection. Related software stacks are provided for developers to access the sensors attached to the AI7688H.UPM is the repository for sensor drivers written in libmraa and it provides API bindings for Python, Node.js and C languages.
  • Page 44 AI7688H User Manual 8.2 Basic Concepts of MRAA Libmraa is a C/C++ library to interface with the peripheral on AI7688H. Libmraa is pre-installed in the system image of AI7688H and supports C++, Python and Node.js bindings. Installing MRAA: Libmraa is already installed in the system image of AI7688H, so you don't need to install it again.
  • Page 45 AI7688H User Manual Then, call pin.write(0) to set the pin state to LOW or call pin.write(1) to set the pin state to HIGH. To make the Wi-Fi LED blink periodically, set pin 44 (WLED_N) to GPIO mode and execute the following code There’s another GPIO mode which is INPUT.
  • Page 46 AI7688H User Manual Use PWM module to generate a pulse width modulated signal pattern. This is useful to control actuator peripherals such as servo motors. To use PWM, initialize it on a certain pin such as GPIO. Note that only GPIO18, GPIO19, GPIO20, GPIO21 supports PWM on AI7688H.
  • Page 47 AI7688H User Manual SPI (Serial Peripheral Interface) can also be used to control peripheral devices. AI7688H it consists of 4 pins: SPI_MOSI(P22), SPI_MISO(P23), SPI_CLK(P24), SPI_CS1(P25). It’s important to note that the SPI device is also used for communicating with the internal flash storage on the board.
  • Page 48 AI7688H User Manual 8.5 Using MRAA in node.js libmraa comes with node.js bindings - so you can use it in node.js applications. This example shows how to control the LED light with libmraa and node.js. Installing MRAA Libmraa and its Nodejs bindings are already installed in the system image of AI7688H, so you don't need to install it again.
  • Page 49 AI7688H User Manual 8.6 Controlling PWM with MRAA on AI7688H Configure PWM pin: To use PWM, initialize it on a certain pin such as GPIO. Note that only GPIO18, GPIO19, GPIO20, GPIO21 supports PWM on AI7688H. So the first step is to create a Pwm object by assigning the desired GPIO number.
  • Page 50 AI7688H User Manual Enable Output After configuration you can enable the PWM output by calling enable(true): Control a Servo You can use PWM signal to control a servo. A pulse width of 1500us means the neutral position, while usually 1000ms and 2000ms being the minimum and maximum position. So the following code resets the servo motor to neutral position: -50- Copyright@2016 AcSiP...
  • Page 51: C/C++ Programming

    AI7688H User Manual 9 C/C++ Programming 9.1 Building C/C++ Programs with OpenWrt SDK Building C/C++ binaries for AI7688H requires cross-compilation. We provide an OpenWrt SDK. Follow these steps to build an example C/C++ ipk file that can be installed with opkg command.
  • Page 52 AI7688H User Manual There should be some installation messages. After installation completes, type • helloworld and you'll see the string Hell! O' If you want to cross-compile some known program or libraries, do this in the SDK directory: 9.2 Building and Debugging with Eclipse IDE This article describes how to setup Eclipse IDE for C/C++ Developers and OpenWrt SDK to build and debug programs running on AI7688H.After proper setup, Eclipse will be able to build, upload and attach debugger to your C/C++ program that runs on AI7688H.
  • Page 53 AI7688H User Manual Step-by-step Download and setup OpenWrt SDK Enable SFTP on AI7688H First we need to prepare AI7688H to enable SFTP service. This allows Eclipse IDE to upload binaries and debug files to the board.Make sure your board is connected to the internet and you have access to the system console.
  • Page 54 AI7688H User Manual # Continue the steps in the wizard until you see the Cross GCC Command setting page as following: Fill the fields: *Cross compiler prefix: mipsel-openwrt-linux-uclibc- *Cross compiler path: OpenWrt_SDK/staging_dir/toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_uClibc-0,9. 33.2/bin, where OpenWrt_SDK is the path to your OpenWrt SDK directory. # Click Finish and the wizard will create the project.
  • Page 55 AI7688H User Manual Build the Hello World program Since the code is already generated by the wizard, we can start build directly. Choose Project > Build All from the menu. If the setup in previous steps are correct, you should see a build log similar to this: It will also generate a mips/le binary - this is the executable that we're going to debug in the next step.
  • Page 56 AI7688H User Manual Debug the Hello World program Now we'll configure the IDE to make it upload the executable file automatically and remote debug with gdb. # Make sure your computer is in the same Wi-Fi network as AI7688H. In this example we'll use the default domain name mylinkit.local.
  • Page 57 AI7688H User Manual # Change the setting Remote Absolute File Path for C/C++ Application to /tmp/HelloWorld. You may also use other path if you wan to. # Now select the Debug tab. Set the GDB Debugger path to OpenWrt_SDK/staging_dir/toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_uClibc-0.9.33.2/b in/mipsel-openwrt-linux-uclibc-gdb where OpenWrt_SDK is the path to the OpenWrt SDK.
  • Page 58: Using Usb Webcam

    AI7688H User Manual 10 Using USB Webcam By connecting a USB webcam to the USB host port on AI7688H, users can easily setup the video streaming service according to the following steps. Supported cameras AI7688H has installed Linux UVC (USB Video Class) drivers to provide USB webcam suppport. Webcams follow the UVC standard can be supported on AI7688H.
  • Page 59: Audio Playback And Recording

    AI7688H User Manual 11 Audio Playback and Recording AI7688H has an I2S interface for audio playback and recording. You'll need an audio DAC to convert I2S to analog sound data. Note: the recording function is only supported with firmware v0.9.3 and above. Audio Playback MP3 playback To play a MP3 file, use madplay:...
  • Page 60: Federal Communication Commission Interference

    AI7688H User Manual 12 Federal Communication Commission Interference Statement This device complies with Part 15 of the FCC Rules. Operation is subject to the following two conditions: (1) This device may not cause harmful interference, and (2) this device must accept any interference received, including interference that may cause undesired operation.
  • Page 61 Figure 1 below details the standard product marking for all AcSiP Corp. products. Cross reference to the applicable line number and table for a full detail of all the variables. An IoT Solution Company FCCID:2ADWC-AI7688H AI7688H. 716004. 1610.

Table of Contents