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

socket.getaddrinfo keeps returning OSError: -2

i'm trying to run a socket on my esp8266 but keep getting OSError: -2. I tried: >>> addr = socket.getaddrinfo('smart-socket-bdcc5.firebaseio.com', 443) Traceback (most recent call last): File "", line 1, in OSError: -2 and >>>…
Alex Zaitsev
  • 2,013
  • 4
  • 30
  • 56
0
votes
1 answer

Appending to self has no effect after exiting class method

I'm trying to define a class method which assigns a random list of numbers to a given (pre-existing) object, in order for it to run under MicroPython in an ESP8266. The issue I'm facing is the value of this object is empty after several append()s.…
tulians
  • 439
  • 5
  • 23
0
votes
1 answer

Micropython: How to debounce the Pyboard USR switch?

I currently have this MicroPython code running on a Pyboard v1.1: import pyb def toggle_led(): pyb.LED(3).toggle() sw = pyb.Switch() sw.callback(toggle_led) However, this setup is susceptible to contact bounce. I tried adding up to…
Serge Stroobandt
  • 28,495
  • 9
  • 107
  • 102
0
votes
2 answers

MicroPython urequests.post failures

I'm trying to receive notifications on my (Android) mobile device from an ESP8266 MCU running MicroPython. For this reason I subscribed to a couple of online services exposing some APIs for this task, Pushbullet, and Pushed, and I installed the…
dentex
  • 3,223
  • 4
  • 28
  • 47
0
votes
1 answer

Load portions of matrix into RAM

I'm writing some image processing routines for a micro-controller that supports MicroPython. The bad news is that it only has 0.5 MB of RAM. This means that if I want to work with relatively big images/matrices like 256x256, I need to treat it as a…
karl71
  • 1,082
  • 2
  • 18
  • 29
0
votes
3 answers

Run Python script line-by-line in shell vs atomically

I'm integrating MicroPython into a microcontroller and I want to add a debug step-by-step execution mode to my product (via a connection to a PC). Thankfully, MicroPython includes a REPL aka Python shell functionality: I can feed it one line at a…
Bob
  • 4,576
  • 7
  • 39
  • 107
0
votes
2 answers

Connect SPWF04SA using WPA2 and MicroPython

I am trying to connect an STM32 Nucleo WIFI expansion board (SPWF04SA) to our wireless network using the built-in MicroPython interpreter. According to the datasheet it is supposed to be supported. I can list the available networks using import…
Mark Wagoner
  • 1,729
  • 1
  • 13
  • 20
0
votes
1 answer

How to send data from esp8266 to ubidots by using micropython?

I have an ESP8266 and I have to use MicroPython. There is no MicroPython library for ubidots, so I have to use HTTP requests. Does anyone know how to get started? By the way, I am using Esplorer.jar to program. Thanks.
HiIamAndre
  • 21
  • 1
0
votes
1 answer

Load and compile python file without system file with MicroPython

MicroPython Github that I am using. I want to run some very simple code on MicroPython and I have successfully called C functions from Python and vice versa with my own code. However, it only works on Windows (Visual Studio IDE). Now, I want to load…
jack vu
  • 1
  • 1
0
votes
1 answer

ESP8226 micropython ssl connection issue with SMTP

So after doing a lot of research I have been able to send SMTP email using Google's gmail server. I am using the same code without issue in CPython on both Windows and Linux however when I try to use the code on Micropython 1.9.2 (Latest as of Sept…
0
votes
1 answer

Connecting ESP8266 to IBM Watson with Micropython

I managed to connect an ESP01 using Micropython 1.9.2 to a mosquitto broker running in my computer. I also managed to simulate a device and connect a mosquitto client from my computer to the Watson Broker. But when I try to connect the ESP directly…
Francisco
  • 151
  • 1
  • 7
0
votes
1 answer

Using Pyb-Library in WiPy

How do I use the pyb-library in WiPy? The documentation is incomplete. import pyb doesn't work. Also not from pyb import delay or something. Also machine hasn't delay in it. How do I use following…
0
votes
1 answer

Micropython - Weird behaviour when pasting

I am working with the ESP8266 and Micropython currently and I encountered a strange behaviour. example string: Server: SimpleHTTP/0.6 Python/2.7.13\r\nDate: Wed, 02 Aug 2017 13:40:05 GMT\r\nContent-type: application/octet-stream\r\nContent-Length:…
0
votes
1 answer

Python: error check failing to catch exception

I'm writing in a stripped down version of python, micro python. I'm doing some image processing and am trying to find the longest line returned from a method called, "find_line_segments" (it does Canny Edge and Hough Lines transforms). BUT! I keep…
slow_one
  • 113
  • 1
  • 4
  • 13
0
votes
1 answer

What is the exact syntax to use UART pin of nodemcu using micropython?

I am trying to send serial message from one nodemcu to two arduino boards. However, i am able to use only one uart pin of nodemcu which is TX pin. I can send message without any problem. But how can i send serial message from another uart. Node mcu…
nawas
  • 41
  • 1
  • 10