From Mark CLohesy, 2 Months ago, written in C++.
This paste will perish in 8 Months.
Embed
  1.  
  2.  
  3. Skip to content
  4. Using Gmail with screen readers
  5. in:sent script lcd
  6.  
  7. Conversations
  8. Scripts
  9.  
  10. Hiddensoul (Mark Clohesy) <hiddensoul@twistedsouls.com>
  11. Attachments
  12. Sat, May 2, 2015, 8:43 PM
  13. to Brodie
  14.  
  15. Here is the MODEM reboot script
  16. gargoyle-reset.py
  17.  
  18. The old LCD status script
  19. LCD-OLD.py
  20.  
  21. the new LCD Script
  22. LCD.py
  23.  
  24. and the arduino sketch for the LCD
  25. ​​shack_LCD​.ino
  26.  
  27. 4 Attachments
  28.  
  29. #!/usr/bin/python
  30. import os
  31. import serial
  32. import time
  33.  
  34. #Send Null to wake up arduino serial
  35. ser = serial.Serial('/dev/ttyUSB0', 9600)
  36. ser.write(chr(0))
  37. time.sleep(2)
  38.  
  39. while True:
  40. #Ping DCSI for Internet State
  41.         hostname = "203.22.132.1"
  42.         response = os.system("ping -c 1 -W 2 " + hostname)
  43.  
  44.         if response == 0:
  45.                 byteSer = 97
  46.         else:
  47.                 byteSer = 98
  48.  
  49. #Write DCSI State to Serial port
  50.         ser.write(chr(byteSer))
  51.         time.sleep(2)
  52.  
  53. #Ping SS Titanic for Server State
  54.         hostname = "192.168.0.3" #example
  55.         response = os.system("ping -c 1 -W 2 " + hostname)
  56.  
  57.         if response == 0:
  58.                 byteSer = 99
  59.         else:
  60.                 byteSer = 100
  61.  
  62. #Write TITANIC State to Serial port
  63.         ser.write(chr(byteSer))
  64.         time.sleep(2)
  65.  
  66. #Ping GOOGLE for Internet State
  67.         hostname = "google.com"
  68.         response = os.system("ping -c 1 -W 2 " + hostname)
  69.  
  70.         if response == 0:
  71.                 byteSer = 48
  72.         else:
  73.                 byteSer = 49
  74.  
  75. #Write GOOGLE State to Serial port
  76.         ser.write(chr(byteSer))
  77.         time.sleep(2)
  78.  
  79.  
  80.  
  81. #Ping MODEM for Network State
  82.         hostname = "192.168.0.1" #example
  83.         response = os.system("ping -c 1 -W 2 " + hostname)
  84.  
  85.         if response == 0:
  86.                 byteSer = 101
  87.         else:
  88.                 byteSer = 102
  89.  
  90. #Write MODEM State to Serial port
  91.         ser.write(chr(byteSer))
  92.         time.sleep(2)
  93.  
  94. #Ping DCSI for Internet State
  95.         hostname = "203.22.132.1"
  96.         response = os.system("ping -c 1 -W 2 " + hostname)
  97.  
  98.         if response == 0:
  99.                 byteSer = 97
  100.         else:
  101.                 byteSer = 98
  102.  
  103. #Write DCSI State to Serial port
  104.         ser.write(chr(byteSer))
  105.         time.sleep(2)
  106.  
  107.  
  108. #Ping Printer for State
  109.         hostname = "192.168.0.5" #example
  110.         response = os.system("ping -c 1 -W 2 " + hostname)
  111.  
  112.         if response == 0:
  113.                 byteSer = 103
  114.         else:
  115.                 byteSer = 104
  116.  
  117. #Write Printer state to Serial port
  118.         ser.write(chr(byteSer))
  119.         time.sleep(2)
  120.  
  121.  
  122. #Ping Google for Internet State
  123.         hostname = "google.com"
  124.         response = os.system("ping -c 1 -W 2 " + hostname)
  125.  
  126.         if response == 0:
  127.                 byteSer = 48
  128.         else:
  129.                 byteSer = 49
  130.  
  131. #Write Internet State to Serial port
  132.         ser.write(chr(byteSer))
  133.         time.sleep(2)
  134.  
  135. #Ping Switch for State
  136.         hostname = "192.168.0.2" #example
  137.         response = os.system("ping -c 1 -W 2 " + hostname)
  138.  
  139.         if response == 0:
  140.                 byteSer = 105
  141.         else:
  142.                 byteSer = 106
  143.  
  144. #Write Switch state to Serial port
  145.         ser.write(chr(byteSer))
  146.         time.sleep(2)
  147.  
  148. #Ping DCSI for Internet State
  149.         hostname = "203.22.132.1"
  150.         response = os.system("ping -c 1 -W 2 " + hostname)
  151.  
  152.         if response == 0:
  153.                 byteSer = 97
  154.         else:
  155.                 byteSer = 98
  156.  
  157. #Write DCSI State to Serial port
  158.         ser.write(chr(byteSer))
  159.         time.sleep(2)
  160.  
  161.  
  162. #Ping Brodie Desktop for State
  163.         hostname = "192.168.30.2" #example
  164.         response = os.system("ping -c 1 -W 2 " + hostname)
  165.  
  166.         if response == 0:
  167.                 byteSer = 107
  168.         else:
  169.                 byteSer = 108
  170.  
  171. #Write Brodie Desktop state to Serial port
  172.         ser.write(chr(byteSer))
  173.         time.sleep(2)
  174.  
  175.  
  176. #Ping Google for Internet State
  177.         hostname = "google.com"
  178.         response = os.system("ping -c 1 -W 2 " + hostname)
  179.  
  180.         if response == 0:
  181.                 byteSer = 48
  182.         else:
  183.                 byteSer = 49
  184.  
  185. #Write Internet State to Serial port
  186.         ser.write(chr(byteSer))
  187.         time.sleep(2)
  188.  
  189.  
  190. #Ping Dorothy for State
  191.         hostname = "192.168.0.7" #example
  192.         response = os.system("ping -c 1 -W 2 " + hostname)
  193.  
  194.         if response == 0:
  195.                 byteSer = 109
  196.         else:
  197.                 byteSer = 110
  198.  
  199. #Write DOROTHY Desktop state to Serial port
  200.         ser.write(chr(byteSer))
  201.         time.sleep(2)
  202.  
  203.  
  204.  
  205. LCD-OLD.py
  206. Displaying LCD-OLD.py.