Obtaining Terminal ID with Raspberry PI Pico
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'
Related posts
Using CircuitPython on the HW-394 ESP-WROOM-32 (ESP32) Development Board
When Copying Files to Raspberry PI Pico or RP2040 on Mac OS Sonoma Results in Input/Output Error
Displaying Serial Console Output (Viewing Standard Output When Installing CircuitPython on Raspberry Pi Pico)
Turning a Raspberry Pi into digital signage — maximizing Chromium with Playwright automation
Please rate this article (No signup or login required)
Currently unrated
The author runs the application development company Cyberneura.
We look forward to discussing your development needs.
We look forward to discussing your development needs.