1,132 questions
2
votes
0
answers
37
views
Micropython socket.getaddrinfo fails when using DNS on local network
tl;dr: Using a DNS server on a local network causes socket.getaddrinfo() to experience an error:
OS Error: [Error 103] ECONNABORTED
Using an internet DNS server works.
Details: I have a very simple ...
0
votes
1
answer
29
views
Micropython PIO interrupt causes loop on PICO
Extract of longer program. Just to toggle the .side pin and then quit the PIO program. Causes loop and have to nuke the PICO! Loops before the 'Run' print. Thanks
TypeError: function takes 2 ...
0
votes
1
answer
91
views
Calculation of CRC7
For a SD card driver I tried to calculate CRC7 for the commands.
Now, if I "enable CRC7 check" with CMD59, I get errors with some SD cards. But if I "disable CRC7" check with CMD59,...
0
votes
1
answer
20
views
SIM800L chunk file for sending through TCP Connection properly - CME ERROR 3
If anybody is conform with SIM800L, I've got a working design regarding sending data through TCV via SIM800L, building up the network is ok.
What is working:
AT+CIPSTART
waiting about 2 sec
AT+CIPSEND=...
2
votes
1
answer
75
views
How to Send Unicode DegreeC as a unicode value in a dictionary entry
I have a python program [pylarexx] (which I did not write) that reads temperature sensors and publishes two MQTT topic messages [..../config and ..../state ] to a Broker running with Home Assistant [...
2
votes
0
answers
112
views
MicroPython MCP2515 CAN bus: Lost some responses at a 10 ms request cycle
I’m working on a Raspberry Pi Pico and MCP2515 CAN bus setup using MicroPython. I’m simulating OBD-II vehicle speed responses (PID 0x0D). At a 100 ms request cycle from my USB-to-CAN adapter (Linux ...
0
votes
0
answers
25
views
ValueError: Invalid Key while trying to upload code to ESP8266 device
I'm trying to connect my NodeMCU (ESP8266) device running Micropython to AWS IoT but wwhile running the code I'm getting the following error:
start connecting
Connected: True
Key and Certificate ...
0
votes
1
answer
65
views
Parse BLE iBeacon advertisement with micropython
I have an app written in mincropython sitting on an XBEE LTE/IoT radio. It scans advertisenments from iBeacon enabled devices. I am trying to find any dicumentation to allow me to parse the hex I get ...
0
votes
1
answer
125
views
Raspberry Pico W: Hangs after WLAN deinit()
My PICO W hangs sometimes after calling deinit(). I'm using Micropython v1.25.0 (2025-04-15)
Please see this example script:
import network
import time
from time import sleep
import urequests
import ...
0
votes
0
answers
59
views
Micropython asyncio StreamWriter only sends part of data
I'm pretty new to Python, & I'm attempting to set up an access point from a Pico W to provide info to a client (eg, an iPhone). The connection is successful, but my iPhone app only receives ...
0
votes
0
answers
72
views
url decoding on micropython
im trying to decode user input from a website into a plaintext file on a rpi pico w running micropython. I'm running into issues with certain characters being decoded, specifically spaces
the code is ...
0
votes
1
answer
66
views
Protected const() class variable
Why do protected class variables assigned to MicroPython const() are missing from list of class members? The MicroPython docs indicate that "if a constant begins with an underscore then it is ...
0
votes
1
answer
65
views
asyncio.server: how to filter on remote IP-address
I have a Tcp socket server class that is to run in CPython and MicroPython. It does, no problem there. Only I would like to extend its functionality with an IP filter. From an earlier version that ...
0
votes
0
answers
38
views
re.search() raises recursion depth error when in thread [duplicate]
In MicroPython, re.findall() does not exist. Therefore, I made one myself:
def findAll(pattern, s, flags = 0):
found = []
while True:
m = re.search(pattern, s, flags)
if m:
...
0
votes
0
answers
57
views
Cannot use APDS9960 sensor with Micropython in ESP32
I am tring to work with APDS9960 sensor with ESP32 in micropython to detect gestures like right, left, up, and down. I cannot use the sensor with micropython. I searched the entire internet and could ...
0
votes
0
answers
74
views
Micropython is HARD
I'm having trouble either controlling the flow, or maybe my math is wrong, but I keep getting stuck in a loop. My code should be getting the temperature of a thermistor (TempF), translate that to a ...
0
votes
1
answer
187
views
Getting a syntax error when importing machine module on raspberry pi pico
After loading micropython on my raspberry pi pico and trying to run a simple blink code on thonny or vs code i get the same error which is the following.
>>> import machine
Traceback (most ...
1
vote
0
answers
50
views
Asyncio webserver store HTML dropdown option in Python variable
Im trying to run webserver beneath my main python script on my ESP32.
I want to display a HTML dropdown menu on the webserver and store the value in a Python variable.
Here is a option of this ...
0
votes
0
answers
92
views
How to Set Temperature for a Virtual Tuya Thermostat Using MicroPython? API Token Request Fails (Error 1108: URI Path Invalid)
I'm trying to control the temperature of my virtual Tuya Thermostat using MicroPython. I have already successfully tested the API using Postman. However, when I try to use the same parameters and ...
0
votes
0
answers
35
views
Micropython OR bitshift operations
Trying to modify a driver for a load sense amplifier to work in Micropython. I've gotten rid of the smbus calls replacing them with machine.I2C, but am stuck on the drivers bitshifting operations, ...
0
votes
0
answers
54
views
How do I resolve conflicts Between MicroPython’s FATFS and Zephyr’s FATFS in nRF Connect SDK 2.9.0?
I’m currently integrating MicroPython into my Zephyr-based firmware using the nRF Connect SDK 2.9.0. I’ve encountered a build issue due to duplicate definitions arising from the FATFS implementation. ...
0
votes
1
answer
89
views
Boot time shortening for ESP32 with Micropython
Waking up time tames about seconds!
Helo guys
I am working with few types of ESP32 , S2 mini, C3 zero , C3 super mini and some more. Each one is mounted with the latest Micropython frimware (up to ...
2
votes
2
answers
59
views
micropython on picoboard while loop not working
from picozero import pico_led, Button, LED, Buzzer
from time import sleep
led16 = LED(16)
button12 = Button(12, pull_up = False)
button15 = Button(15, pull_up = False)
buzzer14 = Buzzer(14)
global ...
1
vote
2
answers
474
views
Waveshare RP2350 Touch Lcd 1.28 inch LVGL
Got my hand on a cheap Wavehsare RP2350 Touch LCD 1.28 inch round display, and wondered if I could run LVGL Micropython on It. I'm a newbie.
I tried the official Wavehsare documentation, and didn't ...
0
votes
1
answer
38
views
How can I place and update 2 variables at different locations in a single string
I'm new to html and webpages
I have a simple tester html document with two variables at different locations:
testpanel = """<!DOCTYPE html>
<html>
<head> <title&...
0
votes
0
answers
123
views
In Micropython's asyncio, how do I wait for one of two events to be set?
In a MicroPython project, on an ESP32 microcontroller, I have two events that I have created like so:
ev1 = asyncio.Event()
ev2 = asyncio.Event()
Now, in a co-routine, I would like to wait until one ...
0
votes
0
answers
214
views
Issue Running Async Web Server with Multi-Core Threading on Raspberry Pi Pico W
I'm working on a project using the Raspberry Pi Pico W 2 that involves displaying data from BLE sensors on a web page, with everything running on the Pico.
My intention is to:
Run an asynchronous web ...
0
votes
0
answers
42
views
Virtual simulation of a PI and Microcontroller using Vagrant and Virtualbox
I am working on a vagrant / python script that will download micro controllers
The vagrant script loads the below VM:
pi5.vm.box = "debian/buster64"
Then I also load these as stand-ins for ...
0
votes
0
answers
77
views
pyephem/ephem on esp32 micropython
I need astronomical calculations on an ESP-32 microcontroller with Micropython.
The only thing I found is https://github.com/peterhinch/micropython-samples/tree/...
0
votes
0
answers
136
views
PICO W / Micropython websocket client can't send to PHP websocket properly
So I've been racking my brain for a few days trying to figure this one out.
In short, I have a PHP-CLI script I wrote for my project that is my websocket server. The script authenticates connections ...
1
vote
1
answer
218
views
Bidirectional communication over USB between host PC and Raspberry Pi Pico
I'm trying to achieve bidirectional communication over my Raspberry Pi Pico's built-in micro-USB port. More specifically, I'm trying to make my computer send a ping to the Pico, and the Pico receives ...
0
votes
0
answers
72
views
RC522 ESP32C3 Xiao with Micropython Connection Issues
I have:
RC522 RFID Module
ESP32C3 with Micropython
I am trying to get the RC522 module connected over SPI (either hardware or SoftSPI). I haven't had any success connecting to it after trying a sketch ...
1
vote
0
answers
224
views
Reading Bluetooth signals from a HIDS device using aioble and micropython on a Pi Pico
I have a Raspberry Pi Pico W that I want to have perform an action when a button is pressed on a bluetooth remote control I bought.
I can read the bluetooth remote and it's services and ...
1
vote
1
answer
57
views
Convert this socket server sketch from python to micro-python
#Imports modules
import socket
import time
listensocket = socket.socket() #Creates an instance of socket
Port = 8000 #Port to host server on
maxConnections = 999
IP = socket.gethostname() #IP address ...
1
vote
0
answers
58
views
ESP32 GPIO pin only activates inside a while loop in MicroPython
I am using an ESP32 with MicroPython to control a motor driver. I have created a class for the motor that allows me to set the motor's power using a setPower method. However, I have encountered an ...
0
votes
0
answers
46
views
uasyncio.Event not resuming main loop immediately after set on Raspberry Pi Pico
I'm programming in Micropython for the Raspberry Pi Pico. In my main loop I await for an uasyncio.Event, which I successfully set from an interrupt context.
I expected the code to pause and then ...
1
vote
1
answer
2k
views
ESP32-WROOM-38pin, pin number to control onboard LED
I have one of the boards in the image below, which as far as I can work out is called a ESP32 WROOM devkit 38-pin.
I've successfully flashed micropython, and can obtain a REPL through picocom. I'm ...
1
vote
0
answers
51
views
https post request to Google Apps Script returns 400
The goal of my project is to send to a Google Sheets spreadsheet the following data:
a value from a MCP9808 temperature sensor;
a datetime string;
a board ID.
To achieve this the MPY script sends a ...
1
vote
0
answers
69
views
Captive Portal In MicroPython doesnt work
I am trying to create an automatic captive portal using a Raspberry Pi Pico H with an ESP8266 Wi-Fi HAT. When I connect to the Wi-Fi, it works, but the user is not automatically redirected to the ...
1
vote
0
answers
61
views
Why does readblocks() return only zeros when reading raw data from an SD card in MicroPython on ESP32-S3
I am working on a project using an ESP32-S3-CAM WROOM FREENOVE board and MicroPython v1.24.1. I need to read and write raw data directly to an SD card without using a filesystem, as the card has a ...
0
votes
1
answer
140
views
Object with asyncio task not destroyed when out of scope
I've noticed that objects which include an asyncio Task don't appear to be deleted when they go out of scope, and I'd like to know a better of managing these objects to avoid accumulating too many.
An ...
0
votes
0
answers
197
views
I cannot change the hostname on a PicoW using Micropython
I am using Micropython on Thonny (version 4.1.6) on Ubuntu 22.04 with a PicoW target.
I wanted to change the hostname, so wrote this code:
import network
import socket
from secret import ssid, ...
0
votes
0
answers
81
views
Cannot install any modules onto PicoW using Thonny
I run Ubuntu 22.04, and run Thonny - but get different behaviours between the different installs. I think the only one that runs was installed a day or two ago, but is showing it is version 4.1.6. (...
-2
votes
1
answer
47
views
TypeError: function takes 1 positional arguments but 2 were given
I am trying to interface multiple buttons with Esp8266 and display it on a 16x2 LCD. I am using micropython. Here is my code
import time
from machine import I2C, Pin, Timer
from i2c_lcd import I2cLcd
...
0
votes
1
answer
66
views
Change the button value according to the state of the LED
I have a project from my college that is in Micro Python, but my question is about something related to HTML that will have to use JavaScript.
My project simulates a house that has lights controlled ...
0
votes
2
answers
88
views
How to create a custom dialog in Javascript with no JQuery?
On an ESP32, I have developed a wireless web server from scratch using micropython. Please correct me if I'm wrong, but I think using libraries like Flask and JQuery is not possible.
I've had lots of ...
0
votes
1
answer
60
views
How to calculate temperature right from RuuviTag advertizement packet?
I have micropython code in ESP32 that reads ruuvitag with BLE. I can receive BLE advertizement packet, 31 bytes. Ruuvitag uses dataformat 5. Firmware v3.31.3+default.
Packet is this: b'\x02\x01\x06\...
0
votes
1
answer
66
views
micropython stm32F722ze, ValueError: Pin(PC13) doesn't exist
I am using stm32f722ze and trying to write a program to control led using push button but it always says value error. With the help of user manual figure out the Arduino mapping for PC0 but cannot ...
1
vote
1
answer
147
views
Using the DY-HV20T module with rp pico in UART
I'm trying to make this little MP3 player (dy-HV20T) work.
The module works in autonomous mode, but impossible to communicate with it in UART.
Here is the test code:
from machine import UART, Pin
from ...
0
votes
1
answer
48
views
OSError -1 while trying to send GPIO pin values
I have a short code written in micropython on pico pi W. This codes sets up a server and is mainly supposed to display a website on which you can check the states of all the GPIO pins.
Now when I go ...