Search found 775 matches

by kevinkk525
Sat Oct 24, 2020 5:55 pm
Forum: Programs, Libraries and Tools
Topic: asyncio : cancelling gathered tasks
Replies: 2
Views: 60

Re: asyncio : cancelling gathered tasks

That's a bug that hasn't been fixed yet: https://github.com/micropython/micropython/issues/5798
I'm hoping that Damien will revisit uasyncio soon..
by kevinkk525
Thu Oct 15, 2020 6:29 pm
Forum: General Discussion and Questions
Topic: Using machine.deepsleep() with uasyncio
Replies: 6
Views: 227

Re: Using machine.deepsleep() with uasyncio

I'd stay with uasyncio but program it like it reboots every time. So connect, sync the time, check the schedule (e.g. wakup between minutes 0-15 -> publish to broker, else save to file) and sleep again. If you are familiar with uasyncio and its modules, it might be more difficult to write code in sy...
by kevinkk525
Mon Oct 12, 2020 10:15 am
Forum: General Discussion and Questions
Topic: Using mqtt broker status messages as connection alive checker
Replies: 11
Views: 350

Re: Using mqtt broker status messages as connection alive checker

the broker never establishes a connection with the client. It is always the mqtt client that establishes a connection with the broker and the connection is being used bi-directionally. So if the client successfully connects to the broker, the broker can send messages to the client.
by kevinkk525
Fri Oct 09, 2020 7:56 am
Forum: General Discussion and Questions
Topic: Help needed: My loop is ending prematurely
Replies: 4
Views: 168

Re: Help needed: My loop is ending prematurely

My guess is on the mqtt.check_message() being stuck but I haven't worked with the synchronous umqtt.robust version in years to help with it.. I always recommend switching to uasyncio if one is willing to learn it.
by kevinkk525
Mon Sep 28, 2020 9:17 pm
Forum: ESP32 boards
Topic: ADC voltage coversion accuray error
Replies: 3
Views: 164

Re: ADC voltage coversion accuray error

The Esp32 adc is not very accurate and not linear at the edges but after some calibration in code it worked rather acceptable in my case. For me this worked best: adc/4095*3.4 + 0.112 So the maximum voltage at 3.4V and an offset of 0.112V. It will not give you good results at the edges (close to 0V ...
by kevinkk525
Sat Sep 26, 2020 3:28 pm
Forum: ESP32 boards
Topic: Handling Exceptions when Using Uasyncio v3
Replies: 6
Views: 689

Re: Handling Exceptions when Using Uasyncio v3

See https://github.com/micropython/micropython/pull/5796 on how to handle exceptions in micropython uasyncio and CPython asyncio.
by kevinkk525
Thu Sep 24, 2020 12:30 pm
Forum: General Discussion and Questions
Topic: Error messages via mqtt
Replies: 7
Views: 707

Re: Error messages via mqtt

good luck!
nice design :D
by kevinkk525
Thu Sep 24, 2020 10:04 am
Forum: General Discussion and Questions
Topic: Error messages via mqtt
Replies: 7
Views: 707

Re: Error messages via mqtt

I put time.sleep_ms(100) before executing any code, lets the esp background tasks settle, maybe that helps a bit, maybe not :D In your code I can't see a mqtt client but I see that you are using a synchronous programming approach (using utime.sleep). Maybe that is a source of problems too because lo...
by kevinkk525
Thu Sep 24, 2020 7:12 am
Forum: General Discussion and Questions
Topic: Error messages via mqtt
Replies: 7
Views: 707

Re: Error messages via mqtt

Then I guess you should find out why your mqtt connection breaks this often. I never have any connection issues except for the occasional wifi outage that triggers a reconnect but those take less than 10 seconds so I never actually lose any mqtt messages even though I send most of them with a timeou...
by kevinkk525
Wed Sep 23, 2020 7:16 pm
Forum: General Discussion and Questions
Topic: Error messages via mqtt
Replies: 7
Views: 707

Re: Error messages via mqtt

In my project I send log messages over mqtt like this: https://github.com/kevinkk525/pysmartnode/blob/master/pysmartnode/logging/logging_full.py Every log message will be sent directly over mqtt, no files on the device itself, but it could easily be changed to also write log files on the device itse...