Search found 969 matches

by kevinkk525
Fri May 29, 2020 1:09 pm
Forum: Programs, Libraries and Tools
Topic: mqtt_as library and esp8266
Replies: 4
Views: 3000

Re: mqtt_as library and esp8266

In your main code you can put this block after you have created the "client" object: async def connect(): while True: try: await client.connect() return except OSError as e: print("Error connecting to wifi or mqtt:", e) # not connected after trying.. not much we can do without a connection except # ...
by kevinkk525
Fri May 29, 2020 10:37 am
Forum: General Discussion and Questions
Topic: Differentiate Double & Single Click of a button
Replies: 10
Views: 6802

Re: Differentiate Double & Single Click of a button

oh yes, thanks @pythoncoder. I missed the detail about having to use the release_func
by kevinkk525
Fri May 29, 2020 10:36 am
Forum: General Discussion and Questions
Topic: comparing class methods
Replies: 4
Views: 2504

Re: comparing class methods

If I remember correctly, it is not a bug but a difference to CPython. Each time a method is accessed, it is created on the heap and therefore does not show equality. I had the same problem with asynchronous methods. Cpython handles it somehow differently. I can't find a link right now but it was dis...
by kevinkk525
Fri May 29, 2020 9:57 am
Forum: Programs, Libraries and Tools
Topic: mqtt_as library and esp8266
Replies: 4
Views: 3000

Re: mqtt_as library and esp8266

I'm just a Padawan but this is how I handle it :D while True: try: await client.connect() return except OSError as e: _log.error("Error connecting to wifi or mqtt:", e) # not connected after trying.. not much we can do without a connection except # trying again. # Don't like resetting the machine as...
by kevinkk525
Wed May 27, 2020 9:18 pm
Forum: General Discussion and Questions
Topic: Differentiate Double & Single Click of a button
Replies: 10
Views: 6802

Re: Differentiate Double & Single Click of a button

pb = Pushbutton(pin, suppress=True)

Should solve your problem.
by kevinkk525
Tue May 26, 2020 8:59 pm
Forum: Programs, Libraries and Tools
Topic: MQBoard - Micro-Framework for MicroPython Boards Managed via MQTT
Replies: 10
Views: 8621

Re: MQBoard - Micro-Framework for MicroPython Boards Managed via MQTT

Maybe one day I'll try to build my pysmartnode project (which is a very similar framework but without OTA and mostly built around esp8266 and more smarthome focused) on top of your framework ;)
Will have to take a closer look at the code and how to hook into it.
by kevinkk525
Tue May 26, 2020 10:00 am
Forum: Programs, Libraries and Tools
Topic: MQBoard - Micro-Framework for MicroPython Boards Managed via MQTT
Replies: 10
Views: 8621

Re: MQBoard - Micro-Framework for MicroPython Boards Managed via MQTT

A very nice project!

I especially like the OTA over mqtt option, something my project is definitely missing on the esp32.
by kevinkk525
Fri May 22, 2020 7:23 am
Forum: General Discussion and Questions
Topic: The dreaded forgotten await
Replies: 3
Views: 2103

Re: The dreaded forgotten await

In Cpython you would get a warning:

Code: Select all

Warning (from warnings module):
  File "<pyshell#8>", line 3
RuntimeWarning: coroutine 'test' was never awaited
But I have no idea how that could be implemented in micropython. It would be helpful.
by kevinkk525
Wed May 20, 2020 1:19 pm
Forum: ESP32 boards
Topic: ESP32 ADC voltage drop after some hours
Replies: 24
Views: 12071

Re: ESP32 ADC voltage drop after some hours

It doesn't seem to cause problems with real resistors, even with AC measurements, so it probably is not the ADC itself that is causing these offsets. At least in my last tests with resistors it did not make a difference if rshell was connected or not. But as soon as I use the probe, it immediately m...