from machine import Pin, I2C, UART
import utime
from ustruct import unpack
import time
checkCardCmd = bytes([0xff,0x00,0x01,0x83,0x84])
getFirmwareVersionCmd = bytes([0xff,0x00,0x01,0x81,0x82])
uart = UART(1, baudrate=19200, bits=8, parity=None, stop=1)
while True:
# Check if card is present
uart.write(checkCardCmd)
val = uart.read()
print(val)
utime.sleep_ms(250)
When a card is presented on the NFC reader I get this back from val
b'\xff\x00\x06\x83\x02\x01#Eg['
This is the reply to the checkCardCmd
. I have no clue why it ends with #Eg[
also the reply for no card found comes back as b'\xff\x00\x02\x83N\xd3'
notice the N
character on the 4th byte, that should just be x83
.
Baud Rate is correct and with similar code in NodeJS I get the proper response from UART without the extra N
or #Eg]
What am I missing here?