MicroPython Application Development on F1

 

Device Programming via UART

  • By default, the F1 Smart Module runs an interactive python REPL (Read-Eval-Print-Loop) on UART0 which is connected to P0 (RX) and P1 (TX) running at 115200 baud.
  • The Module can be connected via a development board or any USB UART adapter. Code can be run via the REPL and the SG Wireless CtrlR. Visual Studio Code plug-in can also be used to upload code to the board.

 

Module-supported Libraries

Table 9: F1 Smart Module Supported Libraries

Library Min
Python Standard Libraries* array, aysncio, binascii, builtins, cmath, collections, errno, gc, gzip, hashlib, heapq, io, json, math, os, platform, random, re, select, socket, ssl, struct, sys, time, zlib, _thread
MicroPython-specific Libraries* Bluetooth, btree, cryptolib, deflate, framebuf, machine, micropython, neopixel, network, uctypes, esp, esp32
SGW3501 Module-specific Libraries† lte: Ready-to-use LTE CAT-M1/NB1/NB2 library
lora: Ready-to-use LoRa RAW and full stack LoRa WAN device Class A, Class C library
ctrl: Ready-to-use Ctrl Cloud Platform client library

* MicroPython documentation library with API function calls (https://docs.micropython.org/). Libraries may vary by version – please check latest F1 Module firmware release note for required library (pre-loaded onto Module).
† SG Wireless SGW3501 Module documentation library with API function calls.

 

MicroPython Capability – REPL (Read-Eval-Print Loop)

The MicroPython-ready SGW3501 Module carries the REPL shell that that can execute codes in realtime, as well as enable section-by-section of code execution through a copy-and-paste function, both of which facilitate real-time debugging and instant application code prototyping.

Figure 7: F1 Smart Module Code Sample in REPL Shell