Git Product home page Git Product logo

Comments (2)

tdicola avatar tdicola commented on August 18, 2024

One thing to help, for future issues can you include the exact ampy command and parameters being run? That will help speed up troubleshooting issues.

In this case it looks like you're using the ampy run command to run the HTTP server code right? If so it looks like this is actually by design because you're running code that is waiting for a HTTP connection (the socket accept call). That wait might be very short if something is instantly trying to connect, or that wait could be very, very long if nothing is waiting to connect. The way the run command works is it takes your python script and runs it line by line, waiting for each line to finish and running the next. If a line takes too long (5 seconds IIRC) it will actually timeout and fail with the error you see.

There's a way to make this work though with scripts that run forever or for a long time, add the -n or --no-output option with the run command. That tells ampy not to wait for output and just run each line one after the other immediately. You want to use this when your script might run forever or might run for a very long time (greater than 5 seconds). You won't get any output since ampy doesn't know how long to wait to receive output, but you can actually open the serial REPL with screen or other tools and watch the output from the board.

So to work around this try running with the -n option, like:

ampy --port /path/to/serial/port run -n http_server_simplistic.py

from ampy.

janakaclk avatar janakaclk commented on August 18, 2024

Thanks Tony!

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.