Wednesday, February 23, 2022

Raspberry Pi Pico/MicroPython: get MicroPython version programmatically

A simple exercise run on Raspberry Pi Pico/MicroPython to get installed MicroPython version programmatically.


mpyPico_info.py

import uos
import usys

class color:
    BLACK =   '\033[1;30;48m'
    RED =     '\033[1;31;48m'
    GREEN =   '\033[1;32;48m'
    YELLOW =  '\033[1;33;48m'
    BLUE =    '\033[1;34;48m'
    MAGENTA = '\033[1;35;48m'
    CYAN =    '\033[1;36;48m'
    END =    '\033[1;37;0m'

#print(uos.uname())
#print(usys.implementation)

print("====================================================")
print(color.BLUE, usys.implementation[0],
      str(usys.implementation[1][0]) + "." +
      str(usys.implementation[1][1]) + "." +
      str(usys.implementation[1][2]), color.END)
print(uos.uname()[3])
print("run on", color.RED, uos.uname()[4], color.END)
print("====================================================")





~ more exercises for Raspberry Pi Pico

Saturday, February 5, 2022

How to check running Raspberry Pi OS version, 32 bit or 64 bit.

To check the bit size (32 bit or 64 bit) of the running Raspberry Pi OS, you can enter the commands:

$ uname -m
aarch64

or:

$ arch
aarch64

You can also check the bit size of the Linux kernel with:

$ getconf LONG_BIT
64

Tested on Raspberry Pi 4B running Raspberry Pi OS 64-bit (bullseye):

Tested on Raspberry Pi 4B running Raspberry Pi OS 32-bit (buster):