make work with rio
This commit is contained in:
parent
50704497f4
commit
ecf1b53623
@ -1,4 +1,3 @@
|
||||
# server.py on laptop
|
||||
from networktables import NetworkTables
|
||||
from time import sleep
|
||||
|
||||
|
@ -1,9 +1,8 @@
|
||||
# client.py on Pi
|
||||
from networktables import NetworkTables
|
||||
import time
|
||||
import psutil
|
||||
|
||||
NetworkTables.initialize(server='192.168.1.76') # Laptop IP here
|
||||
NetworkTables.initialize(server='10.26.48.2=') # Resiving device IP
|
||||
table = NetworkTables.getTable("PiStatus")
|
||||
|
||||
while True:
|
||||
@ -17,7 +16,7 @@ while True:
|
||||
cputemp = f"{temps[label][0].current:.1f}"
|
||||
break
|
||||
else:
|
||||
# fallback for Pi
|
||||
# to force it to work when on PI
|
||||
try:
|
||||
with open("/sys/class/thermal/thermal_zone0/temp") as f:
|
||||
cputemp = f"{int(f.read()) / 1000:.1f}"
|
||||
|
Loading…
Reference in New Issue
Block a user