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
24
votes
1 answer

python - how to implement a C-function as awaitable (coroutine)

Environment: cooperative RTOS in C and micropython virtual machine is one of the tasks. To make the VM not block the other RTOS tasks, I insert RTOS_sleep() in vm.c:DISPATCH() so that after every bytecode is executed, the VM relinquishes control to…
Bob
  • 4,576
  • 7
  • 39
  • 107
15
votes
3 answers

How to install libffi-dev on Mac OS X

I am trying to implement micropython on unix, which requires libffi-dev. I installed in this way brew install libffi-dev. But it seems that there is no libffi-dev can be found. Is there any way to install libffi-dev on Mac os. Thank you.
Xiufen Xu
  • 463
  • 3
  • 6
  • 11
10
votes
2 answers

CRC32 calculation in Python without using libraries

I have been trying to get my head around CRC32 calculations without much success, the values that I seem to get do not match what I should get. I am aware that Python has libraries that are capable of generating these checksums (namely zlib and…
Cooper
  • 127
  • 1
  • 1
  • 8
8
votes
4 answers

Micropython get correct current time

Because of micropython doesn't import the datetime. I want use time or utime modules to get current time. But the time.localtime() result is like (2000, 1, 1, 0, 12, 35, 5, 1) I guess the time start at the 2000/1/1. How to set the start time on…
Hsinhsin Hung
  • 343
  • 1
  • 2
  • 12
8
votes
1 answer

ESP8266 Micropython - connecting to University Wi-fi ( WPA2 Enterprise PEAP )

I have a board with an ESP8266 chip running Micropython firmware v1.8.7. My requirement is to use WebREPL via the University Wi-Fi, which uses WPA2 Enterprise EAP-MSCHAPv2 authentication. My Google-fu so far has informed me that Arduino users have…
Udu
  • 83
  • 1
  • 5
7
votes
0 answers

ESP8266 + Micropython: Why do I keep getting the same value with periodic i2c reads?

I am writing some simple code using MicroPython running on a Digistump Oak, which is basically an ESP8266 breakout board. I'm trying to understand the behavior that I see when performing periodic reads of the sensors via i2c. The following code…
larsks
  • 277,717
  • 41
  • 399
  • 399
6
votes
2 answers

OSError: [Errno 12] ENOMEM with Pi Pico W

This is code that I used from | https://makersportal.com/blog/ws2812-ring-light-with-raspberry-pi-pico | and to begin, this worked great, however after stopping and running the code multiple times with thonny without issue, I then got the…
JohanW28
  • 63
  • 1
  • 4
6
votes
1 answer

getting OSError -202 where running urequests.get from micropy

hi im having error with this code but it runs in python shell could any body help me from machine import Pin import time import network import urequests p0 = Pin(0,Pin.OUT) wlan = network.WLAN(network.STA_IF) wlan.active(True) wlan.connect('ssid',…
Sam
  • 65
  • 1
  • 5
6
votes
2 answers

Why does Micropython 'const' not accept float values?

Most Micropython ports contain a 'micropython' module, which has a specific function called 'const()'. I am led to believe it behaves a lot like '#define' in C, however, it only accepts integers. Does anyone know why this is? You can declare float…
birdistheword99
  • 179
  • 1
  • 15
6
votes
5 answers

esptool.py not recognized as internal or external command, operable program or batch file

I recently tried to load MicroPython on ESP8266 board, but failed. To do that I had to install esptool. I successfully installed it but when I wanted to use it, it would not work. For instance, esptool.py --help 'not recognized as internal or…
OskarCvj
  • 69
  • 1
  • 1
  • 3
6
votes
1 answer

How to configure pylint / python to check for MicroPython syntax?

I'm using VScode to write MicroPython code. The linting and code completion is quite decent, but as there are quite a few differences between CPython and MicroPython, I think it could be better. Is there a way for pylint to : recognize the…
Jos Verlinde
  • 1,468
  • 12
  • 25
6
votes
4 answers

How can I reset ESP8266 MicroPython after main.py crashes?

I have a NodeMCU ESP8266 board running MicroPython. I'm running a web server on my ESP8266. This is my first IoT project based on one of these boards. The below is a snippet of the code. This is being executed within main.py. Every now and then,…
user1600747
  • 63
  • 1
  • 5
5
votes
1 answer

how to clear oled display in micropython

I'm doing this on esp8266 with micro python and there is a way to clear OLED display in Arduino but I don't know how to clear display in micropython i used ssd1306 library to control my OLED and this is my error I've written a code that prints on…
5
votes
2 answers

How can you make a micropython program on a raspberry pi pico autorun?

I have used the software Thonny to send programs to my raspberry pi pico. I am trying to make a specific program auto run when my pico is plugged in. At the moment another program which is on the pico auto runs but I want another program to run…
5
votes
1 answer

ESP32 - MQTT to AWS IoT using MicroPython

I have registered my ESP32 as a thing on AWS IoT and downloaded its respective certificate and public & private keys. Also verified that those connect properly via the following command in my terminal: openssl s_client -connect…
zegulas
  • 417
  • 2
  • 6
  • 18
1
2 3
68 69