Questions tagged [micropython]

MicroPython is a Python interpreter (with partial native code compilation feature). It provides a subset of Python 3.5 features, implemented for embedded processors and constrained systems.

About

MicroPython is a lean and fast implementation of the Python 3 programming language that is optimised to run on a microcontroller. It was originally created by the Australian programmer and physicist Damien George and first appeared in May of 2014.

The MicroPython board is a small electronic circuit board that runs MicroPython on the bare metal, and gives you a low-level Python operating system that can be used to control all kinds of electronic projects.

MicroPython was successfully funded via a Kickstarter campaign. The software is available to the public under the MIT open source license.

Books

Sites

Damien George's KickStarter project to develop a API to use with ESP8266 WiFi chip, optimised and well supported. ESP8266 is one of the best boards to use with MicroPython.

Example projects

1031 questions
2
votes
1 answer

Can't install Micropython module through upip, error message is not clear

I'm trying to work with the Tronpy module in Micropython. It works fine when I'm using CPython. However, in Micropython, I tried to install it and got an error message. I'm using Fedora 34. $ micropython -m upip install tronpy Installing to:…
gscofano
  • 83
  • 10
2
votes
1 answer

esp32 micropython littlefs

Using a Expressif dev-board and standard micropython.bin I was able to create a littlefs2 partition, mount it and write data into a file: # ESP8266 and ESP32 import os os.umount('/') os.VfsLfs2.mkfs(bdev) os.mount(bdev, '/')) with…
juerg
  • 479
  • 5
  • 16
2
votes
2 answers

Error initializing ssd1306 oled connected to Pi Pico

Just trying to understand what's going on here. i2c.scan() returns [60], as in should. from machine import Pin, I2C import ssd1306 i2c = I2C(0, sda=Pin(0), scl=Pin(1), freq=400000) oled=ssd1306.SSD1306_I2C(128, 64, i2c) Traceback (most recent…
2
votes
0 answers

Stepper motor powered, but not turning

I am new to using stepper motors and micropython. I am having trouble getting my stepper motor to turn. I am using a raspberry pi pico and a tmc 2208 driver to control my stepper motor. I can hear the coils being powered on and off, but I get no…
TiVe
  • 73
  • 4
2
votes
1 answer

MemoryError: memory allocation failed Micropython

I am working with an ESP32 card with a lot of components, in particular an ssd1306 screen, I found a library where I can put letters on the screen, in short I have a problem when I call the library in a test the problem is this one : Traceback (most…
Tuanka 01
  • 23
  • 3
2
votes
0 answers

How would I use an older (v1) version of the Hi Technic NXT Infrared Seeker v2 in ev3dev with micropython?

ev3dev version: 4.14.117-ev3dev-2.3.5-ev3 ev3dev-lang-python version: All output of dpkg-query -l {python3,micropython}-ev3dev*: Desired=Unknown/Install/Remove/Purge/Hold |…
2
votes
1 answer

Problem with machine.Timer() and _thread on Raspberry Pi Pico (RP2040)

I am trying to run balance() function on one thread and use Timer on a separate one. Both methods when run separately work fine, but when I try to use them both at once the issr() function which is called by a Timer just stops working after few…
AntCwo
  • 21
  • 3
2
votes
0 answers

main.py is running in an infinite loop on a esp8266 board

I have a esp8266 board running micropython. From windows 10, I pushed a main.py file to the board using ampy. The script simply flashes the boards led lights. Unfortunately, it does so in an infinite loop. Now, I am unable to stop the program which…
Willyd
  • 37
  • 7
2
votes
1 answer

UART communication Raspberry Pi Pico to Raspberry Pi

I am trying to communicate with a raspberry pi pico with my raspberry pi 4 over uart. The below code does transmit data, but I am only receiving data from the print statement. import os import utime from machine import ADC …
merit_2
  • 461
  • 5
  • 16
2
votes
1 answer

In MicroPython how do I load a module from a string

In a ESP32/MicroPython based project I want to (re)load modules from RAM without having to write them to the flash-based filesystem first. (this is both time consuming and wearing off the flash memory) So my idea was to retrieve e.g. module.py via…
frans
  • 8,868
  • 11
  • 58
  • 132
2
votes
1 answer

How can I download a binary file with urequests in MicroPython?

I am trying to download a binary file smaller than 1 MB through urequests with basic authentication. The authentication part works and I get the expected response. But the truth is I feel lost since I can't download the file I need and I have to do…
2
votes
1 answer

How do I read and analyse csv files in micropython?

I'm setting up a Raspberry Pi Pico to log temperature, humidity etc. to a csv file and to show data on a small OLED screen. Every hour it will log a new line of data delimited by commas to the file. I want to be able to show the maximum and minimum…
Chris A
  • 23
  • 1
  • 5
2
votes
1 answer

Cannot connect Nano RP2040 Connect running on Micropython to WiFi

I have a Nano RP2040 Connect with Micropython on it. I need to connect it to WiFi. Micropython documentation says I need to import the "network" module, but when I try importing it, I get the no module named 'network' error. I assume the module is…
2
votes
1 answer

Micropython: [Errno 19] ENODEV but i2c.scan() returns proper address

I am currently using an SRF-10 sensor connected to an esp32. It's being powered by 5V and I am using a level converter to bring down the voltage to 3.3V to be able to use it on the esp32. Both the SCL and SDA have a 1.8K pull up resistor as…
2
votes
1 answer

Access Micropython REPL on UART(0) not USB

Background I'm working on a robotics project that requires using an ESP8266 based board (Lolin D1 mini pro v2) as a microcontroller. I have Micropython on this board along with a set of functions that I have to be able to call from an Nvidia Jetson…