AjithKP MediaTekLabs MediaTek LinkIt™ Smart 7688 Duo : Peripheral Programming using Arduino & Python
Topics 2 WHO IS MEDIATEK What is MediaTek Labs LinkIt Smart 7688 HDK’s LinkIt Smart 7688 Software tools Peripheral Programming Challenge Questions
27 offices across 12 countries A Global Company USA UK Denmark Sweden Dubai India Singapore Mainland China Korea Japan Finland Taiwan Hsinchu HQ 3
Source (ranking by revenue of 2014): Strategy Analytics, Gartner, IDC, IC Insight, iSuppli and MediaTek company data * Combined with MStar. Source (Rankings by volume): Strategy Analytics, Displaysearch, iSuppli , MediaTek company data Feature phone #1 Digital TV* #1 Optical disc drive #1 DVD/BD player #1 Smartphone #2 Tablets #2 Connectivity network #3 Leading Market Position with Cross-Platform Synergy 2016-03-03Copyright © MediaTek Inc. All rights reserved. 4
MediaTek Powered Products 5 ▪ New Amazon Kindle Tablets▪ Sony Android TVSmartphone HTC M9+ / Sony Xperia E4
Topics 6 Who is Mediatek WHAT IS MEDIATEK LABS LinkIt Smart 7688 HDK’s LinkIt Smart 7688 Software tools Peripheral Programming Challenge Questions
MediaTek Labs ADeveloper Centric Ecosystem ̶ Global program – free to join ̶ Supporting developers: ̶ Device creation ̶ App development ̶ Services ̶ labs.mediatek.com
2016-03-03Copyright © MediaTek Inc. All rights reserved. 8 Enabling Developer and Maker Success ̶ Dev resources ̶ Insights and inspiration ̶ Access to hardware ̶ SDKs for makers (Arduino), professional developers (C/Eclipse) and Linux (OpenWrt and Ubuntu) ̶ Technical support ̶ Peripherals (sensors, etc) ̶ Cloud management of device data ̶ Developer advice & matchmaking ̶ Design, production & go-to-market help Go from idea to prototype to product
MediaTek LinkIt™ portfolio Software and hardware development platforms for wearables & IoT Copyright © MediaTek Inc. All rights reserved. LinkIt Assist 2502 labs.mediatek.com/2502 ̶ Wearable form factors ̶ For professional developers (C/Eclipse) LinkIt ONE labs.mediatek.com/linkitone ̶ Unrivalled connectivity on a single board ̶ For DIY & maker community (Arduino) LinkIt Connect 7681 labs.mediatek.com/7681 ̶ The simple way to Wi-Fi enable your devices ̶ For low-cost smart home or office deployment LinkIt Smart 7688 labs.mediatek.com/7688 ̶ Open-source Wi-Fi platform for a more connected world ̶ OpenWrt Linux, Python, Node.js, Arduino
2016-03-03Copyright © MediaTek Inc. All rights reserved. 10 RapidlygrowingLinkItcommunity
Topics 11 Who is Mediatek What is MediaTek Labs LINKIT SMART 7688 HDK’S LinkIt Smart 7688 Software tools Peripheral Programming Challenge Questions
MediaTekLinkIt™Smart7688 Theopen-source Wi-Fiplatform foramore connected world 12 System-on-Chip MediaTek MT7688AN, a highly Integrated compact SoC for IoT devices with Wi-Fi connectivity Software Dev Tools • OpenWrt • Python & Node.js • Arduino Plug-in LinkIt Smart 7688 HDKs • LinkIt Smart 7688 HDK with MT7688 MPU • LinkIt Smart 7688 Duo with MT7688 MPU + MCU • Firmware & bootloader
LinkIt Smart 7688 HDKs 13 LinkIt Smart 7688 Duo (Arduino Compatible) LinkIt Smart 7688 Two versions of HDK Run OpenWrt Linux Multiple programming options
MEDIATEK LINKIT™ SMART 7688 DUO 14
15 USB Host USB Power & MCU USB port MPU Reset Button Wi-Fi Reset Button MCU Reset Button MT7688AN + 128MB DDR2 (Under shielding cover) Micro SD Slot Atmega32U4 32 MB Flash LinkItSmart7688Duo
Hardware Spec ▪ MPU & MCU • MT7688 - 580MHz MIPS 24KEc CPU • ATmega32U4 ▪ Memory • Flash 32MB • RAM 128MB DDR2 • SD card ▪ Power • USB 5 V ▪ Digital I/O • 24 pins + (3 pins on the MT7688AN) ▪ Analog Input • 12 pins
Hardware Spec  External Interrupts • 8 pins (S0, S1, S2, S3, D8, D9, D10, D11)  I2C • 1 set  SPI • 1 set (Master & Slave)  UART • UART Lite  1 Set MT7688AN  1 Set ATmega32U4 • UART host  1 Set MT7688AN  Wi-Fi • 802.11 b/g/n (2.4G)  PWM • 8 pins (D3, D5, D6, D9, D10, D11, D12, D13 )
Topics 18 Who is Mediatek What is MediaTek Labs LinkIt Smart 7688 HDK’s LINKIT SMART 7688 SOFTWARE TOOLS Peripheral Programming Challenge Questions
LinkIt Smart 7688 SDTs 19 Running OpenWrt Linux (Chaos Calmer) OS Loaded with a range of packages to enable the development of IoT device software Multiple programming options Duo only
OpenWrt ▪ Linux distribution focus on embedded devices • Started from 2004 • Typically wireless router • Full-featured, easily modifiable OS for routers ▪ A framework to build network applications • Free from the restriction and configuration provided by the vendor 20
OpenWrtPackages  Dropbear • A light-weight SSH server  cURL • Command line tool for transferring data with URL syntax  stty  UVC USB camera support • Kernel drivers for USB camera support  Python  pySerial • Library providing serial port access functions in Python  OpenSSL  Node.js  node-serialport • Library providing serial port access functions in JavaScript  Bridge library • Arduino Yun Bridge library  libmraa • C/C++ library with bindings to JavaScript and Python for I/O interface in Linux  UPM • A set of sensor drivers written in libmraa  AVAHI • Facilitates service discovery on a local network using the mDNS/DNS-SD protocol suite 21
Supported Programming Languages 22 Language Tools & Libraries Applications Host Platform C/C++ • Cross Compilation Tool Chain • System Programming • OS X • Linux Python • Python runtime on Linkit Smart 7688 • Prototyping • Network • IoT application • OS X • Linux • Windows Node.js • Node.js runtime on LinkIt Smart 7688 • Prototyping • Network • IoT application • OS X • Linux • Windows
Topics 23 Who is Mediatek What is MediaTek Labs LinkIt Smart 7688 HDK’s LinkIt Smart 7688 Software tools PERIPHERAL PROGRAMMING Challenge Questions
Peripheral Connections in LinkIt™ Smart 7688 Duo 24 Hardware MT7688 ATMega32U4 UART USB Device/SD Sensors Wi-Fi OpenWrt Arduino LinkIt Smart 7688 Duo : Hardware Architecture
Peripheral Programming Models 25 3 Programming Models Primitive UART Connection Firmata Protocol Arduino Yun Bridge Library
Peripheral Programming PrimitiveUARTConnection 26 Software Python Node.js UART port Sensor Drivers UART Library App Logic OpenWrt Arduino Sensors C
int c = Serial1.read(); if (c != -1) { switch(c) { case '0': digitalWrite(13, 0); break; case '1': digitalWrite(13, 1); break; } } s=serial.Serial("/dev/tty S0", 57600) def loop(): s.write("1") time.sleep(1) s.write("0") time.sleep(1) 27
28 Software Firmata Python Node.js Sensors Firmata App Logic OpenWrt Arduino C PeripheralProgramming FirmataProtocol
29 MCU – MPU Communication
Sketch provided by Library board = Arduino('/dev/ttyS0') while True: board.digital[13].write(1) sleep(0.5) board.digital[13].write(0) sleep(0.5) 30
31  PyFirmata • pip install pyfirmata • Example code : https://github.com/tino/pyFirmata • Arduino side : Use StandardFirmata Sketch  PyMata • pip install pymata • Example code : https://github.com/MrYsLab/PyMata • Arduino Side : Use FirmataPlus sketch ProgrammingwithFirmata Protocol
32 Software Sensors Bridge Library Sensor Drivers Bridge Library App Logic (MPU provides Wi-Fi & USB Host / SD) OpenWrt Arduino Peripheral Programming Bridge Library
Everything is controlled through Arduino Activate Bridge Library # uci set yunbridge.config. disabled=’0’ # uci commit # reboot 33 Arduino Bridge Library : https://www.arduino.cc/en/Reference/YunBridgeLibrary
BridgeLibrary  Process • Process is used to launch processes on the Linux processor, and other things like shell scripts.  Console • Console can be used to communicate with the network monitor in the Arduino IDE, through a shell. Functionally, it is very similar to Serial.  FileIO • An interface to the Linux file system. Can be used to read/write files on the SD card.  HttpClient • Creates a HTTP client on Linux. Acts as a wrapper for common CURL commands, by extending Process.  Mailbox • An asynchronous, session-less interface for communicating between Linux and Arduino.  And more... 34
MediaTek Cloud Sandbox  RESTful API’s  Visualize Data  FOTA  Data channels • Float • GPS location • Video • Pictures • Controllers 35
Hardware 36 LinkIt Smart 7688 Duo Breakout board Grove Sensors and Servo
LinkIt Smart 7688 Duo Testimonials 37 “I have recently decided to learn embedded Linux, and have bought over 14 different development kits. Though they all run Linux, they all have their pros and cons. So far out of all of them I have liked the MediaTek LinkIt Smart 7688 the best,” Mike Moy, Sr. Design Engineer, Versamodule.com
What’s Next ? 38 ▪ March 8th, 2016 - Bluetooth Low Energy communication with MediaTek LinkIt ONE ▪ March 17th, 2016 - From concept to consumer – make your IoT idea a commercial reality More Info : http://home.labs.mediatek.com/march- webinars-make-the-most-out-of-your-iot-project/
Questions? 39 Download Resources: labs.mediatek.com/7688 MediaTek Cloud Sandbox: labs.mediatek.com/mcs Check the Forum: labs.mediatek.com/forums
Copyright © MediaTek Inc. All rights reserved. 40

Peripheral Programming using Arduino and Python on MediaTek LinkIt Smart 7688 Duo

  • 1.
    AjithKP MediaTekLabs MediaTek LinkIt™ Smart 7688Duo : Peripheral Programming using Arduino & Python
  • 2.
    Topics 2 WHO IS MEDIATEK Whatis MediaTek Labs LinkIt Smart 7688 HDK’s LinkIt Smart 7688 Software tools Peripheral Programming Challenge Questions
  • 3.
    27 offices across 12countries A Global Company USA UK Denmark Sweden Dubai India Singapore Mainland China Korea Japan Finland Taiwan Hsinchu HQ 3
  • 4.
    Source (ranking byrevenue of 2014): Strategy Analytics, Gartner, IDC, IC Insight, iSuppli and MediaTek company data * Combined with MStar. Source (Rankings by volume): Strategy Analytics, Displaysearch, iSuppli , MediaTek company data Feature phone #1 Digital TV* #1 Optical disc drive #1 DVD/BD player #1 Smartphone #2 Tablets #2 Connectivity network #3 Leading Market Position with Cross-Platform Synergy 2016-03-03Copyright © MediaTek Inc. All rights reserved. 4
  • 5.
    MediaTek Powered Products 5 ▪New Amazon Kindle Tablets▪ Sony Android TVSmartphone HTC M9+ / Sony Xperia E4
  • 6.
    Topics 6 Who is Mediatek WHATIS MEDIATEK LABS LinkIt Smart 7688 HDK’s LinkIt Smart 7688 Software tools Peripheral Programming Challenge Questions
  • 7.
    MediaTek Labs ADeveloper CentricEcosystem ̶ Global program – free to join ̶ Supporting developers: ̶ Device creation ̶ App development ̶ Services ̶ labs.mediatek.com
  • 8.
    2016-03-03Copyright © MediaTekInc. All rights reserved. 8 Enabling Developer and Maker Success ̶ Dev resources ̶ Insights and inspiration ̶ Access to hardware ̶ SDKs for makers (Arduino), professional developers (C/Eclipse) and Linux (OpenWrt and Ubuntu) ̶ Technical support ̶ Peripherals (sensors, etc) ̶ Cloud management of device data ̶ Developer advice & matchmaking ̶ Design, production & go-to-market help Go from idea to prototype to product
  • 9.
    MediaTek LinkIt™ portfolio Softwareand hardware development platforms for wearables & IoT Copyright © MediaTek Inc. All rights reserved. LinkIt Assist 2502 labs.mediatek.com/2502 ̶ Wearable form factors ̶ For professional developers (C/Eclipse) LinkIt ONE labs.mediatek.com/linkitone ̶ Unrivalled connectivity on a single board ̶ For DIY & maker community (Arduino) LinkIt Connect 7681 labs.mediatek.com/7681 ̶ The simple way to Wi-Fi enable your devices ̶ For low-cost smart home or office deployment LinkIt Smart 7688 labs.mediatek.com/7688 ̶ Open-source Wi-Fi platform for a more connected world ̶ OpenWrt Linux, Python, Node.js, Arduino
  • 10.
    2016-03-03Copyright © MediaTekInc. All rights reserved. 10 RapidlygrowingLinkItcommunity
  • 11.
    Topics 11 Who is Mediatek Whatis MediaTek Labs LINKIT SMART 7688 HDK’S LinkIt Smart 7688 Software tools Peripheral Programming Challenge Questions
  • 12.
    MediaTekLinkIt™Smart7688 Theopen-source Wi-Fiplatform foramore connectedworld 12 System-on-Chip MediaTek MT7688AN, a highly Integrated compact SoC for IoT devices with Wi-Fi connectivity Software Dev Tools • OpenWrt • Python & Node.js • Arduino Plug-in LinkIt Smart 7688 HDKs • LinkIt Smart 7688 HDK with MT7688 MPU • LinkIt Smart 7688 Duo with MT7688 MPU + MCU • Firmware & bootloader
  • 13.
    LinkIt Smart 7688HDKs 13 LinkIt Smart 7688 Duo (Arduino Compatible) LinkIt Smart 7688 Two versions of HDK Run OpenWrt Linux Multiple programming options
  • 14.
  • 15.
    15 USB Host USB Power& MCU USB port MPU Reset Button Wi-Fi Reset Button MCU Reset Button MT7688AN + 128MB DDR2 (Under shielding cover) Micro SD Slot Atmega32U4 32 MB Flash LinkItSmart7688Duo
  • 16.
    Hardware Spec ▪ MPU& MCU • MT7688 - 580MHz MIPS 24KEc CPU • ATmega32U4 ▪ Memory • Flash 32MB • RAM 128MB DDR2 • SD card ▪ Power • USB 5 V ▪ Digital I/O • 24 pins + (3 pins on the MT7688AN) ▪ Analog Input • 12 pins
  • 17.
    Hardware Spec  ExternalInterrupts • 8 pins (S0, S1, S2, S3, D8, D9, D10, D11)  I2C • 1 set  SPI • 1 set (Master & Slave)  UART • UART Lite  1 Set MT7688AN  1 Set ATmega32U4 • UART host  1 Set MT7688AN  Wi-Fi • 802.11 b/g/n (2.4G)  PWM • 8 pins (D3, D5, D6, D9, D10, D11, D12, D13 )
  • 18.
    Topics 18 Who is Mediatek Whatis MediaTek Labs LinkIt Smart 7688 HDK’s LINKIT SMART 7688 SOFTWARE TOOLS Peripheral Programming Challenge Questions
  • 19.
    LinkIt Smart 7688SDTs 19 Running OpenWrt Linux (Chaos Calmer) OS Loaded with a range of packages to enable the development of IoT device software Multiple programming options Duo only
  • 20.
    OpenWrt ▪ Linux distributionfocus on embedded devices • Started from 2004 • Typically wireless router • Full-featured, easily modifiable OS for routers ▪ A framework to build network applications • Free from the restriction and configuration provided by the vendor 20
  • 21.
    OpenWrtPackages  Dropbear • Alight-weight SSH server  cURL • Command line tool for transferring data with URL syntax  stty  UVC USB camera support • Kernel drivers for USB camera support  Python  pySerial • Library providing serial port access functions in Python  OpenSSL  Node.js  node-serialport • Library providing serial port access functions in JavaScript  Bridge library • Arduino Yun Bridge library  libmraa • C/C++ library with bindings to JavaScript and Python for I/O interface in Linux  UPM • A set of sensor drivers written in libmraa  AVAHI • Facilitates service discovery on a local network using the mDNS/DNS-SD protocol suite 21
  • 22.
    Supported Programming Languages 22 LanguageTools & Libraries Applications Host Platform C/C++ • Cross Compilation Tool Chain • System Programming • OS X • Linux Python • Python runtime on Linkit Smart 7688 • Prototyping • Network • IoT application • OS X • Linux • Windows Node.js • Node.js runtime on LinkIt Smart 7688 • Prototyping • Network • IoT application • OS X • Linux • Windows
  • 23.
    Topics 23 Who is Mediatek Whatis MediaTek Labs LinkIt Smart 7688 HDK’s LinkIt Smart 7688 Software tools PERIPHERAL PROGRAMMING Challenge Questions
  • 24.
    Peripheral Connections in LinkIt™Smart 7688 Duo 24 Hardware MT7688 ATMega32U4 UART USB Device/SD Sensors Wi-Fi OpenWrt Arduino LinkIt Smart 7688 Duo : Hardware Architecture
  • 25.
    Peripheral Programming Models 25 3Programming Models Primitive UART Connection Firmata Protocol Arduino Yun Bridge Library
  • 26.
    Peripheral Programming PrimitiveUARTConnection 26 Software Python Node.js UARTport Sensor Drivers UART Library App Logic OpenWrt Arduino Sensors C
  • 27.
    int c =Serial1.read(); if (c != -1) { switch(c) { case '0': digitalWrite(13, 0); break; case '1': digitalWrite(13, 1); break; } } s=serial.Serial("/dev/tty S0", 57600) def loop(): s.write("1") time.sleep(1) s.write("0") time.sleep(1) 27
  • 28.
  • 29.
    29 MCU – MPUCommunication
  • 30.
    Sketch provided by Library board =Arduino('/dev/ttyS0') while True: board.digital[13].write(1) sleep(0.5) board.digital[13].write(0) sleep(0.5) 30
  • 31.
    31  PyFirmata • pipinstall pyfirmata • Example code : https://github.com/tino/pyFirmata • Arduino side : Use StandardFirmata Sketch  PyMata • pip install pymata • Example code : https://github.com/MrYsLab/PyMata • Arduino Side : Use FirmataPlus sketch ProgrammingwithFirmata Protocol
  • 32.
    32 Software Sensors Bridge Library Sensor Drivers BridgeLibrary App Logic (MPU provides Wi-Fi & USB Host / SD) OpenWrt Arduino Peripheral Programming Bridge Library
  • 33.
    Everything is controlled through Arduino ActivateBridge Library # uci set yunbridge.config. disabled=’0’ # uci commit # reboot 33 Arduino Bridge Library : https://www.arduino.cc/en/Reference/YunBridgeLibrary
  • 34.
    BridgeLibrary  Process • Processis used to launch processes on the Linux processor, and other things like shell scripts.  Console • Console can be used to communicate with the network monitor in the Arduino IDE, through a shell. Functionally, it is very similar to Serial.  FileIO • An interface to the Linux file system. Can be used to read/write files on the SD card.  HttpClient • Creates a HTTP client on Linux. Acts as a wrapper for common CURL commands, by extending Process.  Mailbox • An asynchronous, session-less interface for communicating between Linux and Arduino.  And more... 34
  • 35.
    MediaTek Cloud Sandbox RESTful API’s  Visualize Data  FOTA  Data channels • Float • GPS location • Video • Pictures • Controllers 35
  • 36.
    Hardware 36 LinkIt Smart 7688 Duo Breakoutboard Grove Sensors and Servo
  • 37.
    LinkIt Smart 7688Duo Testimonials 37 “I have recently decided to learn embedded Linux, and have bought over 14 different development kits. Though they all run Linux, they all have their pros and cons. So far out of all of them I have liked the MediaTek LinkIt Smart 7688 the best,” Mike Moy, Sr. Design Engineer, Versamodule.com
  • 38.
    What’s Next ? 38 ▪March 8th, 2016 - Bluetooth Low Energy communication with MediaTek LinkIt ONE ▪ March 17th, 2016 - From concept to consumer – make your IoT idea a commercial reality More Info : http://home.labs.mediatek.com/march- webinars-make-the-most-out-of-your-iot-project/
  • 39.
    Questions? 39 Download Resources: labs.mediatek.com/7688 MediaTek CloudSandbox: labs.mediatek.com/mcs Check the Forum: labs.mediatek.com/forums
  • 40.
    Copyright © MediaTekInc. All rights reserved. 40