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
3
votes
3 answers

Are bytes always octets in Python?

Could there be a Python implementation where the assertion fails: assert all(byte in range(256) for byte in any_bytes_object) # Python 3 semantics assert all(byte in range(256) for byte in map(ord, any_bytes_object)) # Python 2 POSIX specifies…
jfs
  • 399,953
  • 195
  • 994
  • 1,670
2
votes
1 answer

Can someone help me create a uf2 file, for a Raspberry Pi Pico w/ FreeRTOS?

first off i am on macbook. I am trying to create a uf2 file for my raspberry pi pico. This is for a swarm robot that i am working on and i get the following error: arm-none-eabi-gcc: fatal error: cannot read spec file 'nosys.specs': No such file or…
2
votes
1 answer

Read/write data over Raspberry Pi Pico USB cable

How can I read/write data to Raspberry Pi Pico using Python/MicroPython over the USB connection?
basil_man
  • 322
  • 5
  • 14
2
votes
0 answers

How to generate a MicroPython QSTR from a C macro?

I'm using MicroPython and I would like to generate a QSTR that contains the contents of a macro. For example, I have the following macro: #define MY_MACRO "hello" How can I generate a QSTR that has the value "hello" and is called…
Pablo
  • 121
  • 4
2
votes
0 answers

MicroPython websockets library for Raspberry Pi Pico W?

I'm working on a project where I need multiple devices to connect to a shared server that can exchange data in realtime. I was approaching this problem by creating a websocket server on a Raspberry Pi 4 which connects to various Raspberry Pi Pico…
Mathias
  • 308
  • 1
  • 9
2
votes
1 answer

Running GRPC service on Raspberry Pi Pico

I am looking to run a grpc service on a raspberry pico. This might sound outlandish to some people, specifically those who know what the problem I'm about to introduce is, but I think I could make it work with the right technical help. The…
Trey Davis
  • 21
  • 1
2
votes
1 answer

Send data between two pico with LoRa

I am trying to send data from a Pico Raspberry Pi to another Pico through an SX1262, but I can't send it. I already tried the ping pong example, but the SX1262 library gives me errors in the Thonny IDE. Traceback (most recent call last): File "",…
2
votes
1 answer

How do I use the "Service Changed" characteristic to invalidate attributes cache?

I'm writing a small BT app on a microcontroller (using aioble on Micropython), but my question is more general on the BT spec itself. Since I'm still developing the device, I keep adding/changing services and characteristics all the time, and found…
Zach Moshe
  • 2,782
  • 4
  • 24
  • 40
2
votes
1 answer

I2C not working on the Raspberry Pi Pico W with MicroPython

Trying to use the Raspberry Pi Pico W and some i2c devices with micropython but running into issues. When I try to scan one device, it seems fine, but as soon as any more come onto the I2C bus, it never seems consistent with the result, most of the…
2
votes
1 answer

Why Micropython doesn't support any of the keypress modules like pygame/pynput/keyboard.?

I have been trying to work logics on esp8266 and esp 32 via micro python and it turns out that micro python does not let you control the hardware fully with your keyboard. It is inconvenient to press enter after every command on a serial port and…
Sunny Ahir
  • 23
  • 2
2
votes
3 answers

Process HTTP headers from uasyncio.start_server()

I am trying to make a program to process HTTP headers using uasyncio's start_server class, I can see the name headers I am trying to read in Access-Control-Request-Headers after printing the data received from a web request but cannot read the…
2
votes
0 answers

MicroPython: Scheduling

I am very inexperienced with Python so bear with me. I am trying to set a schedule in a RaspiPico to turn a RaspPi 3B+ on at given times. The RaspPi 3B+ turns itself off at the 57th minute of every hour, the Pico is supposed to turn it on at the…
2
votes
1 answer

I want to asyncronous blink a led during wifi connection micropython board

I have two co-routines. I start led blinking and wifi connection, but after wifi connection is complete i want to stop led blinking function. Led blinking function: async def blink: while True: led.on() await uasyncio.sleep(seconds) …
2
votes
0 answers

While True and sleep in Uasyncio in micropython

I'm writing a surveillance camera app with ESP32-cam and MicroPython. tl;dr at the end I'm using the Threaded code below: import camera import machine from config import app_config from webserver import webcam from _thread import…
2
votes
2 answers

Error while posting something from Esp32(Micropython) to firebase

I'm trying to use firebase with Micropython. It doesn't matter how many times I do this print(firebase.get(URL)). If I use firebase.put(URL, datas) or firebase.patch(URL, datas) then it successfully posts that data, but if I try to read the data…
LoNE WoLvES
  • 198
  • 1
  • 9