Skip to content
forked from bcr/blinka-cli

Command-line utility for performing CircuitPython operations

License

Notifications You must be signed in to change notification settings

sengeiou/blinka-cli

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The Blinka Command-Line Interface

This is intended to provide various useful commands for maintaining CircuitPython devices.

Running

PS C:\Users\bcr00\Source\bcr\blinka-cli> python -m blinka --help
usage: python -m blinka [-h] [-v] [-l LOCALE] {backup,bossa,bootloader,update,sync,port,font} ...

Perform CircuitPython operations.

optional arguments:
  -h, --help            show this help message and exit
  -v, --verbose         be chatty
  -l LOCALE, --locale LOCALE
                        specify the locale (default: en_US)

subcommands:
  {backup,bossa,bootloader,update,sync,port,font}
                        specify which operation to perform, use --help after the operation for operation-specific help

Commands

Backup

Update (coming soon)

Tasks

  • Back up CircuitPython contents
  • Maintain CircuitPython
    • Compare version and upgrade if newer version available
    • Allow for installing pre-release version
    • Force reinstall of current version
    • Force install a particular version
  • Maintain libraries
    • Force reinstall of installed libraries to corresponding CircuitPython version

Installation Details

Make sure the requirements are installed per requirements.txt

Observations About Namespaces

Within CircuitPython there are a lot of different places where there are name / numberspaces:

  • Processors
    • M0, M4
    • SAMD21, SAMD51
  • Platform identifiers (from user mode)
    • Adafruit Feather M0 RFM69 with samd21g18
    • Adafruit PyPortal with samd51j20
  • Board IDs (firmware root names)
    • feather_m0_rfm69
    • pyportal_titano
    • adafruit_magtag_2.9_grayscale
  • Board-ID from bootloader INFO_UF2.TXT
    • MagTag-29gray-revC (different than board ID adafruit_magtag_2.9_grayscale in firmware root name)
  • USB VID / PID
    • Adafruit VID
    • PIDs differ between bootloader and user mode COM ports
  • Mounted disk volume labels
    • CIRCUITPY for user mode
      • Can be renamed by user, so not reliable
    • LOTS for bootloader mode
      • BOOT is used a lot for a suffix
      • shIRtty mixed case, no BOOT
      • ARCADE-D5 dash, no BOOT
      • Grove Zero mixed case, space in name, no BOOT
  • os.uname() information
    • (sysname='samd51', nodename='samd51', release='6.0.0', version='6.0.0 on 2020-11-16', machine='Adafruit PyPortal Titano with samd51j20')

Some problems I have encountered:

  • In bootloader mode there is not enough information to find the Board ID (in this case, is it a Titano? I know first-hand that the Titano firmware is materially different than the non-Titano PyPortal)
PS C:\Users\bcr00\Source\bcr\blinka-cli> type E:\INFO_UF2.TXT
UF2 Bootloader v1.23.1-adafruit.1-89-gcfdd5ba SFHWRO
Model: PyPortal M4 Express
Board-ID: SAMD51J20A-PyPortal-v0
  • Mapping from the Platform Identifer to the Board ID seems fragile
    • Other manufacturers may not be as careful with naming
      • J&J Studios datum-Distance with None -- the None processor
      • SparkFun Qwiic Micro with samd21e18 -- there is both sparkfun_qwiic_micro_no_flash and sparkfun_qwiic_micro_with_flash with this Platform Identifier
      • ndGarage[n°] Bit6: FeatherSnow-v2 with samd21e18 -- a UTF-8 party

About

Command-line utility for performing CircuitPython operations

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%