up device id

This commit is contained in:
Tomas Krejci 2024-05-28 18:57:20 +02:00
parent 12fec2f5ec
commit 65b0f86732

View File

@ -14,6 +14,10 @@ else:
from pyb import Pin, LED
import uasyncio as asyncio
device_id = ""
for b in machine.unique_id():
device_id += "{:02X}".format(b)
# device_id_hex = int(device_id)
#### BLE UART ###
import ble_uart
@ -26,7 +30,7 @@ def print_handler():
ble = bluetooth.BLE()
uart = ble_uart.Ble_uart(ble, on_rx=print_handler, name="OpenLaserTag Device")
uart = ble_uart.Ble_uart(ble, on_rx=print_handler, name=print("LaserTag"))
#### OLT IR RX imports ###
import ustruct
@ -151,6 +155,8 @@ async def cb(byte1, byte2, byte3, packet):
async def main(proto):
logger.debug("main start")
print(f"Device ID: {device_id}")
### alive check ###
asyncio.create_task(alive_check())