Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use latest pexpect style #3

Open
wants to merge 1 commit into
base: origin
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Firmware/tools/update_mode.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/usr/bin/env python
# put a HopeRF into update mode

import serial, sys, optparse, time, fdpexpect
import serial, sys, optparse, time, pexpect
from pexpect import fdpexpect

parser = optparse.OptionParser("update_mode")
parser.add_option("--baudrate", type='int', default=57600, help='baud rate')
Expand Down
5 changes: 3 additions & 2 deletions Firmware/tools/uploader.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,8 @@ def __verify(self, fw):

def autosync(self):
'''use AT&UPDATE to put modem in update mode'''
import fdpexpect, time
import pexpect, time
from pexpect import fdpexpect
ser = fdpexpect.fdspawn(self.port.fileno(), logfile=sys.stdout)
if self.atbaudrate != 115200:
self.port.setBaudrate(self.atbaudrate)
Expand All @@ -204,7 +205,7 @@ def autosync(self):
ser.send('+++')
try:
ser.expect('OK', timeout=1.1)
except fdpexpect.TIMEOUT:
except pexpect.TIMEOUT:
# may already be in AT mode
pass
for i in range(5):
Expand Down