0

I have a temperature sensor on my Raspberry Pi 2, I read the data with a python script. My question is how do I run that script on the Apache server (with a push of a button). Specifically how do I run a Python script through Apache server?

asked Aug 11, 2015 at 19:30

1 Answer 1

0

The answer is you use the CGI (Common Gateway Interface).

The precise details of how you would use CGI depends on the script you want to use on the Pi.

There is a pigpio CGI example for my pigpio library in these Python examples.

There is a somewhat simpler method not involving pigpio or Apache if you run your own Python server on the Raspberry Pi. There is example code called Easy as Pi Server at these Miscellanous examples. You'd need to look through the code example comments to see how it should be used.

answered Aug 11, 2015 at 20:00
1
  • Great, with webpy I can make it. Thx Commented Aug 11, 2015 at 20:06

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.