MagicMirror Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • Donate
    • Discord
    MagicMirror² v2.20.0 is available! For more information about this release, check out this topic.

    Bottle py - freezes raspberry pi

    Troubleshooting
    1
    1
    832
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • K
      kclemen last edited by

      Hi,

      I’m using Bottle: Python Web Framework to control a relay on the raspberry pi. When I start the python script everything runs fine, but after a certain time (half an our or so) the pi freezes completely.

      from bottle import route, run
      import RPi.GPIO as GPIO
      
      
      GPIO.setwarnings(False)
      GPIO.cleanup()
      GPIO.setmode(GPIO.BCM)
      GPIO.setup(5, GPIO.OUT)
      
      @route('/on')
      def on():
          GPIO.output(5,GPIO.LOW)
          return("ON")
      
      @route('/off')
      def off():
          GPIO.output(5,GPIO.HIGH)
          return("OFF")
      
      @route('/status')
      def status():
          return GPIO.input(5)
      
      run(host="0.0.0.0", port=8070)
      

      anyone with more python experience that can give a helping hand?

      1 Reply Last reply Reply Quote 0
      • 1 / 1
      • First post
        Last post
      Enjoying MagicMirror? Please consider a donation!
      MagicMirror created by Michael Teeuw.
      Forum managed by Paul-Vincent Roll and Rodrigo Ramírez Norambuena.
      This forum is using NodeBB as its core | Contributors
      Contact | Privacy Policy