Operate the Terkin-Sandbox using the MicroTerkin Agent

Quick development iterations from the command line

Introduction

The development cycle has been improved recently. After discovering the device on the local network through the MicroTerkin Agent, it will put its IP address into a local file ".terkin/floatip" [1]. From there, the file synchronization/upload tools can pick it up for efficiently transferring files using FTP.

Synopsis

You might want to prepare these guys in individual terminals as some of them behave like a daemon actually.

# 1. Terminal: Run the MicroTerkin Agent
make terkin-agent action=monitor

# 2. Terminal: Start the console to watch logging output
make console

# 3. Terminal: Transfer files over the network using FTP
make recycle-ng

# 3.b Variant: Use mpy-cross for ahead-of-time bytecode compilation
make recycle-ng MPY_CROSS=true MPY_TARGET=pycom MPY_VERSION=1.9.4

# 4. Terminal: Send request to the HTTP API
http "http://$(cat .terkin/floatip)/status"

Description

Uploading the source code files to the device efficiently is easy and boils down to

# Synchronize files over the IP network
make recycle-ng

It will transfer the source code files using FTP and restart the device using the HTTP API. [2]

If you don’t run the MicroTerkin Agent [3], you can always put the IP address of your device into the .terkin/floatip file and everything will be the same [4].

Have fun!


  1. This is just a basic implementation we will expand later. Ping @roh. ↩︎

  2. There’s no need to think about "export MCU_PORT={ip address}" anymore, just fire up the MicroTerkin Agent and you are set. ↩︎

  3. As it is currently rather heavyweight on dependencies, we would understand that. ↩︎

  4. You can pin your MAC address to a specific IP address to keep it stable, so there is no need for the MicroTerkin Agent at all. However, you will need the permissions to manage your local WiFi router in order to perform such operations. ↩︎