Skip to content

Commit

Permalink
Try and correct this error
Browse files Browse the repository at this point in the history
24.03.18 19:47:25 (+0000)  main  Traceback (most recent call last):
24.03.18 19:47:25 (+0000)  main    File "/usr/src/app/main.py", line 127, in <module>
24.03.18 19:47:25 (+0000)  main      data = looprequest()
24.03.18 19:47:25 (+0000)  main    File "/usr/src/app/main.py", line 80, in looprequest
24.03.18 19:47:25 (+0000)  main      if int(response[0]) != 6:
24.03.18 19:47:25 (+0000)  main  IndexError: index out of range
  • Loading branch information
Jbithell committed Mar 24, 2018
1 parent 25a78db commit dc928f7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def looprequest():
# log("[ERROR] Data too short")
# errorcount = errorcount + 1
# return False
if int(response[0]) != 6:
if (len(response) < 1) or (int(response[0]) != 6):
log("[ERROR] Device failed to respond with ASCII ACK")
errorcount = errorcount + 1
# Didn't respond with an Ascii acknowlegement
Expand Down

0 comments on commit dc928f7

Please sign in to comment.