Search found 193 matches

by karfas
Tue Aug 16, 2022 11:20 pm
Forum: General Discussion and Questions
Topic: Missing something with mqtt simple/robust?
Replies: 4
Views: 2352

Re: Missing something with mqtt simple/robust?

If was my understanding that robust, check_msg would not let the broker drop connection? The broker will disconnect if the client does not respond, either on TCP or (depending upon QOS) on MQTT level. Nothing on the client side can change this behaviour. I assume you saturate the 8266 TCP stack wit...
by karfas
Tue Aug 16, 2022 9:25 pm
Forum: Raspberry Pi microcontroller boards
Topic: help please class error
Replies: 13
Views: 17020

Re: help please class error

Don't see this in the code.
Your get_xxx calls return the value of an instance variable (e.g. self.lux). However, this self.lux is set only in __init__() and set_lux().
As set_lux() never gets called (in your comparison of with/without class), get_lux() happily returns the value set during __init__().
by karfas
Tue Aug 16, 2022 6:07 pm
Forum: Raspberry Pi microcontroller boards
Topic: help please class error
Replies: 13
Views: 17020

Re: help please class error

Why do you think that self.humidity has any value when it isn't set by a call to get_humidity first?
by karfas
Fri Aug 12, 2022 11:54 am
Forum: Raspberry Pi microcontroller boards
Topic: Two buttons on the Pico W
Replies: 10
Views: 44175

Re: Two buttons on the Pico W

Micropython aims to be compatible (to some extent) with CPython-3. I'm sure you can find some good online courses for that.
by karfas
Tue Aug 09, 2022 3:31 pm
Forum: General Discussion and Questions
Topic: \xFF is missing from UART.read()
Replies: 24
Views: 29690

Re: \xFF is missing from UART.read()

So you are using some 2-year old micropython version most people here never had heard of and ask for help without giving any details ?
Maybe you should try a current version first (with a simple test program). If this works, you can look for differences and solutions.
by karfas
Tue Aug 09, 2022 2:49 pm
Forum: General Discussion and Questions
Topic: \xFF is missing from UART.read()
Replies: 24
Views: 29690

Re: \xFF is missing from UART.read()

I put the board to sleep and call uart.read() after the sender finish sending data. all \xff are received. However, other bytes are missing. So there seems to be no problem at all receiving 0xff. For me, this smells like some kind of handshake or timing problem. This is hard to analyze from the dis...
by karfas
Mon Aug 08, 2022 6:02 pm
Forum: General Discussion and Questions
Topic: \xFF is missing from UART.read()
Replies: 24
Views: 29690

Re: \xFF is missing from UART.read()

You dont't tell us anything about your circuits. Is the receiving UART controlled from micropython or not ? Is the RS485 receiver always on or do you poll different devices on the bus ? Are terminator resistors in place on the RS485 bus ? RS485 timing can be tricky. To rule out a general micropython...
by karfas
Sun Aug 07, 2022 10:03 am
Forum: General Discussion and Questions
Topic: Ancient ESP Versus New? LED Not On Pin 2?
Replies: 2
Views: 1455

Re: Ancient ESP Versus New? LED Not On Pin 2?

You might use machine.unique_id() to find out on which of your boards your program runs.
by karfas
Fri Aug 05, 2022 11:33 am
Forum: General Discussion and Questions
Topic: Performance issue with streams and uasyncio on ESP32
Replies: 3
Views: 1661

Re: Performance issue with streams and uasyncio on ESP32

What is the absolute difference in performance you observe ?
And where do you measure ?
For the echo reply readline() might be a few milliseconds slower.
For interpretation of the whole request you send (several lines) the last readline() will wait for the specified timeout (as described above).
by karfas
Thu Aug 04, 2022 9:58 am
Forum: General Discussion and Questions
Topic: Performance issue with streams and uasyncio on ESP32
Replies: 3
Views: 1661

Re: Performance issue with streams and uasyncio on ESP32

I assume the readline version in the code below (taken from https://github.com/peterhinch/micropython-async/blob/master/v3/as_drivers/client_server/userver.py) will happily read the last line and then wait for another one, until the timeout is reached. The additional overhead caused by readline() an...