Skip to content

Commit

Permalink
blink internal led of rpi while active
Browse files Browse the repository at this point in the history
  • Loading branch information
emrekaankocoglu committed Aug 8, 2022
1 parent 9845e60 commit 7cc1864
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/agent/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import datetime
from checkConnection import *
input=""
ledStatus=0
os.system('sudo sh -c "echo none > /sys/class/leds/led0/trigger"')
template= {
"time":"" ,
"temperature":"",
Expand Down Expand Up @@ -55,6 +57,8 @@ def c8ySend(files):
template["light"]=int(convertLight(int(valueArray[0])))
payload=json.dumps(template)
os.system("tedge mqtt pub tedge/measurements '"+payload+"'" )
os.system('sudo sh -c "echo '+str(-ledStatus)+' > /sys/class/leds/led0/brightness"')
ledStatus~=ledStatus
while True:
if (checkConnection()):
fileHandler()
Expand Down

0 comments on commit 7cc1864

Please sign in to comment.