Note: This document supersedes the documentation at Operate the Hiveeyes MicroPython Datalogger sandbox ff. in form of a living document until further notice. At some time in the future, this will be refactored back to the original documentation after becoming mature enough.
Introduction
This part of the documentation covers the installation and operation of the development environment for the Terkin Datalogger Firmware. The first step to using any software package is getting it properly installed. Please read these sections carefully.
Getting started
-
For setting up the sandbox environment, please follow the documentation at Setup Hiveeyes MicroPython Datalogger sandbox thoroughly.
-
After the baseline setup works for you, you will be happy to read about how a typical development cycle works when hacking within the sandbox. The next section of this document outlines important details about these aspects, please read this section attentively.
Refresh environment
# Update sources
git pull
# Setup environment
make setup
Connect and prepare device
# Attach device to USB
echo "Ready."
# Inquire serial ports
make list-serials
# Define USB port
export MCU_PORT=/dev/cu.usbmodemPy001711
# Verify board communication
make list-boards
# Install most recent development firmware for FiPy devices
# 1.20.0.rc11 [v1.9.4-0a38f88] on 2019-05-14
make install-pycom-firmware
# Format filesystem partition with LittleFS
make format-flash
Bring device into local network
… and get hold of it.
There are two variants here. The first variant is for bringing an unprovisioned or crashed device into the local network in an ad hoc manner. The second variant outlines how to pull a device already running in live mode from deep sleep and how to attach to it over the network.
Please remember the device is still connected using USB here, so defining the serial port is obligatory.
# Define USB port
export MCU_PORT=/dev/cu.usbmodemPy001711
1. Start networking for an unprovisioned device and get IP address
There are two ways. Either
a) Connect your workstation to the access point the device is creating by factory default. See Wie bekomme ich bei Erst-Inbetriebnahme des FiPys meine WLAN-Zugangsdaten aufs Gerät?. You can find out about its IP address without network scanning by invoking
make ip-address
b) Make the device connect to your local network and print out its IP address by invoking
make connect-wifi ssid=YourNetwork password=YourPassword
c) Make the device spin up a WiFi access point by invoking
make provide-wifi
We are collecting the factory default credentials at Wie bekomme ich bei Erst-Inbetriebnahme des FiPys meine WLAN-Zugangsdaten aufs Gerät? - #5 by Andreas
2. Discover live device on the network, pull it into maintenance mode and get IP address
To learn about the background and concept of live- vs. maintenance-mode, we recommend to take a short look at Wartungsmodus für den Terkin-Datenlogger ff.
The designated utility for this job is Terkin Agent, which gives you reasonable convenience and peace of mind by pulling the right strings for you.
# Discover device and pull it into maintenance mode
make terkin-agent action=maintain
The MicroTerkin Agent will keep running in order to monitor the local network for IP address changes of devices of interest designated through their respective hardware MAC address. When finding a matching device, it will put its IP address into the file terkin/floatip
for other programs to pick up.
Installation
Detailed steps about how to install this software friend are available within the “Setup” section at Wartungsmodus für den Terkin-Datenlogger.