background image

 

MediaTek LinkIt™ Smart 7688 Developer's Guide 

 

©  2015, 2016 MediaTek Inc. 

           Page 14     

This document contains information that is proprietary to MediaTek Inc. 

Unauthorized reproduction or disclosure of this information in whole or in part is strictly prohibited. 

 

 

Scenario 

Approximate Power 

Consumption 

To establish Wi-Fi 
connection 

Peak  

475.3 mA 

Average 

255.6 mA 

Device boot up 

Peak  

605.4 mA 

Average 

195.1 mA 

Downloading a file to 
an SD Card over Wi-Fi 

Peak  

540.4 mA 

Average 

275.8 mA 

Downloading a file to 
a USB Drive over Wi-Fi 

Peak  

569.5 mA 

Average 

304.9 mA 

Downloading a file to 

flash over Wi-Fi 

Peak  

522.4 mA 

Average 

271.3 mA 

Table 4 Typical power consumption scenarios 

  Note: The suggested power source is 5V/1A. 

2.2.7.

 

Accessories 

The standard LinkIt Smart 7688 sales package doesn’t includes accessories; you may therefore 
require the following: 

1)

 

USB Power Cable (Required): You’ll need a USB type A to micro-B plug cable to power the 
LinkIt Smart 7688 development board from a PC or other USB power source.  

2)

 

Micro USB OTG (On-The-Go) or Host Cable (Optional): An OTG cable, as shown in Figure 
3, 
is used to connect Type A USB devices such as USB drives, USB cameras and more. 

 

Figure 3 USB OTG cable 

 

3)

 

USB-UART Cable (Optional): This cable is used to enable communication to the Linux 
console. 

4)

 

Micro SD Card (Optional): Use a micro SD card for extra storage space for application 
code and data. 

5)

 

USB Drive (Optional): For extra storage. You can also use it to store boot loader and 
firmware to upgrade the LinkIt Smart 7688. 

Summary of Contents for LinkIt Smart 7688

Page 1: ...is proprietary to MediaTek Inc Unauthorized reproduction of this information in whole or in part is strictly prohibited MediaTek LinkIt Smart 7688 Developer s Guide Version 0 92 Beta Release date November 2015 Specifications are subject to change without notice ...

Page 2: ...ction or disclosure of this information in whole or in part is strictly prohibited Document Revision History Revision Date Description 0 91 November 2015 LED status diagram COM port INF driver for Windows 8 and 10 Pip npm installation for Python and Node js mDNS on virtual machine 0 92 November 23 2015 Revised Web UI File system opkg test case pass Basic behavior test ...

Page 3: ...ogramming in Python 31 3 8 Programming in Node js 32 4 Software Development Kit and related tools 34 4 1 Software Development Kit 34 4 2 Supported Host Environments 34 4 3 Default OpenWrt Packages 34 4 4 OPKG Packager Manager 35 4 5 System Configuration 36 4 6 System configuration tasks 45 4 7 File Editor and Transfer 53 5 Peripheral Programming on LinkIt Smart 7688 59 5 1 How to Access LinkIt Sma...

Page 4: ...t is proprietary to MediaTek Inc Unauthorized reproduction or disclosure of this information in whole or in part is strictly prohibited 7 5 There are multiple LinkIt Smart 7688 APs nearby and I m not sure which one is mine how do I find out 94 7 6 My board seems to have stopped working what do I do 94 Appendix A 96 ...

Page 5: ... 14 Wi Fi AP Encryption Type 51 Table 15 File Transfer Tools 53 Table 16 LinkIt Smart 7688 GPIO Pin Mapping 60 Table 17 MCU and MPU Communication 76 Table 18 Serial Pin Mapping Between MPU and MCU 78 Figure 1 LinkIt Smart 7688 development board MPU only 11 Figure 2 Removing resistor to enable I PEX connector 13 Figure 3 USB OTG cable 14 Figure 4 JTAG resistors on the bottom of the LinkIt Smart 768...

Page 6: ...art 7688 from Finder 57 Figure 39 Connecting to mylinkit local server in Mac 58 Figure 40 Connecting as guest to mylinkit local on Mac 58 Figure 41 MyShareFolder in Mac Finder 58 Figure 42 LinkIt Smart 7688 Software Architecture 59 Figure 43 Set up the Node js application prompt 65 Figure 44 LinkIt Smart 7688 Duo Hardware Architecture 68 Figure 45 LinkIt Smart 7688 package URL for a custom board i...

Page 7: ...pplications LinkIt Smart 7688 is an open development platform based on the OpenWrt Linux distribution The platform provides generous memory and storage to enable rich application developments The platform also offers options to create device applications using Python Node js or C During prototyping the platform can take advantage of the free MediaTek Cloud Sandbox service to store data in the clou...

Page 8: ...e five references available to assist with the development of software for LinkIt Smart 7688 prototypes This developer s guide the latest copy of which is available here on the MediaTek Labs website LinkIt Smart 7688 development board pin out diagram This diagram provides details of the pin breakout on the development board In addition there are a number of resources available to assist with the c...

Page 9: ...adget revolution MediaTek is a key player in this field combining the best of two worlds the existing MediaTek ecosystem of phone manufacturers electronic device manufacturers and telecom operators with open vibrant developer and maker communities Whether you re a maker device manufacturer student DIY hobbyist or programmer you can use this powerful yet simple platform to create something innovati...

Page 10: ...on it processes an application s intensive logic tasks and provides Wi Fi connectivity It supports Python Node js and C programming languages The MCU handles real time peripheral control as well as offering the ability to run Arduino sketches 2 1 MediaTek MT7688AN Chip Specification Summary Specifications of the MT7688AN SOC are shown in Table 1 MT7688AN SOC Specifications CPU MIPS24KEc 580 MHz To...

Page 11: ...nkIt Smart 7688 LinkIt Smart 7688 is one of the most highly integrated and compact hardware development boards available for IoT prototyping 2 2 1 Key Features LinkIt Smart 7688 s key features include the following 1T1R Wi Fi 802 11 b g n Pin out for GPIO I2C I2S SPI UART PWM and Ethernet Port 580 MHz MIPS CPU 32MB flash and 128MB DDR2 RAM USB host Micro SD slot LinkIt Smart 7688 is shown in Figur...

Page 12: ...ata Wi Fi Reset Button With the board booted up press for at least 20 seconds and release Upgrade firmware from a USB drive Wi Fi Reset Button While the board is powering up press the button for at least 5 seconds and release Upgrade boot loader from a USB drive WARNING This will restore the board to default setting and remove all user data Wi Fi Reset Button While the board is powering up press t...

Page 13: ... PEX connector 2 2 5 USB Host LinkIt Smart 7688 provides USB host capability that enables it to connect to various USB devices such as webcams USB drives keyboards joysticks and more The connector is a USB micro AB type Please see Figure 1 for the USB host connector location 2 2 6 USB Power A USB cable connected to a PC or other power source provides a 5V supply to the LinkIt Smart 7688 developmen...

Page 14: ...ption scenarios Note The suggested power source is 5V 1A 2 2 7 Accessories The standard LinkIt Smart 7688 sales package doesn t includes accessories you may therefore require the following 1 USB Power Cable Required You ll need a USB type A to micro B plug cable to power the LinkIt Smart 7688 development board from a PC or other USB power source 2 Micro USB OTG On The Go or Host Cable Optional An ...

Page 15: ...ou can activate the JTAG function The hardware configuration steps are 1 Find the group of resistors on the bottom of LinkIt Smart 7688 in the upper right as circled in Figure 4 Figure 4 JTAG resistors on the bottom of the LinkIt Smart 7688 2 Move a resistor by unsoldering and soldering it to a lower position as shown in Figure 5 after you ve finished moving the resistor restart the device and you...

Page 16: ...T7688AN Voltage 3 3v PWM Pin Count 4 MT7688AN Voltage 3 3v Max Resolution 7 bits customizable Maximum Frequency Resolution 100kHz 1 bit 50kHz 2 bit 25kHz 3 bit 12 5kHz 4 bit 6 25kHz 5 bit 3 125kHz 6 bit 1 5625kHz 7 bit Standard mode 40MHz 1 bit 20MHz 2 bit 10MHz 3 bit 5MHz 4 bit 2 5MHz 5 bit 1 25Mhz 6 bit 625kHz 7 bit Fast mode External Interrupts Pin Count 22 MT7688AN SPI Set count 1 MT7688AN Pin...

Page 17: ... P7 Connector type Micro AB Communication Wi Fi 1T1R 802 11 b g n 2 4G Ethernet 1 port 10 100 FE PHY Pin numbers P2 P3 P4 P5 User Storage SD Card Micro SD SDXC Table 5 LinkIt Smart 7688 development boards specifications 2 2 10 Pin out Diagram This pin out diagram helps you identify and map the pins on LinkIt Smart 7688 development board to the peripheral devices you want to attach through interfac...

Page 18: ...2015 2016 MediaTek Inc Page 18 This document contains information that is proprietary to MediaTek Inc Unauthorized reproduction or disclosure of this information in whole or in part is strictly prohibited Figure 6 LinkIt Smart 7688 Pin out Diagram ...

Page 19: ...orts additional features including Analog I O support and Arduino IDE support The board s functionality is therefore a combination of that provided by the two chipsets Wi Fi and Ethernet are supported through OpenWrt Linux on the MT7688AN SOC and various peripheral supported through Arduino on the ATmega32U4 microcontroller 2 3 1 Key Features LinkIt Smart 7688 Duo s key features include 1T1R Wi Fi...

Page 20: ...se them are described in Table 6 Scenario Button Action Resets the MPU MPU Reset Button One press Resets the MCU MCU Reset Button One press Enters MCU boot loader mode Timeout after 8 seconds MCU Reset Button Two presses within 750 milliseconds Resets Wi Fi to AP mode Wi Fi Reset Button After the board is boot up press the button for at least 5 seconds and release Factory resets and enters AP mode...

Page 21: ...LED is controlled by the user Arduino program 2 3 4 Antennas LinkIt Smart 7688 Duo has the same antenna support as LinkIt Smart 7688 Please refer to section 2 2 4 Antenna for details 2 3 5 USB Host LinkIt Smart 7688 provides USB host capability that enables it to connect to various USB devices such as webcams USB drives keyboards joysticks and more The connector is a USB micro AB type Please see F...

Page 22: ...cludes accessories you may therefore require the accessories which are the same as LinkIt Smart 7688 and they are described in 2 2 7 Accessories 2 3 8 Breakout Board A breakout board for LinkIt Smart 7688 development boards is available from Seeed Studio This breakout board provides all the pin outs from the MT7688 and ATmega32U4 which allow you to connect sensors and peripherals easily 2 3 9 JTAG...

Page 23: ...g a resistor to access JTAG mode 2 3 10 Specifications The key specifications of the LinkIt Smart 7688 Duo development board are shown in Table 8 Category Feature LinkIt Smart 7688 Duo MPU Chipset MT7688AN Core MIPS24KEc Clock speed 580MHz Working voltage 3 3V MCU Chipset ATmega32U4 Core Atmel AVR Clock speed 8MHz Working voltage 3 3V PCB Size Dimensions 60 8 x 26 mm Memory Flash 32MB RAM 128MB DD...

Page 24: ...688AN 1 ATmega32U4 Pin numbers P8 P9 MT7688AN D0 D1 ATmega32U4 Max Speed 0 5 Mbps MT7688AN 0 5 Mbps ATmega32U4 USB Host Set Count 1 MT7688AN Pin numbers P6 P7 Connector type Micro AB Communication Wi Fi 1T1R 802 11 b g n 2 4G Ethernet 1 port 10 100 FE PHY Pin numbers P2 P3 P4 P5 User Storage SD Card Micro SD SDXC Table 8 LinkIt Smart 7688 Duo development board specifications 2 3 11 Pin out Diagram...

Page 25: ...5 2016 MediaTek Inc Page 25 This document contains information that is proprietary to MediaTek Inc Unauthorized reproduction or disclosure of this information in whole or in part is strictly prohibited Figure 10 LinkIt Smart 7688 Duo Pin out Diagram ...

Page 26: ...hat is proprietary to MediaTek Inc Unauthorized reproduction or disclosure of this information in whole or in part is strictly prohibited 2 4 FCC CE and NCC Certifications LinkIt Smart 7688 and LinkIt Smart 7688 Duo development boards are FCC CE and NCC certified For FCC compliance statement please see Appendix A ...

Page 27: ...grow 3 2 Programming Environment Overview LinkIt Smart 7688 development platform offer an OpenWrt Linux environment It supports development in native C C and the high level language Python and JavaScript using Node js With native applications you can create drivers frameworks and system applications for devices that require optimal performance The high level language development options enable you...

Page 28: ...n the LinkIt Smart 7688 development board external devices and peripherals are connected to the MT7688 MPU and controlled by the Linux environment The device application also executes in the Linux environment on the MT7688 MPU While on the LinkIt Smart 7688 Duo development board external devices and peripherals are connected to and controlled by the ATmega32U4 MCU However because the MPU and MSC a...

Page 29: ...Fi communications on the LinkIt Smart 7688 development platform offers two operating modes Access Point and Station This section describes those two modes 3 5 1 Access Point Mode In AP mode a LinkIt Smart 7688 development board forms a LAN and acts as an access point as shown in Figure 12 AP mode is used mainly to configure the board settings Figure 12 LinkIt Smart 7688 in AP Mode 3 5 2 Station Mo...

Page 30: ... can install development tools on LinkIt Smart 7688 Linux environment directly the board s 128MB of RAM may be insufficient for use and this can become a limitation for native application developments To avoid running out of memory during native application developments you should setup the native application development environment in a more powerful host environment that enables you to cross com...

Page 31: ... see the string Hello World as the output 3 7 Programming in Python High level programming languages are executed by the corresponding languages interpreter in LinkIt Smart 7688 You can do the programming remotely and send the code to LinkIt Smart 7688 for execution 3 7 1 Setting Up Python Programming Environment The high level programming environment is simple You ll need to install a text editor...

Page 32: ...ecause there isn t native compilation toolchain environment available on the board For example when installing the simplejson module you ll see a warning during the installation process as shown below warning install_lib byte compiling is disabled skipping WARNING The C extension could not be compiled speedups are not enabled Plain Python installation succeeded Successfully installed simplejson Th...

Page 33: ... guide and check here for a list of available packages You can use npm install command in the system console to install the packages For example npm install request This installs the popular request package which helps you generate HTTP requests easily Note some NPM packages that rely on native C C implementation may fallback to pure JavaScript implementations or fail to install at all because the...

Page 34: ...the use the system console tools to launch the application on a development board For Arduino development the standard Arduino IDE is used to code your sketches and launch them on a board 4 2 Supported Host Environments Depending on the development model you adopt you will be able to use a host environment as shown in Table 10 Development model Windo ws Ubuntu Mac OS X Native OpenWrt C C applicati...

Page 35: ...1 Packaged included in the LinkIt Smart 7688 development platform There are others OpenWrt packages available and you may want to upgrade or install more to expand your tool set The software can be upgraded and managed using the opkg utility For more information on opkg please see section 4 4 OPKG Packager Manager or the OpenWrt website 4 4 OPKG Packager Manager OPKG Package Manager is a tool used...

Page 36: ...ct due to possible API or behavior changes For more information on opkg features please check the OpenWrt website 4 5 System Configuration This chapter describes the tools and methods you can use to configure LinkIt Smart 7688 development board 4 5 1 System Configuration Tools There are two options available for configuring LinkIt Smart 7688 development boards the Web UI and system console The Web...

Page 37: ... IP address of mylinkit local and use IP address in the guest OS 4 5 3 Connecting to the Web UI LinkIt Smart 7688 Web UI allows you to configure system information upgrade firmware perform device reset and change between Wi Fi AP and Station mode and more The following steps apply to Windows Mac OS X and Linux 1 Power on LinkIt Smart development board by using any USB power source for example your...

Page 38: ...e LinkIt Smart 7688 boards power only one of them to prevent name collision An alternative is to insert a micro SD card with a file name which contains the name of Access Point you want to rename to Keep in mind that once you ve connected to LinkIt Smart 7688 your computer may no longer have access to the Internet it is now joined the Local Area Network formed by LinkIt Smart 7688 as shown in Figu...

Page 39: ...ized reproduction or disclosure of this information in whole or in part is strictly prohibited the Internet in later steps But first you need to configure LinkIt Smart 7688 and the steps are described next Figure 17 LinkIt Smart 7688 in AP mode 3 In your web browser open http mylinkit local as shown in Figure 18 Figure 18 LinkIt Smart 7688 Web UI Sign In ...

Page 40: ... USB drive or use the buttons please refer to section 4 6 1 Upgrading Firmware or section 4 6 4 Factory Reset 4 Click on the Password field and set a password using at least 6 alphanumeric characters Click Submit and enter the password again to Sign In 4 5 4 Connecting to the System Console There are two ways to access the system console on LinkIt Smart 7688 development board They are described as...

Page 41: ... PuTTY for the first time or after upgrading firmware or boot loader or use a different board Click Yes Figure 20 PuTTY Security Warning 4 In the PuTTY terminal window that opens log in with username root and enter the password you set previously in the Web UI after log in you should see a screen similar to Figure 21 Figure 21 System Console For Mac Open Terminal In the Terminal type ssh root myli...

Page 42: ... your cable requires driver installation it may or may not be needed Please check the following sections per your OS Note Download the executable version corresponding to your OS from the Currently Supported VCP Drivers list After installation the COM port will be successfully identified For Windows 1 Install driver If you re using a USB cable based on FTDI chip please download and install its dri...

Page 43: ...orized reproduction or disclosure of this information in whole or in part is strictly prohibited Figure 22 LinkIt Smart 7688 COM port using Serial to USB cable 4 Open the PuTTY terminal and enter the COM port number of the USB device found in the device manager click on the Serial radio button type 57600 in Speed box and click Open as shown in Figure 23 ...

Page 44: ...installation instructions 2 Plug in the cable and connect the cable to LinkIt Smart 7688 3 Open a Terminal session You can open it at Applications Utilities Terminal 4 Type ls dev cu in the Terminal You should see a list of devices Look for something like cu usbserial XXXXXXXX where XXXXXXXX is usually a random identifier This is the serial device used to access the system console For example ls d...

Page 45: ... a random identifier This is the serial device used to access the system console For example ls dev ttyUSB dev ttyUSB0 5 Use the screen utility to connect to the serial port and set the baudrate to 57600 This is because the baudrate of the system console is 57600 by default One thing to keep in mind is that in Ubuntu the serial devices require dialout group permission Use sudo to elevate the permi...

Page 46: ...re as shown in Figure 24 Figure 24 Firmware upgrade button 3 Click Choose the file and select lks7688 img file Click Upgrade Restart as shown in Figure 25 Figure 25 Selecting firmware file 4 The firmware will upload to LinkIt Smart 7688 please make sure the device stays connected to its power source until the firmware upgrade is completed 5 The red LED will blink for approximately 3 minutes watch ...

Page 47: ... 3 Press the Wi Fi and MPU Reset button then release the MPU Reset button only but hold the Wi Fi button for at least 5 seconds and release Wi Fi LED turns off see Figure 27 for detailed LED status Do not press the Wi Fi button for longer than 20s or it will enter boot loader mode Figure 27 Wi Fi LED Status During Firmware Upgrade 4 LinkIt Smart 7688 will start to read the firmware image Wi Fi LED...

Page 48: ...kIt Smart 7688 development board will start to read the boot loader Wi Fi LED blinks fast and perform the boot loader upgrade process Wi Fi LED blinks slowly It takes about 2 seconds to finish the boot loader upgrade process 4 6 3 Wi Fi Reset Press the Wi Fi Reset button for at least 5 seconds and release The device will go into AP mode 4 6 4 Factory Reset This section describes how to do factory ...

Page 49: ... mode For more information please see section3 5 Network Environment 4 6 5 1 Using the Web UI Open a browser with URL mylinkit local Please see section 4 5 3 Connecting to the Web UI if you ve not signed in before 1 Click Network button on upper right as shown in Figure 29 Figure 29 Change networking setting in Web UI 2 Select the Station mode and click Refresh or downward arrow on the right to fi...

Page 50: ...s on Wi Fi LED it is in AP mode You can also use system console to change LinkIt Smart 7688 to station mode please see section 4 6 5 2 Using the System Console 4 6 5 2 Using the System Console In order for LinkIt Smart 7688 board to access the Internet it needs to join a network that has an access point connected to the Internet and to do that the board needs to be in Station mode When a LinkIt Sm...

Page 51: ...ption type WPA2 PSK psk2 Password 12345678 uci set wireless sta ssid MyAP uci set wireless sta encryption psk2 uci set wireless sta key 12345678 uci set wireless sta disabled 0 uci commit wifi 4 Now check if you ve established network connection by typing the following command in the terminal window ping c 5 www mediatek com If you see a screen similar to Figure 31 congratulations you ve connected...

Page 52: ...t IP address Account Password Figure 32 System Information in LinkIt Smart 7688 Web UI 4 6 7 Accessing the USB drive and the SD Card When a USB drive or SD card is inserted into LinkIt Smart 7688 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 You can use t...

Page 53: ...ge of LinkIt Smart 7688 provides several tools for transferring files over Wi Fi connection Table 15 shows the types of file transfer tools File Transfer Service Protocol Host Platform Tool SCP Secure Copy SCP Windows WinSCP OS X scp command Linux scp command Samba SMB CIFS Windows File Explorer built in support OS X Finder built in support Linux smbclient Table 15 File Transfer Tools 4 7 1 Using ...

Page 54: ...of this information in whole or in part is strictly prohibited Figure 34 WinSCP login window c Locate the file you want to transfer on the left pane your computer and drag it to the right LinkIt Smart 7688 as shown in Figure 35 Figure 35 File transfer using WinSCP d After you ve dragged the file an Upload window will appear as shown in Figure 36 asking you to confirm the upload Click OK ...

Page 55: ...talled 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 LinkIt Smart 7688 The SCP tool will instruct you to enter the password of root account which i...

Page 56: ...hared folder path to IoT In LinkIt Smart 7688 console type the following command uci set samba media path IoT 2 Name the shared folder MySharedFolder for example uci set samba media name MySharedFolder 3 Change the permission of the shared folder to make it readable and writable for example chmod o rwx IoT 4 Save and reboot the LinkIt Smart 7688 platform for example uci commit reboot 5 After LinkI...

Page 57: ...le or in part is strictly prohibited Figure 37 File transfer using Samba in Windows 4 7 6 Use Samba to copy files in OS X The steps to transfer files using Samba in Mac are as follows 1 Open Finder and in the top menu click Go Connect to server as shown in Figure 38 Figure 38 Connecting to LinkIt Smart 7688 from Finder 2 In the server address field type smb mylinkit local and click Connect as show...

Page 58: ... or disclosure of this information in whole or in part is strictly prohibited Figure 39 Connecting to mylinkit local server in Mac 3 Connect as guest as shown in Figure 40 Figure 40 Connecting as guest to mylinkit local on Mac 4 Check Finder and you ll see MySharedFoloder as shown in Figure 41 You can now transfer files in this folder Figure 41 MyShareFolder in Mac Finder ...

Page 59: ... it provides API bindings for Python Node js and C languages So it s convenient for developers to use UPM to access peripheral sensors and modules with the programming language that they preferred LinkIt Smart 7688 has built in UPM support for Seeed studio s GROVE sensors For sensors with different manufacturers developers can also have the UPM driver support by installing them through the opkg se...

Page 60: ...mart 7688 are identical to the GPIO number in the data sheet and in the Linux GPIO subsystem The following example creates GPIO object on GPIO 2 which maps to P10 of LinkIt Smart 7688 and it s the IS2_WS pin in data sheet as shown in Table 16 Refer to the Pin out diagram of LinkIt Smart 7688 and LinkIt Smart 7688 Duo respectively to see the mapping between the silk print on the board and the GPIO ...

Page 61: ...e 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 You can short 3V3 and P10 to observe the change in values import mraa import time Refer to the pinout digram for the GPIO number to silk print mapping in this example the number 2 maps to P10 on LinkIt Smart 7688 board pin ...

Page 62: ... defines the pattern in a different unit the uptime of the signal in time units This is defined by pulsewidth pulsewidth_ms and pulsewidth_us APIs The following example generates a 500Hz PWM signal with 25 duty cycle on pin P26 import mraa pin mraa Pwm 18 initialize on GPIO18 pin P26 pin period_ms 2 set PWM frequency to 500Hz 2ms period pin enable True enable PWM output pin write 0 25 set duty cyc...

Page 63: ...nkIt Smart 7688 it consists of 4 pins SPI_MOSI P22 SPI_MISO P23 SPI_CLK P24 and 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 The SPI ...

Page 64: ...ed write 1 turn on LED time sleep 1 led write 0 turn off LED time sleep 1 4 Press wq to save the blink py file 5 Now you re ready to run this Python application In the app directory type following command to run the app python blink py The W Fi LED on LinkIt Smart 7688 should blink every second Press Ctrl C to terminate the Python program 5 1 5 LED blink example using mraa in LinkIt Smart 7688 GPI...

Page 65: ...in Figure 43 This is a set up process for the node application For this tutorial press enter for all questions Figure 43 Set up the Node js application prompt 8 In the root myLinkIt app prompt create a file named app js by entering the following command vim app js 9 Press i to insert the below codes in the editor For example var m require mraa var ledState true var myLed new m Gpio 44 GPIO44 is th...

Page 66: ... you can use opkg package manager to update the UPM library UPM is similar to libmraa in the way that it comes with bindings in C Python and Node js Let s get started with an example where you ll learn how to use UPM and Python to receive values from an I2C accelerometer a Grove 3 Axis Digital Accelerometer 16g 1 Connect the Accelerometer to your board If you have the breakout board you can attach...

Page 67: ...sure of this information in whole or in part is strictly prohibited You should see the acceleration value printed repeatedly Try moving the sensor around to see changes in the values now you can use the sensor to detect accelerations For a list of other available Python modules in UPM repository check here The UPM repository also comes with a handful of examples for your reference ...

Page 68: ...l begin with introduction on how to setup the Arduino IDE then describe the basic ideas of communicating between MT7688 and ATmega32U4 followed by some examples of different programming models that can be used to develop the application logic Figure 44 LinkIt Smart 7688 Duo Hardware Architecture 6 1 Installing Arduino IDE LinkIt Smart 7688 Duo s MCU ATmega32U4 can be programmed using Arduino IDE 1...

Page 69: ...prohibited Figure 45 LinkIt Smart 7688 package URL for a custom board installation in Arduino IDE 2 Make sure your computer is connected to the internet 3 In the Arduino Tools menu point to Board then click Boards Manager as shown in Figure 46 Figure 46 Arduino IDE Board Manager Menu 4 LinkIt Smart 7688 board support package starts downloading automatically and it may take several seconds for the ...

Page 70: ...le The location of the cached json file is the same as the location of the preferences txt file It can be found in the Arduino IDE under the File menu by clicking Preferences Error downloading the LinkIt ONE SDK package 5 There should now be a LinkIt Smart 7688 item appearing in the boards list on the Boards Manager as shown in Figure 47 Click the LinkIt Smart 7688 version button to select the lat...

Page 71: ...part is strictly prohibited Figure 48 LinkIt Smart 7688 board package installed on Arduino IDE If there is a problem with the LinkIt Smart 7688 board package installation try installing Arduino SAM board package first as shown below Then retry LinkIt Smart 7688 installation Problem downloading the SDK after the cached json file is removed 7 You now have the LinkIt Smart 7688 installed on Arduino I...

Page 72: ... steps are needed to ensure Windows 10 recognizes the board Connect LinkIt Smart 7688 Duo to your Windows 10 machine then quickly press the MCU reset button twice within 700 milliseconds The system should now recognize LinkIt Smart 7688 Duo as a USB Serial Device COM5 The number 5 may be different on different machines You only need to do this during the 1st time connecting the board to your Windo...

Page 73: ...r installation For Ubuntu Linux it should work without installing a driver LinkIt Smart 7688 should be in dev folder and mounted as ttyUSB0 The number 0 may be different on each Ubuntu machine For OS X it s also not required to install a driver LinkIt Smart 7688 Duo is mounted as a serial device under dev tty usbmodem1413 The number 1413 may be different on each OS X machine 6 4 Programming model ...

Page 74: ...on Node js or C through the UART channel to the MCU side as shown in Figure 53 On the MCU side you implement the codes to interpret commands from MPU and perform corresponding actions by accessing sensor drivers Figure 53 Software architecture Scenario 2 Through Firmata protocol In the above scenario 1 you ll need to implement the commands on the UART channel this provides the most general flexibl...

Page 75: ...k for Robotics application It uses Firmata to implement the communication between MPU and MCU and thus alleviates Node js developers from low level UART and MCU programming Figure 54 Firmata Protocol Scenario 3 Through Arduino Yun Bridge Library For Arduino Yun developers the MPU Linux side acts as a black box for simply providing Wi Fi connectivity and USB SD peripheral accessibility LinkIt Smart...

Page 76: ... primitive UART connection 6 5 1 Blink Program Arduino Side The MCU side is written as an Arduino sketch In this example the sketch simply listens to the command sent from the MPU Linux side and switches the on board LED accordingly 1 First connect the LinkIt Smart 7688 Duo to your PC then open Arduino IDE and paste the following sketch code into the IDE void setup Serial begin 115200 open serial ...

Page 77: ...56 Upload Sketch in Arduino IDE 6 5 2 Blink Program Linux Side As describe in chapter 4 General Programming Guide you can program the Linux side using many languages including C C Python or Node js In this example Python is used to illustrate a program that sends command to the MCU Arduino side to make the LED blink 1 Use a text editor of your choice and create a new file then copy the following c...

Page 78: ...LED accordingly You can now extend the Arduino sketch to drive other devices such as PWM I2C devices and synchronize the states by extending the command messages between Arduino and the Linux side If a large amount of peripheral types need to be included you may want to use some external libraries to implement the communication protocol One of such protocol Firmata is described in the following se...

Page 79: ...velopment Environment LinkIt Smart 7688 Duo supports Arduino 1 6 5 and Python 2 7 Firmata protocol requires implementation on the MPU and the MCU To begin you ll need to install software to program the MCU Please make sure you ve installed the following For your PC o Arduino IDE 1 6 5 It provides a set of default implementations and programs the ATmega32U4 For your LinkIt Smart 7688 Duo o Python 2...

Page 80: ... the Arduino IDE 1 6 5 2 In Arduino IDE open the example File Examples Firmata StandardFirmata This built in example is for Arduino Uno which uses Serial as Serial port However LinkIt Smart 7688 Duo uses Serial1 to communicate with OpenWrt Therefore you ll need to change the listening port of this example from Serial to Serial1 Find the following line in the example Firmata begin 57600 3 And chang...

Page 81: ...the PyMata libraries before you start uploading the sketch to Arduino Please make sure you ve the following 1 Download PyMata libraries PyMata master zip to Arduino library folder on your computer and extract it For example C Program Files x86 Arduino libraries 2 Open Arduino IDE and select Sketch Include library Add ZIP Library 3 Select the PyMata master zip file and click OK Using FirmataPlus Ex...

Page 82: ...the serial port used in this example to work on LinkIt Smart 7688 Duo Find the following line on the example Create a PyMata instance board PyMata dev ttyACM0 verbose True 2 And change it to Create a PyMata instance board PyMata dev ttyS0 verbose True 3 Execute the python script and you should see following output python pymata_blink py Python Version 2 7 9 default Aug 12 2015 15 09 09 GCC 4 8 3 P...

Page 83: ... LinkIt Smart 7688 Duo and Arduino Uno o LinkIt Smart 7688 Duo operates in 3 3V not 5V as in Arduino Uno o You ll need extra power source when driving motor or servo peripherals because they draw more current Please refer to Firmata website for other Python interfaces available to Firmata protocol 6 6 6 Node js example This section illustrates the MPU and MCU communication using Firmata protocol i...

Page 84: ...Firmata on your computer While you can install Firmata using NPM on LinkIt Smart 7688 Duo the process is a bit long that s why you should install NPM on your computer instead and do the Firmata installation from there In your host computer create a folder called testfirmata and switch to the directory The indicates command prompt and is not part of the command mkdir testfirmata cd testfirmata 5 Af...

Page 85: ...e needs to be removed because it s already built in LinkIt Smart 7688 8 Compress the Firmata folder tar cvf firmata tar node_modules firmata 9 Use scp to transfer the compressed file to LinkIt Smart 7688 Duo scp firmata tar root mylinkit local root app node_modules 10 Open the LinkIt Smart 7688 Duo SSH system console and type the following commands to create a directory called app and go to that d...

Page 86: ...Type wq to save and exit the editor 14 Run the node js example by typing the following command in the system console node app 15 Open a browser and enter the following commands to control the LED a To turn LED ON mylinkit local 8080 value high b To turn LED OFF mylinkit local 8080 value low 16 The D13 LED on LinkIt Smart 7688 Duo should blink according to your command of choice 6 6 7 Cylon js exam...

Page 87: ... not part of the command mkdir testcylon cd testcylon 4 After you ve installed NPM use it to initialize the file For example npm init 5 Install four Cylon on your computer by typing the following command npm install cylon save npm install cylon firmata save npm install cylon gpio save npm install cylon i2c save 6 Remove node serial port by typing the following command rm rf node_modules cylon node...

Page 88: ...Cylon robot connections arduino adaptor firmata port dev ttyS0 devices led driver led pin 13 work function my every 1 second my led toggle start 12 Save and exit the editor by typing wq 13 Execute the Cylon js program by typing the following command node app js 14 The D13 LED on LinkIt Smart 7688 Duo should blink every second 6 6 8 Updating the ATmega32U4 Boot loader This chapter introduces the me...

Page 89: ...r 6 6 10 Using AVRDUDE from OpenWrt To Program Boot loader You can also program ATmega32U4 from the Linux side MT7688 The system image is preloaded with AVRDUDE package that allows you to program the ATmega32U4 AVRDUDE is a command line tool for flashing codes to MCU on Linux 1 Copy the boot loader file to a storage device USB drive or SD card or to your computer The boot loader file is located in...

Page 90: ... need to set the system console to map to dev ttyS0 which allows the Arduino side to issue commands to the Linux system Luckily the default system image of LinkIt Smart 7688 Duo wraps all the aforementioned configurations into a single UCI configuration All you need to do is to enable it You can do this by typing the following command in the system console and reboot the system For example uci set...

Page 91: ...scripts and services may act differently on the default system image so you may need to modify the sketch files accordingly Please also note that while the system is configured to work with the Bridge library the dev ttyS0 becomes occupied by the Bridge library and it is not advised to try accessing it when in use For example Firmata won t work when the system is configured to support Bridge libra...

Page 92: ...mware upgrade process or else your board will fail to boot up If that happens you can use boot loader to boot up the device Please see section 3 4 3 Upgrading boot loader for more information After you ve checked the items above please try again if you still can t upgrade the firmware please contact technical support at Seeed Studios or go to MediaTek Labs forum 7 2 I can t connect to URL mylinkit...

Page 93: ...w firmware and tried to access system console using SSH The new firmware or different board creates a new host identification which is different from the previous one hence the error To fix this issue you need to remove the old host ID Here s how 1 In your Terminal open the known hosts file This example uses vi editor but you can use any editor you prefer is the terminal command prompt and is not ...

Page 94: ...t Smart 7688 APs nearby and I m not sure which one is mine how do I find out To find the hardware address of the board type ifconfig in the system console The hardware address should show in the first sentence under ra0 as shown in Figure 64 The last three set of numbers should match your board s AP name Figure 64 Finding LinkIt Smart 7688 hardware address 7 6 My board seems to have stopped workin...

Page 95: ...ry to MediaTek Inc Unauthorized reproduction or disclosure of this information in whole or in part is strictly prohibited 1 Attempt to reboot the board using the MPU reset button 2 Attempt to reboot the board using the boot loader 3 Contact Seed Studio Remember also to check the Labs forum for posts on possible causes and cures ...

Page 96: ...off and on the user is encouraged to 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 outlet on a circuit different from that to which the receiver is connected Consult the dealer or an experienced radio TV technician for help FCC Caution Any changes o...

Page 97: ...y 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 Z4T LINKITS7688 The grantee s FCC ID can be used only when all FCC compliance requirements are met End Product Labeling II This transmitter module is authorized only for use in device where the antenna may be installed such that 2...

Reviews: