Coder Social home page Coder Social logo

Comments (5)

MrYsLab avatar MrYsLab commented on August 30, 2024

I am seeing the same thing and will investigate.

from pymata-aio.

MrYsLab avatar MrYsLab commented on August 30, 2024

I have a temporary work-around that will turn off the motors, but will throw some benign exceptions on exiting. Modify your signal handler to:

def signal_handler(sig, frame):
        print('\nYou pressed Ctrl+C')
        if board is not None:
            board.reset()
        sys.exit(0)

An original design goal was to provide an internal working Control-C handler, which is clearly not the case. I will leave this issue open until I come up with a workable solution in code or coding guidance.

from pymata-aio.

fisherds avatar fisherds commented on August 30, 2024

I can live with that.

Also as an FYI this is a non-issue when I run the Python script from Eclipse. Even without any signal_handler code at all. When I hit the red stop button on the Eclipse Console the wheels shutdown correctly. It's like magic. The wheels stop, there are like four quick flashes on LED 13, a quick flash on the Rx LED and the thing is shutdown. No logs shown, but the Adruino is properly shutdown. Is that your attempt at the internal Control-C handler working??? Just tell everyone to use Eclipse instead of running scripts from the command line. :) 100% reliable.

image

from pymata-aio.

MrYsLab avatar MrYsLab commented on August 30, 2024

Thanks for the feedback. The flashing L13 is how Firmata announces its version number( in addition to sending out the serial port), so that is correct. There is signal handling code built into pymata_core that is supposed to handle control-c detection. It sees the signal, but does not shutdown cleanly, so I will be investigating.

from pymata-aio.

MrYsLab avatar MrYsLab commented on August 30, 2024

I retested with version 2.1 and when I press ctrl-c the motors stop. I removed the signal handler code from the example, and retested, and again, the motors stop from the internal ctrl-c handling within pymata_core. Therefore I am closing this issue.

from pymata-aio.

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.