Permalink
Browse files

stop from crashing on failed upload

  • Loading branch information...
1 parent e657f50 commit b6134c846668d681180485490dc6da82b49ccd9f @ericbarch committed Feb 15, 2014
Showing with 5 additions and 2 deletions.
  1. +5 −2 rad.py
View
7 rad.py
@@ -11,7 +11,7 @@ def upload():
cpm = str(float(len(events))/float(5))
params = urllib.urlencode({'field1': cpm})
headers = {
- "X-THINGSPEAKAPIKEY": "YOUR-CHANNEL-KEY",
+ "X-THINGSPEAKAPIKEY": "YOUR_API_KEY",
"Content-Type": "application/x-www-form-urlencoded",
"Content-Length": str(len(params))
}
@@ -70,7 +70,10 @@ def main():
loops = loops + 1
if (loops > 30):
loops = 0
- upload()
+ try:
+ upload()
+ except:
+ pass
# done
GPIO.cleanup()

0 comments on commit b6134c8

Please sign in to comment.