3

I have found a library and sample code that seems to work very well on the Pico W, but I need a bit more power, so I'd like to use the same library on the Pi Zero W instead. Initially, I tried using the code as-is, but I immediately get errors because required modules (utime for example) are not available.

Is there any simple solution for using micropython on Pi Zero W? Or do I just need to debug and edit it to until it works?

I've spent too long trying to find an equivalent library - some come close, but they don't have everything I need.

Thanks

G.H.
  • 151
  • 1
  • 4

2 Answers2

1

From the looks of things, there is a Unix port that should work ("...is a version of MicroPython that runs on Linux, macOS, and other Unix-like operating systems"). However, it isn't in the RpiOS apt repo, so you will have to build it from source.

Installing the required dependencies will be the same as it is on Debian:

sudo apt-get install build-essential libffi-dev git pkg-config

To get the source code you will need git (which is included in the line above):

> cd /usr/local/src
> sudo git clone --depth 1 https://github.com/micropython/micropython.git

If you don't want to put it in /usr/local/src, use whatever directory you like; you also don't have to download or build it via sudo if you put it somewhere your regular user has write permissions.

The ports/unix directory mentioned in the build directions will be in the git repo directory. If you downloaded with sudo git, you'll have to sudo make as well.

goldilocks
  • 60,325
  • 17
  • 117
  • 234