Skip to content
This repository was archived by the owner on May 7, 2025. It is now read-only.
This repository was archived by the owner on May 7, 2025. It is now read-only.

an error in blynktimer.py #2

Closed
Closed

Description

@LahmYing

######## when I am running the basic example in TIMERS.md ######
from blynktimer import Timer
blynk_timer = Timer()

@blynk_timer.register(interval=1, run_once=True)
def your_run_once_function():
print('Hello, World!')

@blynk_timer.register(interval=5)
def your_periodical_function():
print('Hello, Blynkers!')

while True:
blynk_timer.run()

######## it raises error as below ########
mpython soft reboot
Traceback (most recent call last):
File "main.py", line 5, in
File "blynktimer.py", line 37, in init
TypeError: object of type 'dict_view' has no len()
MicroPython v1.3.0-11-g537a05c on 2019-04-08; mPython with ESP32
Type "help()" for more information.

Activity

  1. antohaUa commented on Apr 22, 2019

    @antohaUa
    Collaborator

    dict_view corrections were done in new fix (Thx for your findings). But there possible further issues with select.select usage. According official documentation https://docs.micropython.org/en/latest/library/uselect.html "..This function is provided by some MicroPython ports ..." so NOT all micropython versions can support it. Here you can be lucky or ...not.
    Also within TIMERS.md I had mentioned other options of building timers for micropython. Just check please https://docs.micropython.org/en/latest/library/machine.Timer.html
    If this option will be inconvenient for you just let me know - i will try to think about solution compatible for all micropython ports.

  2. antohaUa commented on Apr 25, 2019

    @antohaUa
    Collaborator

    Additionally added support of cases when select.select wait is not supported by OS or micropython port.
    Issue can be closed.

  3. LahmYing commented on Apr 25, 2019

    @LahmYing
    Author
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions