Go to advanced search

by rottjr
Thu Mar 24, 2016 3:25 pm
Forum: Python
Topic: Which GPIO for LED
Replies: 3
Views: 1180

Re: Which GPIO for LED

Alright, since I see this question on the inter webs more and more I will take the time to write out an example of how to look at a secondary page via jQuery for a button press and then react when it finds the button is pressed. Pages index.htm script.js btn.php index.htm <html> <head> <script src="...
by rottjr
Thu Mar 24, 2016 3:14 pm
Forum: Other programming languages
Topic: Trouble with PHP running on RP server
Replies: 5
Views: 1425

Re: Trouble with PHP running on RP server

I would say a bad source list. My source list get's screwy sometimes. Either that or check the date/time on the Pi, for some reason those packages aren't coming through as valid. My source list is below /etc/apt/sources.list deb http://mirrordirector.raspbian.org/raspbian/ jessie main contrib non-fr...
by rottjr
Wed Mar 23, 2016 3:56 pm
Forum: Other programming languages
Topic: Read pin status using PHP
Replies: 7
Views: 7936

Re: Read pin status using PHP

Fastest way to get the current value on a pin in php is via exec <?php $btn = exec('gpio -g read [pin#]'); ?> Or you can do javascript post/get queries via jQuery or ajax. I have been educated, the system method/function works in loo of the exec. <?php $btn = system('gpio -g read [pin#]'); ?>
by rottjr
Tue Mar 22, 2016 10:44 pm
Forum: Other programming languages
Topic: Trouble with PHP running on RP server
Replies: 5
Views: 1425

Re: Trouble with PHP running on RP server

0xFF wrote:Is PHP enabled in your http server (Apache)?
Try

Code: Select all

<?php
phpinfo()
?>
Dont forget the semicolon.
by rottjr
Tue Mar 22, 2016 10:43 pm
Forum: Other programming languages
Topic: Read pin status using PHP
Replies: 7
Views: 7936

Re: Read pin status using PHP

Heater wrote:jQuery is not a language.
To elaborate since the above post doesn't explain, jQuery is a javascript library that uses classes to perform complex functions such as ajax posts in a faster easier manner.
by rottjr
Tue Mar 22, 2016 10:37 pm
Forum: Other programming languages
Topic: Read pin status using PHP
Replies: 7
Views: 7936

Re: Read pin status using PHP

Fastest way to get the current value on a pin in php is via exec

Code: Select all

<?php
$btn = exec('gpio -g read [pin#]');
?>
Or you can do javascript post/get queries via jQuery or ajax.
by rottjr
Tue Mar 22, 2016 10:32 pm
Forum: Python
Topic: Which GPIO for LED
Replies: 3
Views: 1180

Re: Which GPIO for LED

PHP Basics since you seem to be asking. With PHP the best way to control the GPIO (in my opinion) is by issuing exec or shell_exec commands directly to your pi. Bellow is a quick example of activating GPIO 7 into 'Out' mode, turning it on and then turning it off. <?php //Set GPIO 7 as out exec('gpio...
by rottjr
Tue Mar 22, 2016 10:23 pm
Forum: Other programming languages
Topic: PHP error
Replies: 3
Views: 1267

Re: PHP error

This is a PDO issue with mysql, if you do the fallowing code it should fix it

Code: Select all

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install php5-mysql
If that doesn't work it should at least lead you in a good direction.

- RottJR
by rottjr
Tue Mar 22, 2016 10:17 pm
Forum: Other programming languages
Topic: Accessing the GPIO from a webpage
Replies: 12
Views: 3719

Re: Accessing the GPIO from a webpage

You can take a look at the PHP console I made viewtopic.php?f=34&t=141280

As stated by Heater, it runs primarily on shell execution through the php interface.

Hope this helps,

RottJR
by rottjr
Tue Mar 22, 2016 9:29 pm
Forum: Other programming languages
Topic: Pi PHP Console
Replies: 1
Views: 828

Re: Pi PHP Console

The Complex Pi Console Continuing to develop the Simple Pi Console has brought me to the Complex Pi Console. This console will continue to be developed while the simple pi console will remain in its current state with minimal development. The differences The Simple Pi Console only has two dependenc...
by rottjr
Tue Mar 22, 2016 3:55 pm
Forum: Other programming languages
Topic: Pi PHP Console
Replies: 1
Views: 828

Pi PHP Console

Hello everyone, I looked for some time for a decent pi console for doing basic GPIO interaction. I was more interested "at the time" in making light chains and the such. After days of not finding what I wanted I decided to just make one. So attached is a zip containing the 'Simple Pi Console'. Hope ...

Go to advanced search