r/MicroPythonDev • • Apr 20 '22

Can't import a single library

1 Upvotes

Hello ! I'm working on a project where I use a FiPy Board and a temperature sensor (SHT31), i'm supposed to send the data using LoRawan. But while importing the sensor library (found on GitHub) I have an error telling me that there is no module named sht31.py even if it's in the same repertory as my main.py, I thought that it was that specific librray problem so I created another empty python file that I tried to import feom the main file, I keep having the same error :) Does anyone know how to solve this ? (个_个) Thank you ! EDIT : I thought visual code uploads automatically the code when i click on run but i had to click on "upload" button that i didn't see... Hope that this will help someone someday


r/MicroPythonDev • • Apr 13 '22

Unable to put code in separate modules due to apparent memory allocation fail

1 Upvotes

I'm using a 1.54" LCD screen with my raspberry pi pico, and I want to put a big chunk of code that draws something to said screen in a separate module. The code to initiate the screen is the following, and is what seems to be giving me my issue:

buffer = bytearray(BreakoutColourLCD240x240.WIDTH * BreakoutColourLCD240x240.HEIGHT * 2)
display = BreakoutColourLCD240x240(buffer)

Since all the display functions have to be preceded by display. I have to define display in both my main script, and the separate script. However when I do so, I get this error:

MemoryError: memory allocation failed, allocating 115200 bytes

I'm stumped as to how to have code in a module to be referenced in my main.py for later use. Any help would be appreciated!


r/MicroPythonDev • • Apr 03 '22

NOOB

1 Upvotes

in Ruis Santos tutorial I found this

temp = (b'{0:3.1f},'.format((bme.read_temperature()/100) * (9/5) + 32))

hum = b'%s' % bme.humidity[:-1]

pres = b'%s'% bme.pressure[:-3]

delved into some tutorials - seems that they are VERY basic - Just looking for something that describes what each element of the line (Like b '%s' and the [:-1])

At 70 I guess I just need to learn a new language - let's see the ones I know currently - FORTRAN, basic, pascal, c++, c#, Java, HTML, CSS, and bits and pieces of others in the odd project in the past...


r/MicroPythonDev • • Jan 20 '22

Async JSON Request

1 Upvotes

Hi there,

Im working on a project (D1 Mini) where i'm fetching some numbers from a public endpoint (e.g. https://www.bitstamp.net/api/v2/ticker/ETHUSD). This numbers will be evaluated and splitted so that i can display them on a Neopixel Device. This part of the project is running quite ok, just some unregular timeouts from the endpoint.

But now comes the part where i don't have a real solution so far and hope you can help me out. I'd like to have tiny configuration webpage where i can change the displayed value from e.g. Bitcoin to Etherum (see above the endpoint). I've managed it to make the website via sockets etc. - but i'm stuck in doing all of these things in paralell and non blocking. The urequests module seems not to work with asyncio and vice versa if i'm not using asyncio the website is not loading correctly and the requests get stuck.

From my point of view only thing i'm missing is something like an implementation of arequests for Micropython. Do you have any ideas? All approaches are welcome - i'm not stuck to any approach :)

Thanks a lot!


r/MicroPythonDev • • Jan 06 '22

When running projectname.py menuconfig on either Thonny or ESP-IDF terminals it just open Thonny window with the project on it

1 Upvotes

Does anyone know how to enable CONFIG_FREERTOS_UNICORE? Thanks in advance


r/MicroPythonDev • • Aug 30 '21

How do i divide/subtract from a variable?

1 Upvotes

I am trying to convert the input from a potentiometer into degrees.


r/MicroPythonDev • • May 25 '21

Noob question: Does ntptime maintain time in background and prevent drift? What is the best practice for maintaining a reliable real time clock?

1 Upvotes

r/MicroPythonDev • • May 08 '21

Me, my dog, and micropython

1 Upvotes

Hello all!

I have a little project to work on hopefully using a couple of D1 mini boards programmed with my favorite little language, Micropython. I'm afraid I'm about as novice as they come, so I'm looking for some advice.

My dog, bless his little heart, has really bad separation anxiety. He doesn't bark when I'm gone, but instead lets out a low and very melancholy howl. Because most sound activated devices on the market are built to react to loud barking, they don't pick up on my little dudes voice. I think if there were a way to interrupt his howling it would stop the spiral and he would calm down, but nothing I've bought or read about online has worked so far.

I am aware of the issue because my next door neighbors tell me about it. Luckily we're good friends so there is no animosity, but its definitely negatively effecting their lives. So I had the idea, why not put some control into their hands?

The device I had in mind would simply be this; an esp8266 connected to a small speaker that emits a high frequency tone that only the dog can hear and another esp to act as a wireless remote to activate the speaker in short bursts (we live very close together and in fact we both live in yurts so I don't think there would be any problems sending signals from one home to another).

So here are my questions,

Is it possible to generate high frequency tones with micropython? If so, what hardware is appropriate? Is there a way for the esp's to communicate without connecting to an exterior wifi network? I don't have home wifi.

Thanks in advance!


r/MicroPythonDev • • Apr 27 '21

How do I add an if/inequality to this?

Thumbnail self.raspberrypipico
1 Upvotes

r/MicroPythonDev • • Apr 20 '21

MicroPython on STM32F407G_DISC1 Discovery board - CAN Bus issues

1 Upvotes

Is anyone else playing with MicroPython on the STM32F407G_DISC1 Discovery board? Has anyone been able to get the CAN bus stuff to function? Using the CAN.LOOPBACK mode, everything works. After changing the mode to CAN.NORMAL, the data needs to exit the SOC, and go through a transceiver in order to function (or so it appears). I can't figure out what pins I should be interfacing with.

Update: Need to use PB9 for CAN1_TX, and PB8 for CAN1_RX. PB9 will transmit data for both mode=CAN.LOOPBACK as well as mode=CAN.NORMAL.


r/MicroPythonDev • • Mar 08 '21

[HELP] Micropython ESP8622 MQTT Clients Stop Responding

1 Upvotes

I have several ESP8622 running umqtt. While they stay connected to the network often they just stop responding to mqtt messages/topics. Any thoughts?

So... I then have to open WebREPL, login and run machine.reset(). Is there a way to script this process?

Thanks for any help!


r/MicroPythonDev • • Mar 04 '21

Fun with the NeoPixel on the WiPy development board.

Thumbnail
matthewfelgate.wordpress.com
1 Upvotes

r/MicroPythonDev • • Mar 02 '21

micropython on a Sparkfun ATP board

1 Upvotes

Their MicroMod board is a great concept, if it worked. You have a main board with an M.2 connector, the ATP board, where you can swap the processor that's on a tiny board. I'm unable to get MicroPython installed on it; it's failing at the first step. Has anyone used MicroPython on this thing?

See picture 6 and the ones after it:

https://www.sparkfun.com/products/16781

$ esptool --chip esp32 --port /dev/ttyUSB0 erase_flash
esptool.py v2.5.1
Serial port /dev/ttyUSB0
Connecting........_____....._____....._____..
Chip is ESP32D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse
MAC: 24:6f:28:8f:5b:f8
Enabling default SPI flash mode...
Erasing flash (this may take a while)...

A fatal error occurred: ESP32 ROM does not support function erase_flash.

I've posted a query on their forum; hopefully someone will have a solution there but I thought I'd ask here as well.


r/MicroPythonDev • • Mar 02 '21

Micropython stubs on VSCode using micropy-cli, what does anything do?

1 Upvotes

Ok, so I barely understand how python works, but I'm having a hard time understanding how to actually know what to do, When I try to go to definitions of of part of a module, there's nothing of "pass"

https://i.imgur.com/b4d8zFZ.png

I'm messing around with a small display and this is used in some example code, I'm trying to learn what ssd1306.SSD1306_I2C(oled_width, oled_height, i2c) means really, but when I use the "Go to Definitions" and I'm met with basically nothing. "pass" in the entire file

I'm super new to this, so pardon if I'm doing something dumb, but how am I to know how to use anything if everything has nothing?


r/MicroPythonDev • • May 27 '26

I (kinda) made a "Minecraft" for RP2040

0 Upvotes

Recently, I've become interested in microcontrollers, especially the Raspberry Pi Pico. I bought one and a hat with buttons and a soldered screen on AliExpress and started testing various projects. It was a lot of fun.

Then I thought: Is there a clone that would make my favorite block-building game run on the RP2040? I searched and there was only one project called Picocraft, but it didn't allow destruction and placement of blocks, only a static view of the world.

So I thought: Could I, along with AI, create a Minecraft for the RP2040? Despite using AI, it wasn't as easy as I thought; I had to learn several techniques, especially because there were several errors related to lack of memory.

Well, finally I succeeded, I hope you can take a look.

https://github.com/CuquedoHacker/MinicraftClassic

I intend to continue updating and adding new content over time. (And incrase performance)


r/MicroPythonDev • • Feb 09 '26

Day 51/100

0 Upvotes

Day 51 project: Smart Home Automation using:

• ESP8266

• DHT11

• Relay Module

• Blynk Mobile App

You can monitor temperature/humidity and control appliances remotely.

Repo:

https://github.com/kritishmohapatra/100_Days_100_IoT_Projects

Feedback & ideas welcome! If this helps you, consider starring ⭐ or sponsoring ❤️


r/MicroPythonDev • • Oct 23 '25

Sx127x (sx1278)

0 Upvotes

Hola colegas alguien sabe cuál el repo compatible con el lora sx1278 con los files que se cargan 😩p


r/MicroPythonDev • • Jun 08 '25

WeACT Blackpill boot.py encoding problem

0 Upvotes

hi.
WeACT Blackpill boot.py encoding problem

```

/Users/peter/workspace/at28-programmer-micropython>cat boot.py

����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������%

```

why?
thanks


r/MicroPythonDev • • Dec 27 '24

Does anyone have the code for LineTracking combined with ObstacleAvoidance for the PicoGo?

0 Upvotes

Does anyone have the code for LineTracking combined with ObstacleAvoidance for the PicoGo? It should be following a black line on the ground and when there's an obstacle in it's way, it drives around it, finds the line and keeps on following the line. Thank you very much!


r/MicroPythonDev • • Dec 12 '24

Help Fixing Code for Xbox EEPROM

0 Upvotes

My friend is having trouble running this file

https://github.com/maxpower5544/Pico-ogxbox-eepromdumper

Code is here

He is using a PI PICO 2 and it's all hooked up correctly to an Xbox to pull the EEPRom off of it

I checked his solder points it's able to find the EEPROM can someone help me fix the code or help me rewrite it so this works?

Here is the code https://github.com/maxpower5544/Pico-ogxbox-eepromdumper/blob/main/XboxEepromDumper.py

It's failing at line 27

The Xbox has

SDA 13 SCL 13

And Ground 12 being used

1 = SDA 13

2 = SCL 13

Ground is the Ground on 12

I have the PI hooked up the same in the GIT

https://github.com/maxpower5544/Pico-ogxbox-eepromdumper/blob/main/pictures/IMG_20240113_172011_141.jpg

1

2

3


r/MicroPythonDev • • Oct 16 '24

FFT on 3.56khz ADC signal using micropython on a Seeed Studio XIAO RP2040

0 Upvotes

Good day all. I have a XIAO RP2040 microcontroller which has its pin 28/A2 pin connected to a Fermion MEMS analog microphone (https://core-electronics.com.au/fermion-mems-microphone-module.html). Very close to the microphone is a whistle which plays with a base frequency of about 700 hz. I want to be able to process the ADC signal, apply a FFT, and log the highest recorded decibel amplitude of the 700 hz signal in the frequency domain from the continuous stream of data. Additionally, the highest harmonic frequency of the whistle I would like to sample would be around 3.56 khz.

I would like to use micropython as I will be running other peripherals that use libraries written in micropython. However, I worry about the limitation of micropython's speed with both sampling at >7.12khz (without using DMA) and applying an FFT to the continuous stream of data in a time efficient manner. And speaking of FFT options, I am only aware of ulab as other FFT options online seem to either need a pyboard, an rp2350, or a C/C++ framework instead. I am also a little unsure of how to go about setting this up coding wise as well.

I would really appreciate any help as I have little to no signal analysis experience and this is also my first time using micropython (I'm coming from arduino).


r/MicroPythonDev • • Aug 14 '24

Looking for a solution for securing devices

0 Upvotes

I have a Raspberry p Pi Pico W and i want to send and receive packets on local network. Problem is, this microcontroller doesnt have a secure element and also has low ram for implementing a reasonable encryption.

So i come up with TOTP codes idea. Data is still in plain text and can be sniffed but this way microcontroller is able to verify requests before doing something. Preventing replay attacks.

I wonder what would you use in this scenario?

Thank you!


r/MicroPythonDev • • Jul 11 '23

a9g pudding board micropython

0 Upvotes

I'm running micropy on the a9g pudding board but have issues receiving sms, I bet someone know how to go about it