sjfaustino
Posts: 87
Joined: Tue Jun 12, 2012 5:21 pm

Re: Raspcontrol - A Web Control Centre for the Pi

Wed Oct 17, 2012 11:36 pm

Just added a warranty detection based on overvolt bit (in a hackish way, just checking if revision has 7 chars, not checking the actual bit, will do it later), fixed a few PHP notices, removed the version detection since it wasn't working (will replace with a git check later on) and removed a few more sudos that were not needed.

Will add board revision detection based on the table below

Code: Select all

Model and revision 	Code(s)
Model B Revision 1.0 	2
Model B Revision 1.0 + ECN0001 (no fuses, D14 removed) 	3
Model B Revision 2.0 	4, 5, 6
Could some one with a 512MB board do a cat /proc/cpuinfo and post the revision here so I can add the model to the table?
Also, anyone know what are the board diferences between codes 4,5,6?

Mr_Waffle
Posts: 11
Joined: Mon Oct 15, 2012 8:21 pm

Re: Raspcontrol - A Web Control Centre for the Pi

Thu Oct 18, 2012 11:52 am

I'll be getting a 512MB board in a few days, will post here when I get it.

On the warranty check, this should check both the length and the bit:

Code: Select all

$warranty = ( strlen($warranty)==7 && substr($warranty, 0, 1) == 1 ? "void" : "valid" );
I also made a simple revision detection. Made another pull request.

Boezelman
Posts: 40
Joined: Sun Aug 05, 2012 3:25 pm

Re: Raspcontrol - A Web Control Centre for the Pi

Sun Oct 21, 2012 12:55 pm

I'm getting:

Code: Select all

[Sun Oct 21 12:51:35 2012] Failed to listen on 0.0.0.0:80 (reason: Address already in use)
It makes no difference if I put: localhost, 192.168.2.5 (ip of Pi) there.
Keep getting the same error...

Any ideas?

Mr_Waffle
Posts: 11
Joined: Mon Oct 15, 2012 8:21 pm

Re: Raspcontrol - A Web Control Centre for the Pi

Sun Oct 21, 2012 1:45 pm

Do you already have another webserver running?

Boezelman
Posts: 40
Joined: Sun Aug 05, 2012 3:25 pm

Re: Raspcontrol - A Web Control Centre for the Pi

Sun Oct 21, 2012 2:00 pm

Apache2 is running (along with php and sql).

PiotrW
Posts: 2
Joined: Sun Oct 21, 2012 9:55 pm
Location: Warsaw, Poland

Re: Raspcontrol - A Web Control Centre for the Pi

Sun Oct 21, 2012 10:00 pm

Hello. How can I stop another web server?

Mr_Waffle
Posts: 11
Joined: Mon Oct 15, 2012 8:21 pm

Re: Raspcontrol - A Web Control Centre for the Pi

Sun Oct 21, 2012 11:16 pm

Boezelman wrote:Apache2 is running (along with php and sql).
Just place the contents of raspcontrol in a folder called "raspcontrol" or w/e you want, in your apache2 www directory.
Don't use start.sh, just place the files there. Go to the raspcontrol directory of your apache2 IP.

ripping
Posts: 32
Joined: Wed Mar 14, 2012 10:55 am
Location: New Zealand

Re: Raspcontrol - A Web Control Centre for the Pi

Sun Oct 21, 2012 11:36 pm

Here is the output of a cat/proc/cpuinfo on a recently obtained 512Mb unit.

Processor : ARMv6-compatible processor rev 7 (v6l)
BogoMIPS : 697.95
Features : swp half thumb fastmult vfp edsp java tls
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xb76
CPU revision : 7

Hardware : BCM2708
Revision : 000f
Serial : 00000000e8347343

dancytron
Posts: 56
Joined: Sun May 06, 2012 11:09 pm

Re: Raspcontrol - A Web Control Centre for the Pi

Mon Oct 22, 2012 1:25 am

Mr_Waffle wrote:
Boezelman wrote:Apache2 is running (along with php and sql).
Just place the contents of raspcontrol in a folder called "raspcontrol" or w/e you want, in your apache2 www directory.
Don't use start.sh, just place the files there. Go to the raspcontrol directory of your apache2 IP.
Will this work with lighttpd too?

Boezelman
Posts: 40
Joined: Sun Aug 05, 2012 3:25 pm

Re: Raspcontrol - A Web Control Centre for the Pi

Mon Oct 22, 2012 5:32 am

Mr_Waffle wrote:
Boezelman wrote:Apache2 is running (along with php and sql).
Just place the contents of raspcontrol in a folder called "raspcontrol" or w/e you want, in your apache2 www directory.
Don't use start.sh, just place the files there. Go to the raspcontrol directory of your apache2 IP.
Thanks for yout reply, I actually already tried that.
I get to the "login / create account" page, after I fill in the login details the browser goes to: index.php where I get the message "can't open file".

sjfaustino
Posts: 87
Joined: Tue Jun 12, 2012 5:21 pm

Re: Raspcontrol - A Web Control Centre for the Pi

Mon Oct 22, 2012 1:26 pm

Mr_Waffle wrote:I'll be getting a 512MB board in a few days, will post here when I get it.

On the warranty check, this should check both the length and the bit:

Code: Select all

$warranty = ( strlen($warranty)==7 && substr($warranty, 0, 1) == 1 ? "void" : "valid" );
I also made a simple revision detection. Made another pull request.
The problem is that the Foundation may add bits to the revision for other stuff (not sure if it's probable or even possible) so we may have a string bigger than the current one and we will only be testing the left-most character that may not be the one we want.

sjfaustino
Posts: 87
Joined: Tue Jun 12, 2012 5:21 pm

Re: Raspcontrol - A Web Control Centre for the Pi

Mon Oct 22, 2012 3:27 pm

Boezelman wrote:
Mr_Waffle wrote:
Boezelman wrote:Apache2 is running (along with php and sql).
Just place the contents of raspcontrol in a folder called "raspcontrol" or w/e you want, in your apache2 www directory.
Don't use start.sh, just place the files there. Go to the raspcontrol directory of your apache2 IP.
Thanks for yout reply, I actually already tried that.
I get to the "login / create account" page, after I fill in the login details the browser goes to: index.php where I get the message "can't open file".
Run the commands below:

Code: Select all

sudo mkdir /etc/raspcontrol
sudo nano /etc/raspcontrol/database.aptmnt
Once you are in the editor, add the lines below and press the keys "CTRL+X", "Y" and "ENTER"

Code: Select all

{
"user":"guest",
"password":"guest"
}
Replace the "guest" user and password with your own.

Boezelman
Posts: 40
Joined: Sun Aug 05, 2012 3:25 pm

Re: Raspcontrol - A Web Control Centre for the Pi

Mon Oct 22, 2012 3:48 pm

Run the commands below:

Code: Select all

sudo mkdir /etc/raspcontrol
sudo nano /etc/raspcontrol/database.aptmnt
Once you are in the editor, add the lines below and press the keys "CTRL+X", "Y" and "ENTER"

Code: Select all

{
"user":"guest",
"password":"guest"
}
Replace the "guest" user and password with your own.
Brilliant! Thanks allot!

Mr_Waffle
Posts: 11
Joined: Mon Oct 15, 2012 8:21 pm

Re: Raspcontrol - A Web Control Centre for the Pi

Mon Oct 22, 2012 10:51 pm

sjfaustino wrote:
Mr_Waffle wrote:I'll be getting a 512MB board in a few days, will post here when I get it.

On the warranty check, this should check both the length and the bit:

Code: Select all

$warranty = ( strlen($warranty)==7 && substr($warranty, 0, 1) == 1 ? "void" : "valid" );
I also made a simple revision detection. Made another pull request.
The problem is that the Foundation may add bits to the revision for other stuff (not sure if it's probable or even possible) so we may have a string bigger than the current one and we will only be testing the left-most character that may not be the one we want.
True. Any idea on how to tackle that?

Also, my result on cat /proc/cpuinfo also has revision "f"...

Mr_Waffle
Posts: 11
Joined: Mon Oct 15, 2012 8:21 pm

Re: Raspcontrol - A Web Control Centre for the Pi

Tue Oct 23, 2012 7:12 pm

I've made a very simple mobile page using jQuery Mobile:
http://sdrv.ms/QT9gik
http://sdrv.ms/QT9t4Z

sjfaustino
Posts: 87
Joined: Tue Jun 12, 2012 5:21 pm

Re: Raspcontrol - A Web Control Centre for the Pi

Tue Oct 23, 2012 7:32 pm

Mr_Waffle wrote:I've made a very simple mobile page using jQuery Mobile:
http://sdrv.ms/QT9gik
http://sdrv.ms/QT9t4Z
Nice!
I was going to use http://www.jqtouch.com/ to do it, where I would detect the user agent (see the bottom part of http://mobile.tutsplus.com/tutorials/mo ... detection/) and render a page using jqtouch or the current "normal" template.
If your raspcontrol is Internet accessible, you can test how it looks on http://iphonetester.com/
Mr_Waffle wrote:
sjfaustino wrote:
Mr_Waffle wrote:I'll be getting a 512MB board in a few days, will post here when I get it.

On the warranty check, this should check both the length and the bit:

Code: Select all

$warranty = ( strlen($warranty)==7 && substr($warranty, 0, 1) == 1 ? "void" : "valid" );
I also made a simple revision detection. Made another pull request.
The problem is that the Foundation may add bits to the revision for other stuff (not sure if it's probable or even possible) so we may have a string bigger than the current one and we will only be testing the left-most character that may not be the one we want.
True. Any idea on how to tackle that?

Also, my result on cat /proc/cpuinfo also has revision "f"...
Writing on a android tablet, so didn't check for typos or bugs:

Code: Select all

if(strlen($revision) >= 7) /*  there might be more bits after the overvolt */
  $warranty = substr($revision, strlen($revision)-7, 1) == 0 ? 'valid' : 'void);
else
  $warranty = 'valid'; /* we assume that if less than 7 revision bits, the overvolt bit isn't set*/

Unfortunately, haven't had much time available recently due to personal reasons, but I believe next weekend I might be able to do some of the stuff I have planned for raspcontrol.
Last edited by sjfaustino on Tue Oct 23, 2012 8:01 pm, edited 1 time in total.

Mr_Waffle
Posts: 11
Joined: Mon Oct 15, 2012 8:21 pm

Re: Raspcontrol - A Web Control Centre for the Pi

Tue Oct 23, 2012 11:15 pm

The reason I chose jQuery Mobile is because I'm already familiar with it.
I used this PHP class for the mobile detection: http://code.google.com/p/php-mobile-detect/

I made your change to the warranty detection.


By the way, Bioshox wanted us to make a pull request on the official repo, but I think we should first finish a few things before doing that :)

One thing I want to know is how the whole revision numbering works...

sjfaustino
Posts: 87
Joined: Tue Jun 12, 2012 5:21 pm

Re: Raspcontrol - A Web Control Centre for the Pi

Wed Oct 24, 2012 12:05 am

Mr_Waffle wrote:The reason I chose jQuery Mobile is because I'm already familiar with it.
I used this PHP class for the mobile detection: http://code.google.com/p/php-mobile-detect/
Hey, as long as it works... :)
Mr_Waffle wrote:I made your change to the warranty detection.
Great, should be future proof now.
Mr_Waffle wrote: By the way, Bioshox wanted us to make a pull request on the official repo, but I think we should first finish a few things before doing that :)
I have no problem with that but not sure he will want to go the way I (and I believe you agree with it since I laid it out in a previous post) have planned.
Last I heard, about 2 months ago he was doing a lot of changes to the current code and what I'm planning (when it's done) is basically throw away all his code and rewrite raspcontrol using a decent framework and a module based display template.
But anyway, as soon as I update my version with your changes I can do a pull to his repo (or you can do it, doesn't matter).

Since I am adding a version update check at startup that pulls the latest info from the github.com repo directly, what will most likely happen is that his version will be the "stable" or "legacy" release and mine (or yours) will be the "nightly" or "cutting edge" and people can update to whichever they want.
Mr_Waffle wrote:One thing I want to know is how the whole revision numbering works...
Sorry, didn't understand what you mean. what revision numbering? github's ?
Or the fact that raspcontrol should have a release and build number by now? :)
Again, that will be solved with the github update check.

BTW, next update on my part is enumerating all the hardware connected to the Pi, too bad that some of the hardware lies when asked on how much power it uses (ex: I get a return value for my keyboard of a maximum of 100mA but one 2.5" USB HDD that I have says 0mA) otherwise I could calculate the total minimum power needed for the Pi's PSU. This is part of my conversion to a PHP class.

Mr_Waffle
Posts: 11
Joined: Mon Oct 15, 2012 8:21 pm

Re: Raspcontrol - A Web Control Centre for the Pi

Wed Oct 24, 2012 4:59 pm

sjfaustino wrote:I have no problem with that but not sure he will want to go the way I (and I believe you agree with it since I laid it out in a previous post) have planned.
Last I heard, about 2 months ago he was doing a lot of changes to the current code and what I'm planning (when it's done) is basically throw away all his code and rewrite raspcontrol using a decent framework and a module based display template.
But anyway, as soon as I update my version with your changes I can do a pull to his repo (or you can do it, doesn't matter).

Since I am adding a version update check at startup that pulls the latest info from the github.com repo directly, what will most likely happen is that his version will be the "stable" or "legacy" release and mine (or yours) will be the "nightly" or "cutting edge" and people can update to whichever they want.
Good idea.
Mr_Waffle wrote:One thing I want to know is how the whole revision numbering works...
Sorry, didn't understand what you mean. what revision numbering? github's ?
Or the fact that raspcontrol should have a release and build number by now? :)
Again, that will be solved with the github update check.
Sorry, I meant the Pi revision numbering, seeing as how my and someone else's 512MB model show up as 000f, which isn't in the table.
BTW, next update on my part is enumerating all the hardware connected to the Pi, too bad that some of the hardware lies when asked on how much power it uses (ex: I get a return value for my keyboard of a maximum of 100mA but one 2.5" USB HDD that I have says 0mA) otherwise I could calculate the total minimum power needed for the Pi's PSU. This is part of my conversion to a PHP class.
Awesome! I'll just see whatever I can do or come up with when I get a little bit more free time :)

keefka
Posts: 3
Joined: Thu Oct 25, 2012 4:38 am

Re: Raspcontrol - A Web Control Centre for the Pi

Thu Oct 25, 2012 4:50 am

Hi, I installed Raspcontrol onto my Pi, but i'm having a bit of trouble with it working in-browser.
When I activate the program it reads like this:

Code: Select all

PHP 5.4.4-7 Development Server started at Thu Oct 25 04:28:26 2012
Listening on 0.0.0.0:8080
Document root is /home/pi/Raspcontrol/app
Which i'm guessing is normal :P
But when I try going to the address (192.168.11.116:8080/raspcontrol) in a browser on my desktop, the only thing that shows on the page is "Error" And simultaneously the following shows up on my Pi terminal:

[Thu Oct 25 04:28:35 2012] 192.168.11.103:52223 [404]: /raspcontrol
[Thu Oct 25 04:28:35 2012] 192.168.11.103:52224 [404]: /favicon.ico

So it seems like the Pi is registering something trying to access it, i'm just not sure why the web page isn't loading properly. Oh, and i'm using Chrome as the web browser on my pc, if that matters any.

Please help!

User avatar
NedTheNerd
Posts: 25
Joined: Thu Sep 13, 2012 9:20 pm
Contact: Website

Re: Raspcontrol - A Web Control Centre for the Pi

Fri Oct 26, 2012 3:15 pm

Hi

Have installed Raspcontrol as per above instructions for Apache, done the sudoers change, page loads OK but at the top is says "Failed to check for latest version", also the "About" and "Contact" buttons do nothing. Is this normal?

Regards
Hardware: 1xRPi B 256Mb running Musicbox, 2 x RPi2's running Rasplex, RPi B+ running mail and web services, RPi2 running Plex Media Server

dipole
Posts: 26
Joined: Thu Aug 09, 2012 1:11 pm

Re: Raspcontrol - A Web Control Centre for the Pi

Sat Oct 27, 2012 3:53 pm

I'm using lighttpd and placed the raspcontrol folder in my /var/www. when I browse to it I get a 503 error. Does anyone know what the problem is? Php works fine at my website hosted in var/www root. should I perhaps run this on a different port? Does anyone have instructions on how to do that?

sjfaustino
Posts: 87
Joined: Tue Jun 12, 2012 5:21 pm

Re: Raspcontrol - A Web Control Centre for the Pi

Sat Oct 27, 2012 10:50 pm

Double post. mods please delete.
Last edited by sjfaustino on Sat Oct 27, 2012 10:57 pm, edited 1 time in total.

sjfaustino
Posts: 87
Joined: Tue Jun 12, 2012 5:21 pm

Re: Raspcontrol - A Web Control Centre for the Pi

Sat Oct 27, 2012 10:55 pm

NedTheNerd wrote:Hi

Have installed Raspcontrol as per above instructions for Apache, done the sudoers change, page loads OK but at the top is says "Failed to check for latest version", also the "About" and "Contact" buttons do nothing. Is this normal?

Regards
Without more information like a error log, it's a bit hard to help. Try to update to the latest revision and see if that helps.
AFAIK only myself and Mr_Waffle are developing this app (not sure about Bioshox though...) and we haven't done any pull requests yet to Bioshox's repository.
If you want to "live on the edge", meaning some things may break from time to time (but you also get all the latest goodies :)), just use my repository or Mr_Waffle's since we'll most likely do pull request to each other.
Mine is https://github.com/sjfaustino/Raspcontr ... all/master
Mr_Waffle's is https://github.com/MrWaffle/Raspcontrol/zipball/master

PS: I can confirm that the "Failed to check for latest version" isn't working on Bioshox's latest revision. I'm doing something to fix that ;)
dipole wrote:I'm using lighttpd and placed the raspcontrol folder in my /var/www. when I browse to it I get a 503 error. Does anyone know what the problem is? Php works fine at my website hosted in var/www root. should I perhaps run this on a different port? Does anyone have instructions on how to do that?
503 is Server unavailable and can have a number of causes. Since you are using lighttpd, open a terminal window on the Pi and do

Code: Select all

tail -f /var/log/lighttpd/error.log
after that, try to access your website and see if there are any errors on the terminal window.

User avatar
NedTheNerd
Posts: 25
Joined: Thu Sep 13, 2012 9:20 pm
Contact: Website

Re: Raspcontrol - A Web Control Centre for the Pi

Sun Oct 28, 2012 10:49 am

Many thanks for response, checked the code for the 'Failed to check for latest version', seems like there's something wrong with the URL, also made sure I installed latest release, admittedly this was Bioshox's.

I am used to living on the edge (having been Head of Test Services for a very large UK organisation for a number of years (over 2000 apps deployed) until I retired) and will use your repository.

Regards
Hardware: 1xRPi B 256Mb running Musicbox, 2 x RPi2's running Rasplex, RPi B+ running mail and web services, RPi2 running Plex Media Server

Return to “Networking and servers”