Skip to main content

OctopusLab installer for MicroPython

Project description

OctopusLab Init Lite

This module facilitates provisioning of ESP32 boards with MicroPython projects.

We use it for deployment of OctopusLab tools on ESP32 boards (all examples bellow), but it may work on other MicroPython ports as well.

Purpose of this tool is to download a .tar file and unpack it to the file storage over existing content.

Alternatively tar archive si stored locally for later offline restore a.k.a. factory reset.

In the future optional wipe of dangling files will be added.

How to use?

Bootstrap your ESP32 with latest MicroPython documentation

esptool.py --port /dev/ttyUSB0 erase_flash
esptool.py --chip esp32 --port /dev/ttyUSB0 write_flash -z 0x1000 esp32-idf3-20200902-v1.13.bin
screen /dev/ttyUSB0 115200

Connect to WiFi

import network
wlan = network.WLAN(network.STA_IF)
wlan.active(True)
wlan.connect('essid', 'password')

Install

import upip
upip.install('micropython-octopuslab-installer')

Run

from octopuslab_installer import deploy
deploy()

After this OctopusLab from https://octopusengine.org/download/micropython/stable.tar is installed in your ESP don't forget to reboot.

Please proceed with inital configuration of your OctopusLab enabled board as per documentation

Alternative images

You may like to install an image from your custom location.

from octopuslab_installer import deploy
deploy('http://192.168.1.100:8000/latest.tar')

Optionally you may store downloaded image for later offline restore.

from octopuslab_installer import deploy
deploy('https://www.dtlab.cz/download/sensobox/latest.tar', '/img/latest.tar')

Then you may redeploy offline from the local file as follows. This may be used for "factory reset" of your device.

from octopuslab_installer import deploy
deploy('/img/latest.tar')

Also you may use wifi connection shortcut if you redeploy updated image and you've lost connection e.g. due to a reboot.

from octopuslab_installer import connect
connect('myssid', 'mypass')

Build and publish new version of this module

# initial setup of build environment
git clone git@github.com:octopusengine/octopuslab-installer.git
cd octopuslab-installer/
python3 -m venv venv
source ./venv/bin/activate
pip install --upgrade wheel setuptools

# PyPi publisher and authorisation
pip install --upgrade twine
mcedit ~/.pypirc
chmod o-rwx ~/.pypirc

# build command
python setup.py sdist

# publish
twine upload -r pypi dist/*

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

micropython-octopuslab-installer-0.2.6.tar.gz (3.8 kB view details)

Uploaded Source

File details

Details for the file micropython-octopuslab-installer-0.2.6.tar.gz.

File metadata

  • Download URL: micropython-octopuslab-installer-0.2.6.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.10

File hashes

Hashes for micropython-octopuslab-installer-0.2.6.tar.gz
Algorithm Hash digest
SHA256 68d84322564f794517132f4e5a9027ff025fcea972c688c51a845007fa194368
MD5 d879345207e7b83fae5a34f5aed9b0b8
BLAKE2b-256 9ce75bc805fe0509d9835a6e5cae89cf63e8de9f11da6ddb3d30a92d6dc73926

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page