Gathered scripts

This commit is contained in:
2025-12-14 14:59:47 +01:00
parent 76eb0f8862
commit 83eee81712
8 changed files with 36 additions and 5 deletions

View File

@@ -1,11 +1,12 @@
#=========Custom=========
requests >= 2.32.5
python-dotenv >= 1.2.1
pyyaml >= 6.0.3
#=========OpenApi========= #=========OpenApi=========
python_dateutil >= 2.5.3 python_dateutil >= 2.5.3
setuptools >= 21.0.0 setuptools >= 21.0.0
urllib3 >= 1.25.3, < 2.1.0 urllib3 >= 1.25.3, < 2.1.0
pydantic >= 2 pydantic >= 2
typing-extensions >= 4.7.1 typing-extensions >= 4.7.1
#=========Custom=========
requests >= 2.32.5
python-dotenv >= 1.2.1
pyyaml >= 6.0.3
pyserial

0
rpi/scripts/__init__.py Normal file
View File

View File

30
rpi/scripts/rfid/main.py Normal file
View File

@@ -0,0 +1,30 @@
#!/usr/bin/env python3
import serial
import time
from grovepi import *
ser = serial.Serial("/dev/ttyS0", baudrate=9600, timeout=1)
ser.flush()
while True:
data = b""
print(data)
while len(data) < 14:
c = ser.read(1)
if c:
data += c
else:
continue
if len(data) >= 11:
hex_value = data[5:11].decode(errors='ignore')
try:
res = int(hex_value, 16)
print(res)
except ValueError:
print("Invalid hex:", hex_value)
else:
print("Received incomplete data:", data)

View File