Search found 5089 matches

by pythoncoder
Mon Apr 19, 2021 9:30 am
Forum: General Discussion and Questions
Topic: Web server In/out + physical button control via gpio
Replies: 7
Views: 238

Re: Web server In/out + physical button control via gpio

I haven't responded to this query because I lack web programming experience: I was hoping someone better qualified would pop up. I feel sure this can be done using uasyncio with a uasyncio-based server such as PicoWeb. I can explain how to use uasyncio to respond to hardware changes (see my tutorial...
by pythoncoder
Mon Apr 19, 2021 9:19 am
Forum: Raspberry Pi microcontroller boards
Topic: Pico start warning
Replies: 1
Views: 58

Re: Pico start warning

wangshujun@tom.com wrote:
Sun Apr 18, 2021 1:56 pm
... other serial port tools can't access normally. The environment is ST's CDC driver used by winc7 system CDC driver
I haven't seen this using rshell or miniterm.
by pythoncoder
Mon Apr 19, 2021 9:11 am
Forum: General Discussion and Questions
Topic: ssd1306 0.96 oled font size
Replies: 1
Views: 42

Re: ssd1306 0.96 oled font size

The SSD1306 driver inherits from FrameBuffer, which means that arbitrary fonts may be rendered using the Writer class in font-to-py.

There is also a nano-gui which works with these displays.
by pythoncoder
Mon Apr 19, 2021 9:02 am
Forum: General Discussion and Questions
Topic: Why mp_type_framebuf is declared as STATIC?
Replies: 2
Views: 40

Re: Why mp_type_framebuf is declared as STATIC?

One thing to note is that (unlike other built-in classes) the FrameBuffer class is designed to be subclassed in Python. I don't know what this involves at the C level, but there may be implications in any attempt to change it.
by pythoncoder
Mon Apr 19, 2021 8:55 am
Forum: General Discussion and Questions
Topic: How do you catch getaddrinfo() errors
Replies: 5
Views: 219

Re: How do you catch getaddrinfo() errors

Hi Dave, that link is for writers of C modules. Python error handling is simple and you seem to be doing it correctly. I can't see why the machine is freezing: what happens if you interrupt the program with ctrl-c? This should produce a traceback to show what it was doing when interrupted. There are...
by pythoncoder
Sun Apr 18, 2021 12:51 pm
Forum: ESP32 boards
Topic: LAN-Support with ESP-IDF 4
Replies: 1
Views: 87

Re: LAN-Support with ESP-IDF 4

A first step is to read the Contributor Guidelines and code conventions.
by pythoncoder
Sun Apr 18, 2021 12:46 pm
Forum: General Discussion and Questions
Topic: How do you catch getaddrinfo() errors
Replies: 5
Views: 219

Re: How do you catch getaddrinfo() errors

DNS queries can be expected sometimes to fail. The reason no error message is displayed is because you are trapping the resultant OSError and ignoring it. If you are always accessing the same IP address (or small set of addresses), you could do the DNS query/queries when the application starts (repe...
by pythoncoder
Sun Apr 18, 2021 12:26 pm
Forum: Programs, Libraries and Tools
Topic: Is passing 'self' to another class possible
Replies: 1
Views: 117

Re: Is passing 'self' to another class possible

Most applications involving displays instantiate the display early in the code's execution. That instance - typically a global singleton - is then available for use by any other object.
by pythoncoder
Sun Apr 18, 2021 12:21 pm
Forum: General Discussion and Questions
Topic: Time control in a while loop
Replies: 2
Views: 202

Re: Time control in a while loop

I would look at uasyncio. There is a learning curve, but in most cases it's the easiest way to manage tasks involving time delays. See the docs and this tutorial.
by pythoncoder
Sun Apr 18, 2021 12:18 pm
Forum: Raspberry Pi microcontroller boards
Topic: Wifi bridge for RPI Pico
Replies: 36
Views: 3042

Re: Wifi bridge for RPI Pico

... Difficult, but not impossible... I was suggesting that supporting MQTT using the ESP in its original "modem" mode would be problematic. I fully accept that it should be possible to write a MicroPython driver to provide a BSD socket to a non-networked client. This would communicate via a UART wi...