...
|
...
|
@@ -111,15 +111,19 @@ def on_message(client, userdata, msg):
|
111
|
111
|
FCnt=parsed['DevEUI_uplink']['FCntUp']
|
112
|
112
|
csvLine+=parseTopic[1]+","+parseTopic[3]+","+parsed['DevEUI_uplink']['Time']+","+str(epoch)+","+str(FCnt)
|
113
|
113
|
except:
|
|
114
|
+ # Test if notification
|
114
|
115
|
try:
|
115
|
116
|
dlFPort=parsed['DevEUI_downlink_Sent']['FPort']
|
116
|
117
|
dlFCntDn=parsed['DevEUI_downlink_Sent']['FCntDn']
|
117
|
118
|
say("DL ID: "+parseTopic[1]+" DevEUI: "+parseTopic[3]+" F: "+str(dlFCntDn)+" Fport: "+str(dlFPort))
|
118
|
119
|
except:
|
119
|
|
- with open(server['logfile'],'a+') as f:
|
120
|
|
- f.write("------------------------------\nMQTT Error: topic: "+msg.topic+" content: "+msg.payload.decode('ASCII')+"\n------------------------------\n")
|
121
|
|
- f.close()
|
122
|
|
- warn("Uh ho")
|
|
120
|
+ try:
|
|
121
|
+ say("Notification "+parseTopic[1]+" DevEUI: "+parseTopic[3]+" "+parsed['DevEUI_notification']['Type'])
|
|
122
|
+ except:
|
|
123
|
+ with open(server['logfile'],'a+') as f:
|
|
124
|
+ f.write("------------------------------\nMQTT Error: topic: "+msg.topic+" content: "+msg.payload.decode('ASCII')+"\n------------------------------\n")
|
|
125
|
+ f.close()
|
|
126
|
+ warn("Uh ho")
|
123
|
127
|
return
|
124
|
128
|
messageType = "UNKNOWN"
|
125
|
129
|
try:
|