Hello
       What are the settings on beaglebone to run the python file from php
code.


On Fri, Mar 15, 2019 at 5:49 AM <[email protected]> wrote:

> Hello.
>      I want to control GPIO pin of beaglebone from web page.
>
> My ledon python code here..
>
> import Adafruit_BBIO.GPIO as GPIO
> from time import sleep
>
> outPin="P9_12"
> GPIO.setup(outPin,GPIO.OUT)
> while True:
>      GPIO.output(outPin, GPIO.HIGH)
>      print('LED ON')
>
>
> Here is my php code..
>
> <?php
>
> $result = 'nothing';
>
> if (isset($_POST['set_off']))
> {
>  $result = 'turned off';
>  shell_exec("sudo python /var/www/html/ledoff.py");
> }
>
> if (isset($_POST['set_on']))
> {
>  $result = 'turned on';
>  shell_exec("sudo python /var/www/html/ledon.py");
> }
>
> ?>
>
>  <?php if (isset($result)) { ?>
>  <h1> Action: <?php echo $result ?></h1>
>  <?php } ?>
>
>  <form action="" method="post">
>  <p><input type="hidden" name="set_on" value="yes"/><input type="submit"
> value="LED On"/></p></form>
>
>  <form action="" method="post">
>  <p><input type="hidden" name="set_off" value="yes"/><input type="submit"
> value="LED Off"/></p></form>
> </body>
>
> </html>
>
>
> I run code on web with 192.168.7.2:8080/gpio.php. But the LED doesn't
> turn to high or low.
>
>
>
>
> --
> For more options, visit http://beagleboard.org/discuss
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "BeagleBoard" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/beagleboard/8Ot4rBJpKVk/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/beagleboard/85967299-06c2-4fb3-bc16-26584a2874f1%40googlegroups.com
> <https://groups.google.com/d/msgid/beagleboard/85967299-06c2-4fb3-bc16-26584a2874f1%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/CAC6i%3DDL8dio1yzbfsch%2BSATGHupGsE48HcVRx0UJLvmy-%2BYD1w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to