Search found 5956 matches

by pythoncoder
Tue Jul 12, 2022 9:55 am
Forum: General Discussion and Questions
Topic: Class destructor. Implementation error?
Replies: 3
Views: 948

Re: Class destructor. Implementation error?

I've believe this is a limitation of CPython too - IIRC the destructor is not guaranteed to be called until you quit the interpreter. In a firmware "run forever" type application that equates to no guarantee at all.
by pythoncoder
Mon Jul 11, 2022 8:58 am
Forum: ESP32 boards
Topic: ESP32 Sun Tracking
Replies: 3
Views: 1749

Re: ESP32 Sun Tracking

This crops up periodically with people proposing an assortment of solutions with variable levels of complexity. I think there are ways to simplify these things - I might even build one to prove the point. Azimuth/elevation isn't necessarily the ideal coordinate system. The following comments apply t...
by pythoncoder
Mon Jul 11, 2022 8:36 am
Forum: Raspberry Pi microcontroller boards
Topic: lightsleep
Replies: 12
Views: 9635

Re: lightsleep

That is useful information :D
by pythoncoder
Mon Jul 11, 2022 7:58 am
Forum: General Discussion and Questions
Topic: @micropython.native not implemented too long
Replies: 14
Views: 4981

Re: @micropython.native not implemented too long

As a general point I stopped using pyminify on MP programs several years ago. Cross-compiling achieves a size reduction on the order of 3:1. It has other benefits: faster loading and lower RAM use because the code is pre-compiled.
by pythoncoder
Sun Jul 10, 2022 4:42 pm
Forum: Raspberry Pi microcontroller boards
Topic: lightsleep
Replies: 12
Views: 9635

Re: lightsleep

I now have a Pico W :D From a quick test, machine.lightsleep puts the RP2040 into lightsleep, but does not shut down the WiFi chip. If I power up the board and issue lightsleep , current drops to under 1mA. However if I power up, connect to WiFi, then issue lightsleep , current drops from 40mA to ab...
by pythoncoder
Fri Jul 08, 2022 9:14 am
Forum: ESP32 boards
Topic: [gelöst] ESP32 mit SSD1306 deutsche Umlaute
Replies: 13
Views: 5969

Re: [gelöst] ESP32 mit SSD1306 deutsche Umlaute

This is the doc. You should be able to produce fonts with any Unicode characters using the -k option (provided the glyphs are present in the source ttf or otf file).
by pythoncoder
Fri Jul 08, 2022 8:57 am
Forum: Raspberry Pi microcontroller boards
Topic: possible bug with viper code in class
Replies: 12
Views: 4657

Re: possible bug with viper code in class

jimmo wrote:
Fri Jul 08, 2022 6:50 am
...
This bug is actually a lot worse -- all integers are being encoded incorrectly.
...
Could this be related?
by pythoncoder
Thu Jul 07, 2022 8:35 am
Forum: General Discussion and Questions
Topic: How to deal with mqtt_as and multiple subscriptions?
Replies: 5
Views: 1611

Re: How to deal with mqtt_as and multiple subscriptions?

It might be worth you looking at the uasyncio tutorial as this question is a generic query about asynchronous programming.

In short, the callback should run to completion quickly but it can launch asynchronous tasks using uasyncio.create_task(). These will run "in the background".
by pythoncoder
Thu Jul 07, 2022 8:07 am
Forum: General Discussion and Questions
Topic: Can you strip unneeded code somehow from MP?
Replies: 4
Views: 1111

Re: Can you strip unneeded code somehow from MP?

This sounds like a CS question akin to the Halting Problem: is it possible to write a program which, given as input a program P and a line number N, will return True if line N will eventually be executed?
by pythoncoder
Thu Jul 07, 2022 7:58 am
Forum: Raspberry Pi microcontroller boards
Topic: lightsleep
Replies: 12
Views: 9635

Re: lightsleep

Micropower operation is something of a black art with behaviour varying between platforms. I have had success using deepsleep on the UM Feather S2 - my example uses 66μA in deepsleep. See this script discussed here . The script sends data via MQTT then goes to sleep for a period. On waking main.py s...