Search found 9 matches

by grafalex
Sun Feb 27, 2022 6:13 pm
Forum: ESP8266 boards
Topic: UART swallows bytes
Replies: 4
Views: 2111

Re: UART swallows bytes

Thank you for your suggestions.
by grafalex
Sun Feb 27, 2022 4:39 pm
Forum: ESP8266 boards
Topic: UART swallows bytes
Replies: 4
Views: 2111

Re: UART swallows bytes

Thank you very much, that worked.
Though it still can receive the string in 16byte parts, but I managed to assemble the string in my code.
by grafalex
Sun Feb 27, 2022 3:09 pm
Forum: ESP8266 boards
Topic: UART swallows bytes
Replies: 4
Views: 2111

UART swallows bytes

Hi All, I am developing an application that is supposed to read a lot of text data from HW UART. For some reason it reads only first 15 bytes, and the rest of the message disappears. I tried both asyncio and raw UART approaches - same behavior. I also tried to use UART IRQ - looks like this is not s...
by grafalex
Mon Apr 09, 2018 1:29 pm
Forum: ESP8266 boards
Topic: pin change interrupt + debouncing
Replies: 18
Views: 21432

Re: pin change interrupt + debouncing

Hi All, Thank you very much for your comments. I ended up with this code. It feels pretty robust import machine import utime pin = machine.Pin(14, machine.Pin.IN, machine.Pin.PULL_UP) new_click_detected = False def callback(p): global new_click_detected new_click_detected = True #pin.irq(trigger=mac...
by grafalex
Sun Apr 08, 2018 7:28 pm
Forum: ESP8266 boards
Topic: pin change interrupt + debouncing
Replies: 18
Views: 21432

Re: pin change interrupt + debouncing

Thank you very much for your code.

I am basically using a polling approach, that was inspired by Peter's Switch class. But I got number of comments from the community that polling is not the best way, so now I am investigating pin change interrupt way.
by grafalex
Sun Apr 08, 2018 2:23 pm
Forum: ESP8266 boards
Topic: pin change interrupt + debouncing
Replies: 18
Views: 21432

Re: pin change interrupt + debouncing

Now what happens if the button gets into a stable state within 30ms? I am capturing value of the first trigger, not the last. I use it that way (but with asyncio) in my application for publishing the bell to mqtt. Could you please show me the code so that I am not reinventing the wheel? (I use uasy...
by grafalex
Sun Apr 08, 2018 1:31 pm
Forum: ESP8266 boards
Topic: pin change interrupt + debouncing
Replies: 18
Views: 21432

pin change interrupt + debouncing

Can someone help me understanding what is wrong with my pin change interrupt handler? I have a button, that is connected between GPIO14 (D5 pin on Wemos D1 mini) and ground. I need to count number of button presses. First I tried to trigger pin change interrupt only on falling edge, but this code of...
by grafalex
Wed Mar 07, 2018 7:55 pm
Forum: Programs, Libraries and Tools
Topic: mqtt_as: program structure questions
Replies: 3
Views: 3428

Re: mqtt_as: program structure questions

Hi Peter,

Thank you very much for your answers. This makes things more clear.

I did not know ESP stores WiFi password. This might be tricky to set password for every new board (I mean non-development boards, e.g. sonoff). Not a big deal, though
by grafalex
Sun Mar 04, 2018 5:15 pm
Forum: Programs, Libraries and Tools
Topic: mqtt_as: program structure questions
Replies: 3
Views: 3428

mqtt_as: program structure questions

Hi All, I am building an application based on ESP8266 board and mqtt_as framework. I learned examples bundled with https://github.com/peterhinch/micropython-mqtt library, but I still have a few questions. 1) Most (if not all) examples run main functions like this: [code] try: loop.run_until_complete...