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
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.