vindolin / Python-Ebyte-E32

Python 3 command line tool/library for controlling Ebyte LoRa modules like the E32 with GPIOs (Raspberry Pi).
MIT License
6 stars 2 forks source link

python3 msgpack_monitor.py #2

Closed kaankaval closed 2 years ago

kaankaval commented 3 years ago

output: 120 120 126 -30 Traceback (most recent call last): File "msgpackmonitor.py", line 18, in for obj in unpacker: File "msgpack/_unpacker.pyx", line 518, in msgpack._cmsgpack.Unpacker.next File "msgpack/_unpacker.pyx", line 443, in msgpack._cmsgpack.Unpacker._unpack ValueError: int is not allowed for map key

expected output was: ofis 26.20 6.00

what should i do for it?

vindolin commented 3 years ago

Looks like this was changed in msgpack 1.0 https://github.com/msgpack/msgpack-python#major-breaking-changes-in-msgpack-10. You have to pass strict_map_key=False as a parameter to msgpack.Unpacker() if you want to use non strings as keys.

unpacker = msgpack.Unpacker(strict_map_key=False)