background image

AI7688H User Manual   

-41- 

Copyright@2016 AcSiP 

 

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. 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. 

4.

 

Extract the downloaded AWS IoT SDK, in this example we use the path AWS_SDK. 

5.

 

Use your AWS IoT Console, choose 

"Connect a device"

 to generate certification files. 

Download and store the certification files to AWS_SDK/certs directory. 

6.

 

Navigate the the 

subscribe_publish_sample

 sample application directory: 

 

 

7.

 

Copy the resulting configuration text to aws_iot_config.h, it will look similar to this: 

 

 

Summary of Contents for Acsip AI7688H

Page 1: ...AI7688H User Manual 1 Copyright 2016 AcSiP An IOT Solution Company V 1 160407...

Page 2: ...AI7688H User Manual 2 Copyright 2016 AcSiP Revision History Revision Date Author Description V 1 160407 Kevin New Create...

Page 3: ...rt 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...

Page 4: ...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 m...

Page 5: ...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 For Windows 8 and later Mac OS X...

Page 6: ...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 Relea...

Page 7: ...AI7688H User Manual 7 Copyright 2016 AcSiP 2 5 Get system Info and Upgrade F W 2 6 Go to OpwnWrt for advanced configuration Enter your Password...

Page 8: ...opyright 2016 AcSiP 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...

Page 9: ...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...

Page 10: ...l start to read the bootloader WiFi 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 3 3 Build F W f...

Page 11: ...8H make menuconfig o Select the options as below Target System Ralink RT288x RT3xxx Subtarget AI7688H based boards o Save and exit use the deafult config file name without changing it Start the compil...

Page 12: ...Labs linkit smart uboot git Change to the source folder cd linkit smart uboot Install the toolchain needed for building the bootloader sudo tar xjf buildroot gcc342 tar bz2 C opt Since the toolchain...

Page 13: ...lect 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...

Page 14: ...lling 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...

Page 15: ...oot 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...

Page 16: ...compressing Kernel Image OK No initrd Transferring control to Linux at address 80000000 Giving linux memsize in MB 128 Starting kernel 0 000000 Linux version 3 18 21 root builder1 gcc version 4 8 3 Op...

Page 17: ...FG_RT2880_CONSOLE RT2880_UART1 define CFG_RT2880_CONSOLE RT2880_UART3 else define RT2880_UART1 0x0500 define RT2880_UART2 0x0C00 UART Lite define CFG_RT2880_CONSOLE RT2880_UART2 endif and modify the C...

Page 18: ...le baudrate from 57600 to 115200 Now build the bootloader and upload it to the board 3 8 Change Kernel Console If you want to use another UART port as the kernel console you can follow the steps below...

Page 19: ...omic write operation So it is not recommended to write user data to the on board flash frequently Besides its storage is also limited to 32MB the spare space might not be sufficient for storing lots o...

Page 20: ...t 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 In the mount config section change o the target option to overlay o...

Page 21: ...f 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 ca...

Page 22: ...ifferent modes the AP Access Point mode and the Station mode The AP mode forms a Wi Fi network that allows your computer to join and the station mode allows AI7688H to join other Wi Fi network formed...

Page 23: ...ure the Wi Fi settings accordingly After resetting device the Wi Fi LED doesn t blink at all The bootloader is corrupted or the on board flash is damaged The device is bricked You need to re program t...

Page 24: ...H is already in AP mode this operation takes no effect 6 2 Switch to Station mode Step1 Type UCI commands to assign SSID key and encryption information for running Station mode Assume the wireless rou...

Page 25: ...nnection in Station mode Step 3 Check for Internet connection Now we can check if you ve established Internet connection by typing the following command in the system console ping c 5 www mediatek com...

Page 26: ...AI7688H User Manual 26 Copyright 2016 AcSiP 6 4 Setup Wireless Router...

Page 27: ...AI7688H User Manual 27 Copyright 2016 AcSiP...

Page 28: ...SB Drive to the board Plug an OTG cable to the HOST port and attach the USB drive to the OTG cable Reboot and the AP name will change according to the file Use THE_AP_PASSWORD you assigned to log in i...

Page 29: ...he path example helloworld in AI7688H The SCP tool will instruct you to enter the Password of root account Using SCP to copy files in Windows You can download tools that support SCP protocol WinSCP is...

Page 30: ...inkit 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...

Page 31: ...for this directory 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...

Page 32: ...uld 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 F...

Page 33: ...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 Use get_site_survey ra0 to collect scan result...

Page 34: ...to 4 then the newly virtualized MAC address for Station mode will be 1 Apply the locally administered bit 9E 65 F9 1B 13 62 2 Apply mask 9E 65 F9 0B 13 62 3 We only need 1 interface for Station mode...

Page 35: ...and then execute the opkg update and opkg install usbutils commands to install the utility After the utility is installed you ll need to install the driver package for the Wi Fi dongle Insert the Wi F...

Page 36: ...ice 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 re...

Page 37: ...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 typ...

Page 38: ...r 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 Open the etc config wireless file again and add one line for the radio1 for the...

Page 39: ...under Station mode its IP address will be outputted to the UART port when the Wi Fi button is pressed If you watch the output on the UART0 you will see the output as below Under AP mode the MAC addres...

Page 40: ...unt of disk spaces Sign up an AWS account Install AWS CLI You can install the CLI on AI7688H directly with pip install awscli or use your PC to install it Generates certificates required by the exampl...

Page 41: ...ut problem 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 ex...

Page 42: ...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 Then we can execute the sample application...

Page 43: ...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 So it...

Page 44: ...tialized on certain pins that are identified by pin numbers The pin numbers in the libmraa on AI7688H are identical to the GPIO number in the data sheet and in the Linux GPIO subsystem The following P...

Page 45: ...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 You can short 3V3 and P10 to observe th...

Page 46: ...0 of duty cycle and 1 0 is 100 of duty cycle Pulse width also defines the pattern in a different unit the uptime of the signal in time units This is defined by pulsewidth pulsewidth_ms and pulsewidth_...

Page 47: ...ory AI7688H system image is pre installed with UPM and you can start programming on existing sensors immediately but if the default implementation is not available you can use opkg package manager to...

Page 48: ...lling 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 control...

Page 49: ...period_us APIs for example Duty Cycle and Pulse Width These two parameters are related to each other and usually you only need to set one of them Duty cycle is controlled by write API with a value ra...

Page 50: ...able 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 minimu...

Page 51: ...ent Step First download the SDK zip file Unzip the package The name is quite long and we ll use SDK to denote its name Note that sudo is mandatory without it the file won t properly unpacked Copy the...

Page 52: ...ogram 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 progra...

Page 53: ...pse IDE for C C Developers Create and configure C project Now we create a Hello World project that uses cross compilation toolchain from the AI7688H OpenWrt SDK Launch the IDE choose File New Project...

Page 54: ...rectory Click Finish and the wizard will create the project Now we setup the STAGING_DIR environment variable required by OpenWrt SDK From the menu select Project Properties This brings up the Propert...

Page 55: ...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 g...

Page 56: ...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 s...

Page 57: ...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 Enter t...

Page 58: ...orted resolution depend on the current UVC driver implementation Step by step we use mjpg streamer as the streaming application and it s already installed in the system firmware by default For the web...

Page 59: ...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 1k format as the below example please record...

Page 60: ...try to correct the interference by one of the following measures Reorient or relocate the receiving antenna Increase the separation between the equipment and receiver Connect the equipment into an ou...

Page 61: ...ntenna may be installed such that 20 cm may be maintained between the antenna and users The final end product must be labeled in a visible area with the following Contains FCC ID 2ADWC AI7688H The gra...

Reviews: