Commits

Cmed Technology committed a0f1741

wip

  • Participants

Comments (0)

Files changed (3)

+\.pyc$
+\~$
+from fabric.api import run, local, sudo, env, put
+
+
+env.hosts = ['pi@192.168.200.139']
+env.passwords = {'pi@192.168.200.139': 'raspberry'}
+
+
+def deploy():
+    put('run.py', '/home/pi/')
+
+
+def go():
+    run('python run.py')
+
+
+def shutdown():
+    sudo('shutdown now')
+
+
+def flash():
+    block_device = '/dev/mmcblk0'
+    osfile = '/localbackup/2013-07-26-wheezy-raspbian.img'
+    # local('sudo umount {}p1'.format(block_device))
+    # local('sudo umount {}p2'.format(block_device))
+    local('sudo dcfldd bs=1M if={} of={}'.format(osfile, block_device))
+
+
+# s=serial.Serial('/dev/ttyAMA0', 9600, parity='N', stopbits=1)
+import serial
+
+
+s=serial.Serial('/dev/ttyAMA0', 9600, parity='N', stopbits=1)
+
+
+for i in range(10):
+    print s.read()