2

I have built a simple app with Blynk. Unfortunately, I regularly get the error:

Traceback (most recent call last):
  File "/home/pi/Desktop/Blynk/blynktest2.py", line 12, in <module>
    blynk.run()
  File "/home/pi/.local/lib/python3.7/site-packages/BlynkLib.py", line 252, in run
    self.process(data)
  File "/home/pi/.local/lib/python3.7/site-packages/BlynkLib.py", line 213, in process
    self.emit("int_"+args[1], args[2:])
IndexError: list index out of range

Even if I take out all code on my hardware and end up with the following code, the error comes up:

import BlynkLib

BLYNK_AUTH = 'MY_AUTH_IS_NORMALLY_HERE'    

# initialize blynk
blynk = BlynkLib.Blynk(BLYNK_AUTH)

while True:
    blynk.run()

I do not know exactly what causes the error, however, I noticed that the error occurs

  • when the Blynk app is moved to the background
  • when the screen of the mobile phone turns black
  • the eror does not occur when normal disconnecting in the Blynk app via the stop button in the top right, and also not if reconnecting then
wjandrea
  • 28,235
  • 9
  • 60
  • 81
Gerke
  • 926
  • 1
  • 10
  • 20
  • it's working properly in my system when tested. – Akash Pagar Sep 30 '19 at 08:28
  • Unfortunately not in my system, so I am thankful for any advice, why I am facing this error – Gerke Sep 30 '19 at 08:42
  • Based on the above it looks like it's going out of range with the `args` being passed in? Is it possible it's run differently when it's in the background? – sedavidw Oct 01 '19 at 15:00
  • I do not know. Unfortunately blynk.run() is a method from the BlynkLib, so I do not know, what they do. I personally did not implement any method changing the behavior when running in background – Gerke Oct 02 '19 at 10:26

1 Answers1

-1

This is one random issue which keeps happening. Try recreating the project by removing all the controllers or create a new project and update the authentication code in your code.