Git Product home page Git Product logo

Comments (5)

larsks avatar larsks commented on July 19, 2024 2

@trailhead thanks for the pointer; I've actually implemented a different solution locally. Since ampy was obviously reading the REPL prompt (just not the whole thing), I modified the sentinel condition so that it looks like:

diff --git a/ampy/pyboard.py b/ampy/pyboard.py
index fa503d4..a21ec1a 100644
--- a/ampy/pyboard.py
+++ b/ampy/pyboard.py
@@ -187,7 +187,7 @@ class Pyboard:
 
         self.serial.write(b'\r\x01') # ctrl-A: enter raw REPL
         data = self.read_until(1, b'raw REPL; CTRL-B to exit\r\n>')
-        if not data.endswith(b'raw REPL; CTRL-B to exit\r\n>'):
+        if not data.endswith(b'CTRL-B to exit\r\n>'):
             print(data)
             raise PyboardError('could not enter raw repl')

And now it works reliably without requiring a sleep.

from ampy.

ladyada avatar ladyada commented on July 19, 2024 1

Hiya! We are discontinuing support for ampy, and will no longer be maintaining it. We are leaving this repository available for continued use. If you would like to take over supporting it, please contact us on the Adafruit Discord server and we can transfer the repository to you.
If you wish to continue developing it on your own, please fork the repository.

from ampy.

trailhead avatar trailhead commented on July 19, 2024

This solution worked for me.
#19

from ampy.

devxpy avatar devxpy commented on July 19, 2024

Please continue the discussion over at #19

from ampy.

datajett avatar datajett commented on July 19, 2024

@trailhead thanks for the pointer; I've actually implemented a different solution locally. Since ampy was obviously reading the REPL prompt (just not the whole thing), I modified the sentinel condition so that it looks like:

diff --git a/ampy/pyboard.py b/ampy/pyboard.py
index fa503d4..a21ec1a 100644
--- a/ampy/pyboard.py
+++ b/ampy/pyboard.py
@@ -187,7 +187,7 @@ class Pyboard:
 
         self.serial.write(b'\r\x01') # ctrl-A: enter raw REPL
         data = self.read_until(1, b'raw REPL; CTRL-B to exit\r\n>')
-        if not data.endswith(b'raw REPL; CTRL-B to exit\r\n>'):
+        if not data.endswith(b'CTRL-B to exit\r\n>'):
             print(data)
             raise PyboardError('could not enter raw repl')

And now it works reliably without requiring a sleep.

this one nailed it for me, after lookig for days & seeing many solutions that didnt work.
great job.

from ampy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.