Obtaining Terminal ID with Raspberry PI Pico
Raspberry-Pi
2023-01-22 02:26 (3 years ago)

How to Obtain Terminal ID with Raspberry Pi Pico
import machine
import binascii
device_id = binascii.hexlify(machine.unique_id()).decode()
print(device_id)
Result
d66a64xxxxxxxxxx
You can achieve this by using machine.unique_id().
The result can be obtained as binary data, which might be difficult to use as it is. Therefore, it is a good idea to convert it to a string using either binascii or base64.
binascii comes standard with MicroPython.
Additional Information
>>> machine.unique_id()
b'\xe6axxxxxxxx'
>>> binascii.hexlify(machine.unique_id())
b'e66164xxxxxxxxxx'
>>> binascii.hexlify(machine.unique_id()).decode()
'e66164xxxxxxxxxx'
Please rate this article (No signup or login required)
Currently unrated
Related posts
VNC on Raspberry Pi OS Bookworm (Debian 12) Cannot Connect from Mac, and Cursor Behavior Rotates when Screen is Rotated
When Copying Files to Raspberry PI Pico or RP2040 on Mac OS Sonoma Results in Input/Output Error
Installing k3s Kubernetes on Raspberry Pi (Raspbian)
Operating a 128x64 OLED LCD Display with Raspberry Pi
The author runs the application development company Cyberneura.
We look forward to discussing your development needs.
We look forward to discussing your development needs.