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

How does the stalled() function work in Pybricks-MicroPython

MicroPython 2.0 beta 5 Trying to understand how the stalled() function on the motor works. I run a motor at dc of 100, and hold the wheel so that it cannot move. But the stalled function doesn't fire, indeed whatever I do I don't seem able to get it…
2
votes
0 answers

How to fix the '[Network] module not found' error in Micropython on Raspberry Pi?

I recently installed Micropython on my Raspberry Pi model 3. I followed all the steps mentioned in the Raspberry pi - how to guide. https://www.raspberrypi.org/forums/viewtopic.php?t=191744 But, when I try to import the network module, it throws a…
Adarsha
  • 21
  • 1
  • 7
2
votes
1 answer

Checking to see if a thread has started in MicroPython

I am just trying out some MicroPython scripts on LEGO EV3 unit and I am struggling to find any documentation/examples that tells me how to check if a thread is running. def newMethod(): print("new method") t1 =…
user3069232
  • 8,587
  • 7
  • 46
  • 87
2
votes
2 answers

AC dimmer using micropython

I want to control AC Light Dimmer using Micro Python with ESP8266. I am not getting any libraries or examples related to this.Could anyone please help me with this Thanks in advance!
2
votes
2 answers

How do i declare my class so i can access like this

In micropython there is a module neopixel to interact with ws2812 addressable LEDs an example code is from microbit import * import neopixel pixel = neopixel.NeoPixel(pin0, 64) pixel[0] = (255, 0, 0) pixel.show() This declares 64 leds controlled…
phil
  • 561
  • 3
  • 10
2
votes
0 answers

Micropython, Store binary file without a filesystem

I'm using Micropython on a Nios 2 Softcore from Altera. I somehow need to load a image file into a Flash. I've tried to wrap this file into a Python string which I then could load from the processor it self. However due to how a string is processed…
Ephreal
  • 1,835
  • 2
  • 18
  • 35
2
votes
1 answer

Micropython: How to free up all RAM memory on startup

I'm using a library that doesn't free up all memory when the program is stopped. As a result I get an ENOMEM exception when restarting the program. Is there a way to free all RAM memory upon program restart? For now I'm using hard-reset as a…
Bigman74066
  • 408
  • 4
  • 12
2
votes
2 answers

ECONNABORTED when POSTing from micropython on NodeMCU using requests

I have a small Python server which I can POST commands to in order to control my LIFX lights. From Postman I can spam this as much as I like and never see an error, but what I'm trying to do is build a couple of wall switches that trigger the lights…
jymbob
  • 478
  • 5
  • 16
2
votes
2 answers

Connecting ESP32 to AWS IoT via umqtt

I have the following micro python code: client = MQTTClient("youraccount/feeds/lights", "a21sigud7911d7.iot.us-west- 2.amazonaws.com", user="None", password="None" , keepalive=10000, ssl=True,…
user3570022
  • 85
  • 1
  • 11
2
votes
2 answers

ESP32 - using MicroPython: How to update clock after reboot?

I have an ESP32 board, with Micropython installed properly, and connecting to local the internet. Since it have to do a scheduled jobs- its clock need to be synced. After boot it get a generic date 1/1/2000. How can Micropython updates int clock…
guyd
  • 693
  • 2
  • 14
  • 32
2
votes
2 answers

ESP32 MicroPython SSL WebSocket

I successfully managed to connect my ESP32 to a WebSocket server. Now I am trying to make it work with SSL. I tried this simple code to connect to www.google.com. I used this to generate the cert and key. openssl req -newkey rsa:2048 -nodes -keyout…
silbo
  • 31
  • 1
  • 7
2
votes
1 answer

MicroPython client not receive text file larger than 4kb (4096 bytes) from Python Server

I have an micropython client on esp32 board, and Python on linux server. I am trying send 5.5kb text file from Python Server to MicroPython client. It sends successfully but MicroPython client does not receive all data. Codes as follows; Python…
Sunrise17
  • 379
  • 3
  • 18
2
votes
1 answer

How to test sign of floating-point register in Micropython assembly language

I'm learning assembler for MicroPython (ARM Thumb2 instruction set for PyBoard). Is there a quicker way to check the sign (positive/negative) of an FPU register (s0) than this? @micropython.asm_thumb def float_array_abs(r0, r1): label(LOOP) …
Bill
  • 10,323
  • 10
  • 62
  • 85
2
votes
1 answer

How to access OLED on HTIT-WB32 with Micropython through I2C?

I have Micropython v1.9.2 on an HTIT-wb32 ESP32 board. I can run code, connect to my router, etc. I have not been able to access the built-in OLED display through I2C. The OLED pin layout for the board states that SDA is on pin 4 and SCL is on pin…
RKirk
  • 57
  • 9
2
votes
1 answer

(Monkey) patch for micro python unit test

I can’t find any examples, I will try to make the question specific: Given that micropython has some form of unit test library, how can I do monkey patch or similar to replace system objects output or input within test cases. The desire is to write…
Mitchell Currie
  • 2,769
  • 3
  • 20
  • 26