Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
micropython
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
card10
micropython
Commits
635ef164
Commit
635ef164
authored
9 years ago
by
Daniel Campora
Browse files
Options
Downloads
Patches
Plain Diff
cc3200/tools: Improve update script robustness.
parent
57fa14b5
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cc3200/tools/update-wipy.py
+20
-9
20 additions, 9 deletions
cc3200/tools/update-wipy.py
with
20 additions
and
9 deletions
cc3200/tools/update-wipy.py
+
20
−
9
View file @
635ef164
...
...
@@ -17,6 +17,7 @@ Or:
import
sys
import
argparse
import
time
import
socket
from
ftplib
import
FTP
from
telnetlib
import
Telnet
...
...
@@ -121,12 +122,23 @@ def verify_update(args):
print
(
"
Error: verification failed, the git tag doesn
'
t match
"
)
return
False
try
:
# Specify a longer time out value here because the board has just been
# reset and the wireless connection might not be fully established yet
tn
=
Telnet
(
args
.
ip
,
timeout
=
15
)
print
(
"
Connected via telnet again, lets check the git tag
"
)
retries
=
0
while
True
:
try
:
# Specify a longer time out value here because the board has just been
# reset and the wireless connection might not be fully established yet
tn
=
Telnet
(
args
.
ip
,
timeout
=
10
)
print
(
"
Connected via telnet again, lets check the git tag
"
)
break
except
socket
.
timeout
:
if
retries
<
5
:
print
(
"
Timeout while connecting via telnet, retrying...
"
)
retries
+=
1
else
:
print
(
'
Error: Telnet connection timed out!
'
)
return
False
try
:
firmware_tag
=
tn
.
read_until
(
b
'
with CC3200
'
)
tag_file_path
=
args
.
file
.
rstrip
(
'
mcuimg.bin
'
)
+
'
genhdr/mpversion.h
'
...
...
@@ -170,10 +182,9 @@ def main():
if
reset_board
(
args
):
if
args
.
verify
:
print
(
'
Waiting for the WiFi connection to come up again...
'
)
# this time is to allow the system's wireless network card to connect to the
# WiPy again. Sometimes it might only take a couple of seconds, but let's
# leave 15s to be on the safe side
time
.
sleep
(
15
)
# this time is to allow the system's wireless network card to
# connect to the WiPy again.
time
.
sleep
(
5
)
if
verify_update
(
args
):
result
=
0
else
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment