Skip to content

uhf-rfid on Core2 sometimes generates ValueError: buffer too small #89

@kmpm

Description

@kmpm
  • UiFlow 2.4.3
  • Device: Core2
  • UHF-RFID unit connected on Port A.
  • MicroPython v1.27.0-dirty on 2026-03-19; M5STACK Core2 with ESP32(SPIRAM)

When I added verbose=True to the setup line uhfrfid_0 = UHFRFIDUnit(2, port=(33, 32), verbose=True) I got some more output that might be helpful. I also annotated the output for clarification.

I made a forum post about the same issue https://forum.m5stack.com/topic/8156/valueerror-buffer-to-small-when-using-uhf-rfid-with-core2

      _  __ _               
 _   _(_)/ _| | _____      __
| | | | | |_| |/ _ \ \ /\ / /
| |_| | |  _| | (_) \ V  V / 
 \__,_|_|_| |_|\___/ \_/\_/  V2.4.3

[INFO] Syncing resources...
[INFO] Network connected!

##### Initializing 
Frame to send: bb 00 07 00 01 03 0b 7e
Recv buffer: bb 01 07 00 01 00 09 7e
Frame to send: bb 00 b6 00 02 0a 28 ea 7e
Recv buffer: bb 01 b6 00 01 00 b8 7e

##### Reading a tag 1
Frame to send: bb 00 22 00 00 22 7e
Recv buffer: bb 02 22 00 11 cf 30 00 e2 80 69 95 00 00 50 09 f1 28 69 92 62 0a 6d 7e
RSSI: 207, PC: 12288, EPC: b'\xe2\x80i\x95\x00\x00P\t\xf1(i\x92', CRC: 25098

##### Reading tag 2
Frame to send: bb 00 22 00 00 22 7e
Recv buffer: bb 02 22 00 11 ca 34 00 30 0e d8 9f 33 50 01 5a 1e 3d f5 06 06 90 b2 7e
RSSI: 202, PC: 13312, EPC: b'0\x0e\xd8\x9f3P\x01Z\x1e=\xf5\x06', CRC: 1680

##### Reading tag 3
Frame to send: bb 00 22 00 00 22 7e
Recv buffer: bb 02 22 00 11 c5 34 00 30 02 a7 dd c7 7e
Traceback (most recent call last):
  File "m5ui/port.py", line 46, in task_handler
  File "main.py", line 33, in button0_event_handler
  File "main.py", line 28, in button0_short_clicked_event
  File "main.py", line 18, in inventory1
  File "unit/uhf_rfid.py", line 19, in inventory
  File "driver/jrd4035/__init__.py", line 72, in inventory
  File "driver/jrd4035/__init__.py", line 445, in command
  File "driver/jrd4035/__init__.py", line 490, in _receive
ValueError: buffer too small

code.py

Image

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions