Usin pip modules on pico?

I have a project with my pico which involves processing some data. For some more advanced capabilities I would like to use something like matplotlib. Is it possible to use pip modules inside of of micropython? In addition is there a place where I can find and install additional modules or is everything baked in already? I am using the pico lipo from pimorini with the custom pirate UF2

Three things to consider: MicroPython is only a subset of regular Python. So you have to check if the modules you plan to use really work. Secondly, the pico does not run an OS, so there is nothing like “pip install foo”. You would have to copy the relevant files from the modules manually. And last but not least: the pico is still a very small mcu, large modules and complex data-processing will always fail. And matplotlib is really, really fat.

Having said this, I do plot data using a RP2040 (it is the little board in the left lower corner):

If you really need many external modules, you should try Circuit-Python instead of MicroPython. CP has a number of drawbacks, but it has hundreds of libraries and installing and updating these is as simple as using pip.

The best solution is to take the best of both worlds: collect data using the mcu, analyze and display it using a computer (Pi4 is already sufficient).

1 Like

So your suggesting I should do the data collection with the pico and then the processing with a physical computer? How would I communicate data across both of them?

You have multiple options. If you are connected to the pico with a cable anyhow, you can just print the values and save the output of the REPL. Depending on your terminal program, there are options to automate this (e.g. I am using “tio” and this has a “-l logfile” option, I think “screen” has the same option with a capital L).

Having always a cable connection is not what you want, so I use a very cheap ESP-01S as a coprocessor to send the data. Pimoroni also has an addon (I think it is called jetpack), which is a ESP32.

Best option would be to use a new pico-W with builtin wifi-chip.

A sample program (in Circuit-Python) is here: GitHub - bablokb/circuitpython-examples: Collection of circuitpython programs, examples, templates (subdirectory esp-01-datalogger).

On the receiving side you can use “netcat -l -u 6500” e.g. to listen on port 6500 for udp-data and write the data to a file.