r/MicroPythonDev • • Aug 01 '22

uf2 bootloader does not mount on Windows

1 Upvotes

v1.19.1 uf2 does not mount as a USB drive with an adafruit feather RP2040.

The following is a list of things I have already tried that did not help.

  • I used adafruit's own flash_nuke.uf2

  • Uwe Sieber's DeviceCleanup

  • Factory reset the board into fs mode.

  • Device Manager scan for changes.

In pre-response to "maybe your USB cable is bad", "maybe your board is bad" , Circuitpython loads and runs just fine on this board.

The actual file is :

ADAFRUIT_FEATHER_RP2040-20220618-V1.19.1.uf2

Offending OS :

Windows 10 Home 21H2 19044.1826

This error is so pernicious I actually believe someone uploaded the wrong uf2 or mislabeled a file on the micropython website. I first encountered this error earlier this year now it is still happening.

Any advice about what to try next?


r/MicroPythonDev • • Jul 19 '22

Looking for micropython pid controller for position of a motor shaft

1 Upvotes

Anyone seen any example micropython code for a pid controller for positional control of a dc motor with encoder.


r/MicroPythonDev • • Jul 15 '22

Is there a way to use MicroPython on Pi Pico for keyboard inputs?

1 Upvotes

Hey!

I'm looking around for how to use a pico as a macro keyboard, but every tutorial seems to point to circuit python, which I'm not really in the mood to learn.

Is circuitpython a necessity? or is there a way to do it on micropython?

Thanks!


r/MicroPythonDev • • Jul 10 '22

Servo motor or stepper motor

1 Upvotes

I am trying to build a very small solar tracking program, which I already have the code to give me azimuth and elevation of the sun. I think I could easily use say a 35g servo motor and it should be easy to complete the code, but was wondering if a say Sequre 42 closed loop stepper motor would be more powerful, also the code for the stepper motor to track the sun in azimuth and elevation might be harder to write. Any suggestions? I do not want to use ldr’s.

Thanks


r/MicroPythonDev • • May 28 '22

TTGO firmware flashing

1 Upvotes

Could anyone point me in to the right direction please? Spent most of the day trying different ways and all failed. Windows 10.


r/MicroPythonDev • • Apr 23 '22

Need Help: pyBricks stopwatch in LEGO Mindstorms with nanoseconds

1 Upvotes

Hello,

I am using my LEGO Mindstroms EV3 with pyBricks and want to stop the time in nanoseconds. Sadly, the stopwatch class from pyBricks returns only second, but i need it much more precise than this. As far i know, the EV3 is running microPython. Is there a way to do so?


r/MicroPythonDev • • Apr 20 '22

Creating a Time Interval

1 Upvotes

Hey guys, I'm taking an introductory programming and microcontroller class. I'm making a program for it where I'm trying to get an LED to toggle every 500ms. I am trying to do this with utime.ticks_ms() rather than utime.sleep() but am not having any luck. I can only get it to toggle once, when the first 500ms is hit. Does anyone have any advice? Please keep in mind that I am extremely new at this.

Thank you!


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 ❤️