Replies: 0 comments 2 replies
-
Probably fair to say that we'd entertain reviewing some PRs around this effort but are unlikely to prioritize this ourselves soon. |
Beta Was this translation helpful? Give feedback.
-
Here's my stripped down MicroPython port: https://github.com/rgov/micropython-mcap. It runs on my macOS machine and produces a file that, on brief inspection, Foxglove Studio can open without complaint. The commit history describes the hacks I needed to apply. It's too invasive to suggest merging it into the main source tree, but maybe this one is worth taking into the mainline? I haven't tested it on a real microcontroller yet, nor will I get to it for a little while. |
Beta Was this translation helpful? Give feedback.
-
I am interested in having a microcontroller record data directly to MCAP format from MicroPython. I gave it a try today using the UNIX port.
First up we need a package.json file. (Since this file isn't in the GitHub repo, I hosted it locally then used
micropython -m mip install http://localhost:8000/package.json
.)Next we encounter numerous missing and incomplete packages in MicroPython. MicroPython targets compatibility with Python 3.4, but there are many documented differences from CPython. Some that affect MCAP, which uses modern Python features, include:
Typing problems: There is no
typing
module. I created a dummy one:The
io
module hasIOBase
but notRawIOBase
,BufferedReader
, orBufferedWriter
.The
abc
module does not haveABC
.The
OrderedDict
comes from theucollections
module for some reason.The modules
dataclasses
andenum
are not implemented.The modules
lz4
andzstandard
are not available/tested under MicroPython.Finally, some minor syntax issues:
In a few places, f-strings are implicitly concatenated (
f"hello " f"world"
). This must be explicit in MicroPython.It didn't like the subscripting in the type definition of
QueueItem
in _message_queue.py.Beta Was this translation helpful? Give feedback.
All reactions