Skip to content

Commit

Permalink
play around some more with stuff that doesn't work
Browse files Browse the repository at this point in the history
  • Loading branch information
bewest committed Jan 1, 2012
1 parent c2e14f0 commit d2d0ff4
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 2 deletions.
45 changes: 45 additions & 0 deletions dumb.py
@@ -0,0 +1,45 @@
#!/usr/bin/python

import serial
import os, sys
import logging
import time
from insulaudit import lib
logging.basicConfig( )
log = logging.getLogger('dumb')
log.setLevel(logging.INFO)
log.info("hello world")

stage1 = bytearray( [ 0x11, 0x0D, 0x44, 0x4D, 0x53, 0x0D, 0x0D ] )

weird = [ 0xFE ] * 14
tail = [ 0xFF ] * 3

def send_command(port, comm):
log.info("sending:")
log.info(lib.hexdump(bytearray(comm)))
port.write(str(comm))
time.sleep(.2)
response = ''.join(port.readlines( ))
if len(response) > 0:
print "RESPONSE!!!!"
print lib.hexdump(bytearray(response))
return response



def main(device):
log.info( "opening device: %s" % device )
ser = serial.Serial(device)
ser.setTimeout(5)
send_command(ser, stage1)
send_command(ser, stage1)
send_command(ser, bytearray( weird + tail ) )
send_command(ser, bytearray( weird + tail ) )
ser.close( )


if __name__ == '__main__':
main(sys.argv[1])
#####
# EOF
2 changes: 1 addition & 1 deletion mini.py
Expand Up @@ -7,7 +7,7 @@
from insulaudit.log import io
from insulaudit.devices import lsultramini

PORT = '/dev/ttyUSB1'
PORT = '/dev/ttyACM0'

def format_packet( command ):
COMMAND = [
Expand Down
2 changes: 1 addition & 1 deletion src/insulaudit/devices/onetouch/proto.py
Expand Up @@ -76,7 +76,7 @@ def __call__(self, port ):

class UltraSmartWakeUpStage1( OneTouchCommand ):
#code = bytearray( [ 0x00, 0x96, 0x00, 0x00, 0x00, 0x00, 0x08 ] )
code = bytearray( [ 0xB0, 0x04, 0x00, 0x00, 0x00, 0x00, 0x07 ] )
code = bytearray( [ 0x11, 0x0D, ] )
def __call__(self, port ):
stuff = port.write("")
#time.sleep(5)
Expand Down

0 comments on commit d2d0ff4

Please sign in to comment.