File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ RUN pip3 install cffi
2525RUN pip3 install cairocffi==0.6
2626RUN pip3 install pyserial pusher
2727RUN pip3 install balena-sdk
28+ RUN pip3 install sentry-sdk
2829#pip also install - git+https://github.com/resin-io/resin-sdk-python.git
2930
3031# Set our working directory
Original file line number Diff line number Diff line change 1010import sqlite3 #Database
1111import pusher #Pusher.com
1212
13+ import sentry_sdk
14+ from sentry_sdk import capture_message
15+ sentry_sdk .init (
16+ 17+ traces_sample_rate = 1.0 ,
18+ )
19+
1320os .environ ['TZ' ] = 'Europe/London' #SetTimezone
1421def log (message ):
1522 print (message )
@@ -127,6 +134,8 @@ def looprequest():
127134 errorcount = errorcount + 1
128135 return False # Ignore - there's very little we can do remotely :(
129136 elif data ["windSpeed" ] > 80 or data ["temperatureC" ] > 50 or data ["humidity" ] > 100 or data ["windDirection" ] > 360 :
137+ capture_message (repr (data ))
138+ capture_message (response .decode ("utf-8" ))
130139 log ("[INFO] Ignoring data because it's a bit weird" )
131140 return False
132141 elif data ["windSpeed" ] == 0 and data ["windDirection" ] == 0 : #This indicates it's struggling for data so ignore
You can’t perform that action at this time.
0 commit comments