1,132 questions
0
votes
1
answer
1k
views
Sending and receiving data over USB using serial
I'm trying to send data from PC to Raspberry Pi Pico. PC code:
import serial
import time
# Define the serial port and baud rate (adjust as needed)
serial_port = 'COM12' # Replace 'X' with the actual ...
-2
votes
1
answer
113
views
If else statement not behaving correctly
I am using a Raspberry Pi Pico-W with MicroPython to build a small temperature alarm.
I have tried to build in some hysteresis however the output is using the upper value not the lower one.
I.e. in ...
0
votes
4
answers
4k
views
How do I stop a script on a Raspberry Pi Pico?
On a Raspberry Pi Pico I ran a looping script that blinks the onboard LED. It loops forever.
I can’t reset it, stopping the power doesn’t work because it runs on startup and Thonny doesn’t even ...
0
votes
1
answer
258
views
Using Raspberry Pi Pico W to inference Azure ML using REST endpoint
I can't get a response when trying to inference an Azure ML model deployment on a Raspberry Pi Pico W. I've successfully gotten responses using Python 3.10, but can't get it to work in MicroPython. ...
3
votes
1
answer
643
views
TLS communication between Python 3.11 and MicroPython 1.20 - fails with [SSL: NO_SHARED_CIPHER] no shared cipher
I'm trying to send text between this to devices. One has a Python 3.11 (Server) and the other one a Micropython 1.20 (Client). Both devices have their own key and the server has a server-cert. Both ...
0
votes
0
answers
166
views
file transfer problem in microwebsrv2 on esp32
programming language: micropython
board: esp32 wroom
hi, I have a zepto.min.js file on a esp32
and I use microwebsrv2 to build web server
the frond end of web site is a simple html file.
some where in ...
1
vote
0
answers
1k
views
how do i get usb_hid on micropython
So there is a module named usb_hid on CircuitPython but its not on MicroPython. Is there a way to get usb_hid on MicroPython?
It isnt in the lib folder of CircuitPython. I even tried displaying all ...
0
votes
0
answers
194
views
Update screen every hour
My Raspberry Pi Pico W and Inky Frame running MicroPython works when I execute it over USB via Thonny. I'm going to remove the USB and leave it on battery. I'd like my script every hour to update what ...
0
votes
1
answer
477
views
ESP32 to Raspberry Pi Pico W Wi-Fi connection too slow
I need a connection between an ESP32 and a Raspberry Pi Pico W to control an RC boat. The data transfer is too slow. Latency needs to be 0.1 seconds or less. My test was with 1 second delay, but the ...
0
votes
1
answer
140
views
start_server function only handles a few requests
I am writing in MicroPython. Target is a servo-motor controlled by calls to device's IP-address. The Raspberry Pi Pico runs a server listening to incoming requests:
http://192.168.178.22/servo/on ...
0
votes
1
answer
76
views
"decorated" keyword not implemented in micropython?
I'm trying to use the aiomqtt module ([https://github.com/sbtinstruments/aiomqtt]) in a micropython program on an ESP32-S3 system, but I get a syntax error on this statement in aiomqtt's client.py ...
0
votes
1
answer
1k
views
main.py not running when I start Raspberry Pi Pico
My code:
print("hello world")
I want this file to run when I start the Raspberry Pi Pico. I named it main.py but when I unplugged and plugged the Raspberry Pi Pico into my computer the ...
2
votes
2
answers
2k
views
"OSError: [Errno 5] EIO" when running my code
Error:
>>> %Run -c $EDITOR_CONTENT
Traceback (most recent call last):
File "<stdin>", line 5, in <module>
File "/lib/ssd1306.py", line 110, in __init__
...
5
votes
4
answers
3k
views
"cannot read spec file" trying to create uf2 file
I am trying to create a uf2 file for a Raspberry Pi Pico for a swarm robot. I get:
arm-none-eabi-gcc: fatal error: cannot read spec file 'nosys.specs': No such file or directory
I installed the SDK:
...
0
votes
1
answer
77
views
Stopping a repeated for loop overloading the microcontroller
I have some RGB LEDs, and I want to draw a gradient on to them. The gradient is stored as a list of tuples, each tuple containing the R G and B values for the LEDs. I iterate through the list, and add ...
0
votes
1
answer
205
views
Nested UART pin change interrupts
I'm trying to implement a UART interrupt in MicroPython on an RP2040-based custom board loaded with Adafruit Feather MicroPython 1.2. While I'm aware this feature is typically available for WiPy ...
0
votes
1
answer
264
views
LED fails to blink
When I run my code to blink a LED, Thonny runs it well. But on the Raspberry Pi Pico itself the LED is not blinking:
from machine import Pin
from time import sleep
led = Pin(25, Pin.OUT)
while True:
...
0
votes
0
answers
605
views
Raspberry Pi Pico W getting stuck in socket.accept call
I am using Pico W as web server to control relays to switch on and off switches. I am able to connect pico w to wifi router. Web server works fine. After some idle time like 2-3 hrs, Pico stops ...
0
votes
1
answer
774
views
Can't connect RFCOMM socket: Connection refused. GDBus.error:org.bluez.error.failed:Protocol not available
I'm trying to connect a lego ev3 with micropython to a raspberry pi via bluetooth. Installed bluez and blueman on raspberry. I made the lego address trusted and connected it via the command line using ...
0
votes
1
answer
983
views
No module named 'machine' while importing
The error:
Traceback (most recent call last): File C:\Users\jobsa\Downloads\lcd.py, line 1, in module import machine ModuleNotFoundError: No module named 'machine'
I am trying to make an LCD ...
0
votes
1
answer
537
views
Failed to build pycrypto when installing machine module
I am trying to install machine module. The error says:
Collecting machine
Using cached machine-0.0.1-py2.py3-none-any.whl (4.2 kB)
Collecting pycrypto (from machine)
Using cached pycrypto-2.6.1....
0
votes
1
answer
561
views
Why does uasyncio module in micropython doesn't have any "run" function?
I am using an ESP8266 board with micropython.
I tried to use asyncio, but it doesn't work and says me that :
Traceback (most recent call last):
File "<stdin>", line 10, in <module&...
1
vote
0
answers
265
views
I cannot get a Python Websocket listener to listen and print a Micropython Client send call. I can make it work Python client to Python Server
I'm trying to have a Raspberry Pi Pico W read temp and other measurements and send via web socket to a server, which is a Raspberry Pi 4). The server, at this point, just prints the data out on the ...
0
votes
1
answer
790
views
How to send a byte string from PC to Raspberry Pi Pico?
Using PySerial I was successful in sending data from Raspberry Pi Pico to Windows PC but not the other way around.
Windows PC code:
import serial
# Configure the serial connection
port = "COM5&...
1
vote
0
answers
289
views
Want connect Bluetooth esp32 to IOS
i just want connect esp32 bluetooth to IOS
this code can connect with android only
I got this code from this Github and i use two code i used ble_advertising.py and ble_uart_peripheral.py
https://...
0
votes
1
answer
135
views
how to take element wise logical and in ulab micropython numpy
I'm using ulab micropython on ESP32.
I can't find logical and operation. I am new to micropython. Kindly help me how do I take logical and between two numpy arrays
from ulab import numpy as np
arr1 = ...
0
votes
1
answer
582
views
send sms with sim800l and micropyhton
I wrote a program using the ESP32 board, sim800l and micropython to send a message to my phone, but it doesn't work, maybe there is a problem with my code and also the flashing light blinks once every ...
2
votes
1
answer
3k
views
Micropython aioble: how to receive data as a server
Based on the official peripheral sensor example, I need to also receive data.
Here is what I tried:
from micropython import const
import uasyncio as asyncio
import bluetooth
import aioble
import ...
0
votes
2
answers
653
views
How to upload a Python file from a Python script?
I am trying to write a script that can create a Python file from multiple inputs and upload it to a Raspberry Pi Pico that has MicroPython installed.
I tried rshell:
import subprocess
cmds = 'python -...
0
votes
0
answers
89
views
Micropython + pylance: "bytes is incompatible with int" error
I'm trying to create several int constants for my module, initialized from the hex values. Pylance keeps complaining about the type conversion errors, but I don't see why and how.
Consider the ...
1
vote
0
answers
1k
views
micropython qmi8658 exposing the AttitudeEngine quaternion
I'm trying to expose the AttitudeEngine quaternion on the QMIi8658 mentioned in the documentation. It's part of the WaveShare RP2040-Touch-LCD-1.28 module. Their original demo sketch exposes the ...
-1
votes
2
answers
537
views
Problem with uploading a new code to Pico
I have a Raspberry Pi Pico. When I upload a new program onto it the previous program is still running. What should I do?
For example I write code to blink pin22, but when I change it to pin21, pin22 ...
0
votes
1
answer
881
views
Can't connect Raspberry Pi Pico W to MQTT broker, not getting CONNACK
I am trying to connect a Raspberry Pi Pico W to a virtual machine which runs a MQTT broker and Node-RED server. MQTT broker is password protected. I added MQTT broker IP in the MQTT node on Node-RED ...
0
votes
1
answer
275
views
raspberry pi pico temperature reading and output to zabbix
there is a raspberry pi pico that I want to configure as a temperature sensor, and output data to zabbix
raspberry pi pico I have, connected to a computer with ubuntu 22.04 via usb, I have a code for ...
0
votes
0
answers
175
views
Trouble With Multithreading in RPi Pico (Need to toggle an LED on one thread and run a rotary menu connected to LCD on other thread)
import machine
import utime
import _thread
from rotary_encoder_classes import *
clock_pin = machine.Pin(25, machine.Pin.OUT)
frequency = 1
def clock(frequency):
while True:
clock_pin....
1
vote
1
answer
255
views
OutOfMemory in MicroPython
I use MicroPython on my Raspberry Pi Pico and try to display a BLOB coming from an HTTP API on a Waveshare ePaper display. This is my code:
epd = EPD_7in5_B()
epd.Clear()
while(True):
response = ...
0
votes
2
answers
882
views
First WiFi connection in MicroPython fails on RP2040
I'm running MicroPython on my Raspberry Pi Pico and trying to connect it to my WiFi with the following code:
wifi = network.WLAN(network.STA_IF)
wifi.active(True)
print(wifi.isconnected())
wifi....
0
votes
1
answer
204
views
Other code won’t run because webserver section is waiting for web requests
So I am trying to make an rc plane with the pi pico, so to make it remote controlled, i decided to have it host a little web server, just simply with the controls. And I got that to work. But then I ...
0
votes
1
answer
665
views
Cannot do a get request in micropython on esp32
I tried up to day to get requests working on micropython, tried installing libraries and everything.
I use thonny IDE. what can i do?
Error:
Traceback (most recent call last):
File "<stdin&...
0
votes
0
answers
468
views
Raspberry Pi Pico not executing main.py upon 5V
I have a Raspberry Pi Pico W with code on it that lights up the onboard LED once it has successfully connected to WiFi, otherwise the onboard LED will blink. Most times upon start up however, (I have ...
0
votes
1
answer
353
views
Raspberry Pi Pico W Autostart with Network
I am trying to autostart a pico W program.
I can get it to flash LEDs, but when I add my logic about temp sensor and network, it doesn't autostart anymore.
I save this program to main.py.
The program ...
-1
votes
1
answer
713
views
Display image from requests via framebuf
I've built an HTTP API returning an image (HTTP GET http://myRaspi/api/latestImage → returns image with content-type image/jpeg).
On my Raspberry Pi Pico, I loading the image with the urequests ...
0
votes
0
answers
24
views
error 'cannot covert [class] to int' in micropython
I was trying to use a function from my own class and it gave me this error:
Traceback (most recent call last):
File "/home/robot/MyBlocks/main.py", line 134, in <module>
File "...
1
vote
0
answers
72
views
"Access denied" in python serial library
Hello I am new at coding the microcontrolers and I dont know what I am doing wrong. Could someone help me. I get the access denied. I checked everything the port, baudrate, drivers and still get this ...
0
votes
1
answer
2k
views
How to make requests on microPython more efficient?
I´m currently programming an esp32 with micropython.
It runs a bigger project for university and I have a problem with the following code.
import urequests as request
def readWebsiteData():
...
0
votes
0
answers
190
views
How to avoid delays caused by garbage collection?
Using MicroPython on a Raspberry Pi Pico I receive a pulse wave (~17ms on, ~3ms off) then output relating to that. When garbage collector kicks in it messes up my output for about 6ms (too long for ...
0
votes
1
answer
101
views
How to structure class for a firmware application
I'm building a microcontroller project which is programmed in MicroPython, and I'm struggling to find a sensible way to extend my code to support multiple operating modes.
Currently it looks like this:...
0
votes
2
answers
225
views
Working on ESP8266 flashed with micropython firmware. I need help figuring out an issue with code when tested via <mperemote>
Just to summarise my issue I've been trying to clear the screen of a text that is displayed on a built in OLED display from my ESP8266EX board. I have uploaded the script to the board that includes ...
0
votes
1
answer
197
views
Why does my highscore saving output "TypeError: unsupported types for __ge__: 'int', 'list'" in micropython?
Why does my highscore saving output "TypeError: unsupported types for ge: 'int', 'list'" in micropython?
I tried making my Tetris game on my RaspberryPi Pico be able to save highscores, but ...
0
votes
1
answer
2k
views
Error installing Micropython libraries with Thonny IDE
I am trying to install umqtt.simple onto my Thonny IDE using Micropython. I have a Raspberry Pi Pico W with Micropython already installed on both the device and Thonny, and Micropython is the selected ...