1
0
mirror of https://github.com/EliasKotlyar/Xiaomi-Dafang-Hacks.git synced 2025-09-12 00:50:44 +02:00
Files
xiaomi-dafang-hacks/hacks/serial/serialboot.py
Ryan Jarvis 4dfb5390c8 Cleanup (#172)
* PEP8 for python scripts

* Format HTML

* Cleanup scripts using shellcheck.  Whitespace.  Removed unused variables and a "dead cat"

* Cleanup script using shellcheck.  Whitespace.  Refactored a fragile for loop and removed a "dead cat"

* Cleanup scripts using shellcheck.  Whitespace.  Refactored a chain of grep commands in mqtt-control.sh.

* Cleanup scripts using shellcheck.  Whitespace.  Removed unused commented code and dead cats.

* Format changes for consistency
2018-03-23 15:39:05 +01:00

21 lines
346 B
Python
Executable File

# coding=utf-8
# !/usr/bin/env python
import sys
from time import sleep
import serial
ser = serial.Serial('/dev/ttyUSB0', 115200, timeout=0)
while ser:
ser.write(chr(27))
ser.flush()
sleep(0.00001)
try:
x = ser.read()
sys.stdout.write(x)
pass
except serial.serialutil.SerialException:
pass