Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 22 Current »

Expected completion time of this lab: 20min.

Every time you see C:\Users\Thomas\Desktop\ in these instructions, replace it with the correct path for your desktop.

Download Source Code

  • Download the following code on your computer's desktop:

What?

Why?

Where?

SmartMesh SDK

A collection of programs to interact with your SmartMesh IP network

https://github.com/dustcloud/smartmeshsdk/tree/develop

Note that we are using Git branch develop, which is the one that currently supports Python 3.

How do I download?

The links above point to source repositories on Github.com. To download the code, click on:

  • Unzip the source code on your computer's desktop

Python 3.9

Why?

All source code is written in Python. You need to install Python on your computer to run the source code.

Make sure you add python.exe to your path during the installation process.

  • Install the Python packages needed by the SmartMesh SDK by typing the following command:

C:\Users\Thomas\Desktop\smartmeshsdk-develop>pip install -r requirements.txt

What is pip?

pip is a utility which comes with Python, and which automatically downloads and installs packages listed in a requirements.txt file.

When am I done?

Double-click on C:\Users\Thomas\Desktop\smartmeshsdk-master\app\JsonServer\JsonServer.py to verify the program starts well:

We will not use that program until much later, close it for now.


If you get the following error when running Python, make sure the Python executable path is present in you system PATH variable:

'python' is not recognized as an internal of external command

Node-RED

Why?

You will use Node-RED (https://nodered.org/) to connect your SmartMesh IP network to different back-end systems, and build a dashboard.

  • First, install Node.js. There a number of options. On my Windows machine, it just means downloading an installer and clicking through the default installation options.

  • You can verify Node.js is installed by entering the following command (npm is the "node package manager", part of Node.js)

C:\Users\twatteyne>npm --version
2.15.9
  • You install Node-RED through npm:
npm install -g --unsafe-perm node-red
  • Finally, you can start Node-RED:
C:\Users\twatteyne>node-red

Welcome to Node-RED
===================

1 Sep 15:02:04 - [info] Node-RED version: v0.14.6
1 Sep 15:02:04 - [info] Node.js  version: v4.5.0
1 Sep 15:02:04 - [info] Windows_NT 6.1.7601 x64 LE
1 Sep 15:02:04 - [info] Loading palette nodes
1 Sep 15:02:05 - [warn] ------------------------------------------------------
1 Sep 15:02:05 - [warn] [rpi-gpio] Info : Ignoring Raspberry Pi specific node
1 Sep 15:02:05 - [warn] [tail] Not currently supported on Windows.
1 Sep 15:02:05 - [warn] ------------------------------------------------------
1 Sep 15:02:05 - [info] Settings file  : C:\Users\twatteyne\AppData\Roaming\npm\
node_modules\node-red\settings.js
1 Sep 15:02:05 - [info] User directory : \Users\twatteyne\.node-red
1 Sep 15:02:05 - [info] Flows file     : \Users\twatteyne\.node-red\flows_HDC_SW
01.json
1 Sep 15:02:05 - [info] Creating new flow file
1 Sep 15:02:05 - [info] Starting flows
1 Sep 15:02:05 - [info] Started flows
1 Sep 15:02:05 - [info] Server now running at http://127.0.0.1:1880/
  • Point your browser to http://localhost:1880/ to see the Node-RED web interface:

    Geeky details

    As you can see from the URL above, the Node-RED application starts a web server which listens on port 1880.


Following the excellent Getting Started guide if you want to learn more about Node-RED.

FTDI drivers

FTDI is the make of a chip on the SmartMesh IP motes. You need the driver of that chip on your computer. This is normally already installed, so you can probably skip this step. On older Windows computers, this driver isn't included by default.


On Windows, download and install the setup executable for easier use.


Serial Terminal

Make sure you have a serial terminal program (PuTTY, TeraTerm, etc) installed on your computer, and that you know how to use it to open/close a serial port.

If you are using MACOS, you don't have to install anything. You can use the built-in package called "screen".

Microsoft Excel

You will use Microsoft Excel in Lab 10. Performance estimator. Make sure each group has at least one computer that has it installed.

  • No labels