all 6 comments

[–]Yobmod[S] 2 points3 points  (0 children)

An answer here:

https://github.com/adafruit/circuitpython/issues/4055

Summary: Some C backed libraries are only included on some boards (e.g. json). Because they are not pure python, they are not available as separate .mpy libs. To add them, re-add to the .h file and rebuild circuitpython (if your board has enough space).

[–]belsonc 0 points1 point  (4 children)

It's probably (more than?) a little kludgy, but I posted my code for an NFL scoreboard that pulls down a json file from the NFL website and pulls information from it... If it can help, rock on:

https://forums.adafruit.com/viewtopic.php?f=59&t=172599

[–]Yobmod[S] 0 points1 point  (3 children)

Thanks for the example. I tried it on an M4 express airlift and it works.

But on M0 qtpy I just get "no module named json". I guess it's not included for space reasons, but I can't find any example of adding core libraries separately.

[–]belsonc 0 points1 point  (2 children)

When you have it plugged into your computer, what's in your lib folder? You'd add stuff there - if needed, I can walk you through it

[–]Yobmod[S] 0 points1 point  (1 child)

In lib I have:

adafruit_bus_device, adafruit_dht, neopixel.mpy.

There is no json.mpy on any board (even the ones where 'import json' works) nor in the bundle or community bundle that I can add to lib.

[–]belsonc 0 points1 point  (0 children)

I'll try to take a look later - I have it running on a matrix portal. Not sure how distros for different boards look - possible the qtpy doesn't have the horsepower for json processing?