AI7688H User Manual V.
AI7688H User Manual Revision History Revision V.
AI7688H User Manual Contents: 1. Introduction…………………………………………….……..4 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.
AI7688H User Manual 1. Introduction AI7688H integrates a 1T1R 802.11n Wi-Fi radio, a 575/580 MHz MIPSR 24KEcTM CPU, 1-port fast Ethemet PHY,USB2.0 host,PCIe,SD-XC,I2S/PCM and multiple slow IOs. 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.
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 Windows7, you’ll need to installBonjour print service because mDNS is not support. This helps your computer discover the LinkIt Smart AI7688H’s IP address with the local domain name.
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.
AI7688H User Manual 2.5 Get system Info and Upgrade F/W 2.
AI7688H User Manual 2.7 Access system console For OS X and Linux: # Open Terminal application # At the command prompt type # ssh root@mylinkit.
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. Release WiFi button until the WiFi LED becomes OFF.
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. # Plug the USB drive to AI7688H. # Press the WiFi and MPU (Reset) button at the same time, then release the MPU Reset button but hold the WiFi button for at least 20 seconds. # After 20 seconds Wi-Fi LED will turn on. Release WiFi button.
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: $ .
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. Download the bootloader source codes: $ git clone https://github.com/MediaTek-Labs/linkit-smart-uboot.
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.
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 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.
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.
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: MIPS Linux Kernel Image (lzma compressed) Data Size: 1118412 Bytes = 1.1 MB Load Address: 80000000 Entry Point: 80000000 Verifying Checksum ... OK Uncompressing Kernel Image ...
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.
AI7688H User Manual #define SERIAL_CLOCK_DIVISOR 16 #define CONFIG_BOOTDELAY 1 #define CONFIG_BAUDRATE 57600 #define CONFIG_SERVERIP 10.10.10.3 #define CONFIG_IPADDR 10.10.10.123 /* autoboot after 5 seconds */ 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 # 3.
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).
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. Create a fstab template: 8. Open the fstab configuration (use vi as the editor in this example): 9.
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.
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.
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.
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. Note: if AI7688H is already in AP mode, this operation takes no effect 6.
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. You can also refer to the LED behavior to check the states of the connection in Station mode.
AI7688H User Manual 6.
AI7688H User Manual -27- Copyright@2016 AcSiP
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. Save this file to the root directory of a USB drive formatted in FAT32 file system format.
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 /example/helloworld in AI7688H.
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?.
AI7688H User Manual # After you’ve dragged the file, an Upload window will appear asking you to confirm the upload. Click OK to copy the file. Using Samba Samba is a networking tool that is built-in AI7688H and provides a file sharing service on the device for file transfer. In the example below you’ll learn how to use UCI command to share a directory and set appropriate access permission for this directory. UCI Configuration This example shares a /IoT directory. Change the shared folder path to /IoT.
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 > Connect to server In the server address field, type smb://mylinkit.
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.
AI7688H User Manual 6.8 MAC Address Rules for MBSSID The rules of MAC address adjustment for those virtual interfaces are: 1. Modify the 2nd bit of the most significant byte in the MAC address to 1 to make it as a locally administered MAC address. 2. Apply a MAC mask and add number for enumerating each interface.
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.
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. After the reboot process is done, open and edit the /etc/config/wireless file to configure the network setup.
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.
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. From the above message, you can see the MAC address of the AP to connect (it’s f0:56:76:88:9e:e8).
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.
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: AWS IoT SDK for JavaScript , Embedded C Environment Setup To run the SDK examples you'll need an AWS account and optionally AWS CLI(Command Line Interface) Use an SD card to expand the root file system.
AI7688H User Manual AWS IoT Embedded-C SDK Requirements You'll need a computer running OS X or Ubuntu Linux. This is because you need the cross compilation toolchain to use the AWS IoT C SDK. Building and Running SDK Examples Follow the steps below to know how to build the example applications. 1. Download and setup the cross-compilation tools (OpenWrt SDK) . Make sure you can build and deploy a helloworld example without problem. 2. Locate the path to the cross compilation toolchain.
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. 10. Make sure the board is connected to the internet and is in the same network as your computer. Now we copy the certificationfiles and the sample application to the board: 11.
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.
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. Basic Concepts : The majority of hardware modules such as GPIO, UART, SPI, and PWM are represented as objects created by mraa's factory function.
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. It takes the digital signal input from the pin and interprets it into 1 and 0. This example will continuously print out the value received from P10 on the board.
AI7688H User Manual PWM 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. To control the PWM pattern, several parameters are required, including: Period This defines the carrier frequency of the modulation. It’s controlled by period, period_ms and period_us APIs.
AI7688H User Manual SPI 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. Therefore, developers should access the SPI functionality through SPI modules only and avoid treating these SPI pins as general GPIO. Otherwise, the flash storage may work incorrectly.
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. Controlling LED with MRAA in Node.js Our first tutorial is controlling the LED with a simple node.js program.
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. Period This defines the carrier frequency of the modulation.
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.
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. Requirement Currently only Ubuntu Linux and OS X are supported. Windows with Cygwin is not supported. The following steps assume an Ubuntu Linux environment.
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.
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. Use following commands to install and enable SFTP service.
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. # Now we setup the STAGING_DIR environment variable required by OpenWrt SDK.
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.
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. You'll need to change to your settings accordingly. Make sure you can access the system console with ssh. # Choose Run > Debug Configurations... from the menu.
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. # Click Apply then Debug. The IDE will now upload the built executable to AI7688H through SFTP service.
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. The real capabilities and supported resolution depend on the current UVC driver implementation.
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: WAV playback To play a WAV file, use aplay as below: Audio recording WAV recording Note: for a high bit-rate WAV recording (like 16bit/44.
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. This equipment has been tested and found to comply with the limits for a Class B digital device, pursuant to Part 15 of the FCC Rules.
AI7688H User Manual integrator is still responsible for testing their end-product for any additional compliance requirements required with this module installed IMPORTANT NOTE: In the event that these conditions can not be met (for example certain laptop configurations or co-location with another transmitter), then the FCC authorization is no longer considered valid and the FCC ID can not be used on the final product.