diff server/ts.py @ 25:2943f62c8e62

- Make the python work on openwrt - main.c: Stay awake for testing print CRC as unsigned
author Matt Johnston <matt@ucc.asn.au>
date Wed, 06 Jun 2012 23:05:35 +0800
parents 44c5ab5ea879
children d3e5934fe55c
line wrap: on
line diff
--- a/server/ts.py	Wed Jun 06 22:32:49 2012 +0800
+++ b/server/ts.py	Wed Jun 06 23:05:35 2012 +0800
@@ -11,7 +11,7 @@
 TESTING = True
 
 import sys
-import httplib
+#import httplib
 import time
 import traceback
 
@@ -34,8 +34,6 @@
 
     s.setblocking(False)
 
-    time.sleep(30)
-
     return s
 
 # from http://blog.stalkr.net/2011/04/pctf-2011-32-thats-no-bluetooth.html
@@ -87,6 +85,7 @@
     recv_crc = None
     try:
         k, v = l.rstrip('\n').split('=')
+        print k,v
         if k == 'CRC':
             recv_crc = int(v)
         if recv_crc < 0 or recv_crc > 0xffff:
@@ -122,6 +121,7 @@
     return int(next_wake)
 
 def do_comms(sock):
+    print "do_comms"
     d = None
     # serial could be unreliable, try a few times
     for i in range(FETCH_TRIES):