kopia lustrzana https://github.com/DL7AD/pecanpico10
Made website design adjustments, fixed loop bug (unfinished)
rodzic
0a0c0e087a
commit
73011495e5
|
@ -148,17 +148,14 @@ if args.device == 'I': # Source APRS-IS
|
|||
# Read data
|
||||
try:
|
||||
buf = tn.read_until(b"\n").decode('charmap')
|
||||
print(">> " + buf)
|
||||
except EOFError: # Server has connection closed
|
||||
wdg = 0 # Tell watchdog to restart connection
|
||||
print("EOF ERROR")
|
||||
wdg = 0 # Tell watchdog to reconnect
|
||||
except UnicodeDecodeError:
|
||||
print("UNICODE DECODE ERROR")
|
||||
pass
|
||||
|
||||
if '# aprsc' in buf: # Watchdog reload
|
||||
print('Ping from APRS-IS')
|
||||
wdg = time.time() + 30
|
||||
else: # Data handling
|
||||
received_data(buf)
|
||||
|
||||
# Watchdog reconnection
|
||||
if wdg < time.time():
|
||||
print('APRS-IS connection lost... reconnect')
|
||||
|
@ -171,6 +168,12 @@ if args.device == 'I': # Source APRS-IS
|
|||
print('Could not connect to APRS-IS: %s' % str(e))
|
||||
print('Try again...')
|
||||
|
||||
if '# aprsc' in buf: # Watchdog reload
|
||||
print('Ping from APRS-IS')
|
||||
wdg = time.time() + 30
|
||||
else: # Data handling
|
||||
received_data(buf)
|
||||
|
||||
time.sleep(0.01)
|
||||
|
||||
elif args.device is '-': # Source stdin
|
||||
|
|
|
@ -77,7 +77,7 @@ telemetry {
|
|||
}
|
||||
|
||||
@media all and (min-width: 800px) {
|
||||
.side { order: 1; width: 270px; float: left; }
|
||||
.side { order: 1; width: 250px; float: left; }
|
||||
.telemetry { order: 2; flex: 3 0px; min-width: 456px; max-width: 456px; }
|
||||
.range { order: 3; text-align: left; }
|
||||
.chart { order: 4; flex: 3 0px; min-width: 456px; max-width: 456px; }
|
||||
|
|
|
@ -273,7 +273,7 @@ function loadRecentData() {
|
|||
|
||||
var time = new Date(data['org'] == 'pos' ? data['rxtime']*1000 : data['gps_time']*1000);
|
||||
|
||||
if(last != null && time - last > range*1000/60 && time - last > 300000) { // Gap in the data set
|
||||
if(last != null && (time - last > range*1000/60 && time - last > 300000 || time <= last)) { // Gap in the data set
|
||||
dataBattery.addRow([null, null, null, null]);
|
||||
dataSolar.addRow([null, null, null, null]);
|
||||
dataTemp.addRow([null,null,null,null,null,null]);
|
||||
|
|
Ładowanie…
Reference in New Issue