Giter Club home page Giter Club logo

pwm-servo-hat-through-apache-demo's Introduction

PWM-Servo-Hat-Through-Apache-Demo

This is a demo of controlling the Adafruit PWM/Servo Pi Hat through an Apache-served web page.

This is intended to be an "educational piece". You are welcome to do whatever you'd like with the code. (MIT license.) It is useful to show how a Python script can be used through Apache.

You should be able to easily extend this concept to control any hardware on your RPi through Python, and control anything else on any Linux platform. (You may need to configure the security first on other platforms other than the RPi, both embedded and otherwise.)

Requirements:

I simply copied the scripts from the PWM folder of the Adafruit library into the same directory as I placed these script files. You can just drop them in your /var/www/html, or create a separate directory for them. (I will not get into how to add a directory to Apache since there are multiple tutorials online and since I just use /var/www/html.)

If you install to /var/www/html, you can then point your browser to http://localhost/PiServed. Click some buttons or input some values and then click some buttons. Watch your servos move. :)

Please let me know if you have any thoughts or questions. Feel free to create issues, even if they're "only" to discuss the project (as recommended by GitHub's own best-use policy example).

  • This project deserves love.
    • You have love to give.
      • Ergo,
        • We go,
          • โค
            • ๐Ÿ––๐Ÿ˜Ž

pwm-servo-hat-through-apache-demo's People

Contributors

lelandg avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

ericrohlfs

pwm-servo-hat-through-apache-demo's Issues

Add basic authentication

Security-wise, you should at least require a password for anything exposed to the outside-world.

As I said, this is only a demo. However, I think basic authentication will be simple enough to implement.

Resolve error from picamera.PiCamera

For some reason, creating an instance of the camera causes Apache to abort processing of the script and it returns an empty response object. If done in the init routine, that means that the module cannot be used again in that session. (Although you can easily start another session, it does not matter.)

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.