User manual

MediaTek LinkIt™ Smart 7688 Developer's Guide
© 2015, 2016 MediaTek Inc.
Page 32
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.
3.7.3. Installing additional modules in Python
Python comes with a default package manager utility called pip. You can use this utility to install
additional Python modules. To use it, first make sure your board is connected to the Internet as
described in 4.6.5, Connecting LinkIt Smart 7688 to a Wi-Fi Access Point To Access Internet” or
Get Started guide, and check
here for a list of available packages. You can use pip install
command in the system console to install the packages. For example:
pip install requests
This example installs the popular requests module, which helps you generate HTTP requests
easily.
Note that some Python packages that rely on native C/C++ implementation may fallback to
Python implementations or fail to install at all because there isnt 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
The installation still succeeds because simplejson provides a pure-python implementation as an
alternativethe module still works but may be slower than its native counterparts.
3.8. Programming in Node.js
Node.js programming environment in LinkIt Smart 7688 is similar to Python - use a text editor and
a file transfer tool to execute the program or use SSH to create your Node.js programs.
Before you start, please make sure youve connected to LinkIt Smart 7688 via SSH. If you need
more information please see section 4.5.4.1, Using SSH (Secure Socket Shell)”.
3.8.1. Hello World Example in Node.js
This example executes in the LinkIt Smart 7688 console directly.
1) Open a system console via SSH and create a folder named app.
mkdir example
cd example
2) Create a file named app.js using vi editor.
vim app.js