gpio shutdown from within mycontroller?



  • Hi,

    I am looking to shutdown the mycontroller pi properly remotely using a signal from a sensor.

    There are 2 pins on the pi which will shut it down, but I don't know how this will work with mycontroller and mcagent running. I think it would be better to stop these services first and then power off the pi.

    So my thinking is that I can send a high or low to the pi gpio, have mcagent monitor and detect the change and then trigger a python script to shutdown the pi?

    Is it possible?



  • @skywatch Hi, For now, I could not find a direct way for this. I will check the possible way and let you know.
    Thank you for your patience.



  • @jkandasa Thanks for thinking about it.

    It is really not a problem, more a case of ''I wonder if that would be possible". I can load a python script at startup and use that to monitor the gpio pins to run the shudown script.

    Do you think it will be an issue with mcagent also running? Could there be a conflict with both python and mcagent trying to access the gpio ports?



  • @skywatch

    Do you think it will be an issue with mcagent also running? Could there be a conflict with both python and mcagent trying to access the gpio ports?

    If you access the same pin from both side(Python and mcagent), it may conflict. Otherwise no issue.


Log in to reply
 

Suggested Topics

4
Online

503
Users

421
Topics

2.6k
Posts