Programming In Node.js - MEDIATEK LinkIt Smart 7688 Developer's Manual

Hide thumbs Also See for LinkIt Smart 7688:
Table of Contents

Advertisement

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
command in the system console to install the packages. For example:
pip install requests
This example installs the popular
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 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
The installation still succeeds because simplejson provides a pure-python implementation as an
alternative – the 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 you've 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.
Open a system console via SSH and create a folder named
1)
mkdir example
cd example
Create a file named
2)
vim app.js
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.
MediaTek LinkIt™ Smart 7688 Developer's Guide
for a list of available packages. You can use pip install
here
requests
module, which helps you generate HTTP requests
app.js
using vi editor.
© 2015, 2016 MediaTek Inc.
app
.
Page 32

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents