@@ -0,0 +1,896 @@
+#!/usr/bin/env python3%0Aimport sys%0Aimport time%0Aimport glob%0A%0Aimport serial%0Aimport psutil%0A%0A%0ACPU_INTERVAL = 0.5%0ACONNECT_TIMEOUT = 2%0ABAUD = 4800%0A%0Adef update_loop(conn):%0A    while True:%0A        load = psutil.cpu_percent(interval=CPU_INTERVAL)%0A        scaled_load = int(load * 10)%0A        message = str(scaled_load).encode('ascii')%0A        conn.write(message)%0A%0Adef connect_serial(DEVICE, BAUD):%0A    conn = serial.Serial(DEVICE, BAUD)%0A%0A    # wtf%0A    conn.baudrate = 300%0A    conn.baudrate = BAUD%0A%0A    return conn%0A%0Adef main():%0A    while True:%0A        try:%0A            with connect_serial(glob.glob('/dev/ttyUSB?')%5B0%5D, BAUD) as conn:%0A                update_loop(conn)%0A        except IOError:%0A            print('Connection with %25s failed! Retrying in %25d seconds...'%0A                %25 (DEVICE, CONNECT_TIMEOUT), file=sys.stderr)%0A            time.sleep(CONNECT_TIMEOUT)%0A%0A%0Aif __name__ == '__main__':%0A    main()%0A

Add server script