trouch
Posts: 310
Joined: Fri Aug 03, 2012 7:24 pm
Location: France
Contact: Website

Re: WebIOPi : control your Pi’s GPIO with a browser

Wed Nov 28, 2012 9:10 pm

stuartmarsden wrote:Have just put a patch on google code that adds 1-Wire support

http://code.google.com/p/webiopi/issues/detail?id=11

ENHANCEMENT - Patch against Rev 605

[...]

Hope it is useful to others. Any comments welcome.

Stuart
Very nice and appreciated contrib ! I hope it was not difficult to add mod webiopi.
I will make some change before including your patch, but as I can see, you made a great work.
I may ask you to test when I'll add it.
I'm currently working UART support, so 1-Wire will be next and may be included in next release.

WebIOPi - Raspberry Pi REST Framework to control your Pi from the web
http://store.raspberrypi.com/projects/webiopi
http://code.google.com/p/webiopi/
http://trouch.com

stuartmarsden
Posts: 4
Joined: Sat May 26, 2012 12:52 pm

Re: WebIOPi : control your Pi’s GPIO with a browser

Wed Nov 28, 2012 9:30 pm

Happy to test when you include it.

Was fun adding as I had to brush off my C, Python, Javascript, JQuery and CSS so was very educational for me.

I will keep doing a svn update now and then and update the patch if needed.

trouch
Posts: 310
Joined: Fri Aug 03, 2012 7:24 pm
Location: France
Contact: Website

Re: WebIOPi : control your Pi’s GPIO with a browser

Wed Nov 28, 2012 10:24 pm

good news, UART support is on good way ;)

WebIOPi - Raspberry Pi REST Framework to control your Pi from the web
http://store.raspberrypi.com/projects/webiopi
http://code.google.com/p/webiopi/
http://trouch.com

LHX211
Posts: 2
Joined: Fri Nov 30, 2012 2:14 am

Re: WebIOPi : control your Pi’s GPIO with a browser

Fri Nov 30, 2012 2:34 am

Hi and thank you for your effort. It works fine on mu device but loading at start doesn't: it just display a white page (no error so looks like it works to a certain point) but the GUI page is never loaded. If I stop then restart the the background service, it works, but never after the board boot.
Is there anything that shoud be configured in the init.d or elsewhere? I just run the "$ sudo update-rc.d webiopi defaults" once according to the instructions and nothing more.

trouch
Posts: 310
Joined: Fri Aug 03, 2012 7:24 pm
Location: France
Contact: Website

Re: WebIOPi : control your Pi’s GPIO with a browser

Fri Nov 30, 2012 10:59 pm

LHX211 wrote:Hi and thank you for your effort. It works fine on mu device but loading at start doesn't: it just display a white page (no error so looks like it works to a certain point) but the GUI page is never loaded. If I stop then restart the the background service, it works, but never after the board boot.
Is there anything that shoud be configured in the init.d or elsewhere? I just run the "$ sudo update-rc.d webiopi defaults" once according to the instructions and nothing more.
I confirm that. I have to investigate...
Thanks for the feedback

WebIOPi - Raspberry Pi REST Framework to control your Pi from the web
http://store.raspberrypi.com/projects/webiopi
http://code.google.com/p/webiopi/
http://trouch.com

rthorson
Posts: 3
Joined: Tue Oct 30, 2012 12:49 am

Re: WebIOPi : control your Pi’s GPIO with a browser

Sun Dec 02, 2012 9:20 pm

trouch wrote:
rthorson wrote:I am having problems installing Python. I get errors similar to http:mirrordirector.raspbian.org etc.

Not found

Is there any other way to install python-dev without using sudo aptitude install python dev?
two reasons :
1) your package index is out of date, try "sudo aptitude update", then retry install python-dev
2) the repo may be down, try later

Thanks, that worked.

Marinov
Posts: 5
Joined: Tue Dec 04, 2012 7:56 am

Re: WebIOPi : control your Pi’s GPIO with a browser

Tue Dec 04, 2012 8:05 am

Hello,

I want to build christmas lights controller using the Pi and WebIOPI. I looked over the example and using macros seems fairly simple, but I am wondering how to stop macro from the web interface after starting it? Also, how to check if macro is running? Thanks in advance. :)

trouch
Posts: 310
Joined: Fri Aug 03, 2012 7:24 pm
Location: France
Contact: Website

Re: WebIOPi : control your Pi’s GPIO with a browser

Tue Dec 04, 2012 9:30 am

Marinov wrote:Hello,
I want to build christmas lights controller using the Pi and WebIOPI. I looked over the example and using macros seems fairly simple, but I am wondering how to stop macro from the web interface after starting it? Also, how to check if macro is running? Thanks in advance. :)
Your macro have to return, or the HTTP server will hang and a timeout will occur on the client side when calling the macro.
If you want to start/stop some blinking from the web UI, you have to start a thread from your macro.
Then to stop the blinking, you will have to stop the thread.

WebIOPi - Raspberry Pi REST Framework to control your Pi from the web
http://store.raspberrypi.com/projects/webiopi
http://code.google.com/p/webiopi/
http://trouch.com

Marinov
Posts: 5
Joined: Tue Dec 04, 2012 7:56 am

Re: WebIOPi : control your Pi’s GPIO with a browser

Tue Dec 04, 2012 12:22 pm

trouch wrote:
Marinov wrote:Hello,
I want to build christmas lights controller using the Pi and WebIOPI. I looked over the example and using macros seems fairly simple, but I am wondering how to stop macro from the web interface after starting it? Also, how to check if macro is running? Thanks in advance. :)
Your macro have to return, or the HTTP server will hang and a timeout will occur on the client side when calling the macro.
If you want to start/stop some blinking from the web UI, you have to start a thread from your macro.
Then to stop the blinking, you will have to stop the thread.
Thank you. I will look for information how to do that. Thank you.

Marinov
Posts: 5
Joined: Tue Dec 04, 2012 7:56 am

Re: WebIOPi : control your Pi’s GPIO with a browser

Wed Dec 05, 2012 4:39 pm

I did try the software PWM, but it seems to be a bit unstable. From time to time the LED lights at full brightness for a moment or goes completely off for a moment. Can I run the PWM process with higher priority? I guess this will help, is it?

User avatar
oldcyberdude
Posts: 9
Joined: Fri Nov 02, 2012 4:35 pm
Location: Aiken, SC

Re: WebIOPi : control your Pi’s GPIO with a browser

Wed Dec 05, 2012 5:13 pm

Here is a link with some interesting discussions of process priority and using nice.

http://www.askapache.com/optimize/optim ... e_Examples

trouch
Posts: 310
Joined: Fri Aug 03, 2012 7:24 pm
Location: France
Contact: Website

Re: WebIOPi : control your Pi’s GPIO with a browser

Wed Dec 05, 2012 6:33 pm

Marinov wrote:I did try the software PWM, but it seems to be a bit unstable. From time to time the LED lights at full brightness for a moment or goes completely off for a moment. Can I run the PWM process with higher priority? I guess this will help, is it?
Yes, a higher priority will help. But the LED should stick turned on with a 1.0 ratio even on lower priority.

WebIOPi - Raspberry Pi REST Framework to control your Pi from the web
http://store.raspberrypi.com/projects/webiopi
http://code.google.com/p/webiopi/
http://trouch.com

TheCaptain
Posts: 4
Joined: Tue May 29, 2012 8:43 pm

Re: WebIOPi : control your Pi’s GPIO with a browser

Sun Dec 09, 2012 12:25 pm

trouch wrote:
LHX211 wrote:Hi and thank you for your effort. It works fine on mu device but loading at start doesn't: it just display a white page (no error so looks like it works to a certain point) but the GUI page is never loaded. If I stop then restart the the background service, it works, but never after the board boot.
Is there anything that shoud be configured in the init.d or elsewhere? I just run the "$ sudo update-rc.d webiopi defaults" once according to the instructions and nothing more.
I confirm that. I have to investigate...
Thanks for the feedback
FYI
I came across this too. I was using frames in index.html, the first two worked (both pointed to other ports for webcam etc.) the third had the WebIOPi buttons in. this was blank. force-reload and it worked.

Chris

trouch
Posts: 310
Joined: Fri Aug 03, 2012 7:24 pm
Location: France
Contact: Website

Re: WebIOPi : control your Pi’s GPIO with a browser

Sun Dec 09, 2012 3:14 pm

TheCaptain wrote:
trouch wrote:
LHX211 wrote:Hi and thank you for your effort. It works fine on mu device but loading at start doesn't: it just display a white page (no error so looks like it works to a certain point) but the GUI page is never loaded. If I stop then restart the the background service, it works, but never after the board boot.
Is there anything that shoud be configured in the init.d or elsewhere? I just run the "$ sudo update-rc.d webiopi defaults" once according to the instructions and nothing more.
I confirm that. I have to investigate...
Thanks for the feedback
FYI
I came across this too. I was using frames in index.html, the first two worked (both pointed to other ports for webcam etc.) the third had the WebIOPi buttons in. this was blank. force-reload and it worked.

Chris
There is actually some server error when using startup at boot, but I don't have time to investigate this right now.
You don't need to use frames for your webcam. You can just add an img tag in your webiopi page and set the src attribute to your webcam stream, even if it's on another port. This is what I do, and it's allow a better integration of the stream in the webapp.

WebIOPi - Raspberry Pi REST Framework to control your Pi from the web
http://store.raspberrypi.com/projects/webiopi
http://code.google.com/p/webiopi/
http://trouch.com

Andy60
Posts: 4
Joined: Tue Oct 09, 2012 10:44 am
Location: Stuttgart, DE

Re: WebIOPi : control your Pi’s GPIO with a browser

Mon Dec 10, 2012 12:46 pm

Thanx for patch 606. Now we can have also macros with 0 arguments which was the case for me. I use a macro that does some calculations on server side based on some GPIO values and just answeres the final value as HTTP result. It didn't need any parameters so I had to use one fake argument for my macro in the past which can be avoided now.

trouch
Posts: 310
Joined: Fri Aug 03, 2012 7:24 pm
Location: France
Contact: Website

Re: WebIOPi : control your Pi’s GPIO with a browser

Mon Dec 10, 2012 12:59 pm

Andy60 wrote:Thanx for patch 606. Now we can have also macros with 0 arguments which was the case for me. I use a macro that does some calculations on server side based on some GPIO values and just answeres the final value as HTTP result. It didn't need any parameters so I had to use one fake argument for my macro in the past which can be avoided now.
Yes, I made this change so you can use directly webiopi().callMacro("myMacro") without any additional parameter ;)
Happy to learn people are following my work !

Be careful with the trunk, I may commit new bugs as I change the code.
Only tagged and packaged version are supposed to be bug free ;)

WebIOPi - Raspberry Pi REST Framework to control your Pi from the web
http://store.raspberrypi.com/projects/webiopi
http://code.google.com/p/webiopi/
http://trouch.com

trouch
Posts: 310
Joined: Fri Aug 03, 2012 7:24 pm
Location: France
Contact: Website

Re: WebIOPi : control your Pi’s GPIO with a browser

Mon Dec 10, 2012 7:26 pm

Hi guys
For peoples who have trouble when starting webiopi at boot, I fixed it on the trunk (rev 608).

WebIOPi - Raspberry Pi REST Framework to control your Pi from the web
http://store.raspberrypi.com/projects/webiopi
http://code.google.com/p/webiopi/
http://trouch.com

hotwires81
Posts: 5
Joined: Wed Dec 12, 2012 12:58 am

Re: WebIOPi : control your Pi’s GPIO with a browser

Wed Dec 12, 2012 1:05 am

I tried to remotely access webiopi today and was unsuccessful. I have verified port forwarding settings and all is correct. I can hit port 80 on my Pi and call up a page from Apache2, however when I try port 8000 I get a "no response from server" message. Tried two different offsite ISP's (DSL and 3G). Is there some code in the web server portion that blocks IP outside of the Pi's subnet? That's sure what it acts like. Any suggestions?

LHX211
Posts: 2
Joined: Fri Nov 30, 2012 2:14 am

Re: WebIOPi : control your Pi’s GPIO with a browser

Wed Dec 12, 2012 2:07 am

trouch wrote:Hi guys
For peoples who have trouble when starting webiopi at boot, I fixed it on the trunk (rev 608).
Hi, where the rev 608 can be found/downloaded from?

trouch
Posts: 310
Joined: Fri Aug 03, 2012 7:24 pm
Location: France
Contact: Website

Re: WebIOPi : control your Pi’s GPIO with a browser

Wed Dec 12, 2012 8:29 am

LHX211 wrote:
trouch wrote:Hi guys
For peoples who have trouble when starting webiopi at boot, I fixed it on the trunk (rev 608).
Hi, where the rev 608 can be found/downloaded from?
on the svn repository
http://code.google.com/p/webiopi/source/checkout

WebIOPi - Raspberry Pi REST Framework to control your Pi from the web
http://store.raspberrypi.com/projects/webiopi
http://code.google.com/p/webiopi/
http://trouch.com

alex_may
Posts: 1
Joined: Thu Dec 13, 2012 12:21 pm

Re: WebIOPi : control your Pi’s GPIO with a browser

Thu Dec 13, 2012 12:24 pm

Is it possible to read the current state of a PWM output and increase it? I have managed it with the inputs and outputs but have a complete mind block for PWM.

I am trying to "fade" an LED from 0 to 1 and then back to 0 in the Python script.

trouch
Posts: 310
Joined: Fri Aug 03, 2012 7:24 pm
Location: France
Contact: Website

Re: WebIOPi : control your Pi’s GPIO with a browser

Thu Dec 13, 2012 2:34 pm

alex_may wrote:Is it possible to read the current state of a PWM output and increase it? I have managed it with the inputs and outputs but have a complete mind block for PWM.

I am trying to "fade" an LED from 0 to 1 and then back to 0 in the Python script.
you can use webiopi.GPIO.getPulse(2) to get PWM value for GPIO 2.
the value is returned in a string prefixed by "angle:" or "ratio:"
prefix depends on which function you used to set PWM : pulseAngle or pulseRatio

WebIOPi - Raspberry Pi REST Framework to control your Pi from the web
http://store.raspberrypi.com/projects/webiopi
http://code.google.com/p/webiopi/
http://trouch.com

hotwires81
Posts: 5
Joined: Wed Dec 12, 2012 12:58 am

Re: WebIOPi : control your Pi’s GPIO with a browser

Fri Dec 14, 2012 3:10 am

Problem resolved. It's working fine tonight. I setup a new 512MB RPi tonight and loaded webiopi on it, worked fine, switched back to the 256MB pi and it worked as well. I rebooted my router before trying it, so I guess that was the problem. Any way to change the username and password?

trouch
Posts: 310
Joined: Fri Aug 03, 2012 7:24 pm
Location: France
Contact: Website

Re: WebIOPi : control your Pi’s GPIO with a browser

Fri Dec 14, 2012 8:35 am

hotwires81 wrote:I tried to remotely access webiopi today and was unsuccessful. I have verified port forwarding settings and all is correct. I can hit port 80 on my Pi and call up a page from Apache2, however when I try port 8000 I get a "no response from server" message. Tried two different offsite ISP's (DSL and 3G). Is there some code in the web server portion that blocks IP outside of the Pi's subnet? That's sure what it acts like. Any suggestions?
hotwires81 wrote:Problem resolved. It's working fine tonight. I setup a new 512MB RPi tonight and loaded webiopi on it, worked fine, switched back to the 256MB pi and it worked as well. I rebooted my router before trying it, so I guess that was the problem. Any way to change the username and password?
Sorry I miss your message, but happy you solved your networking connection.
Right now, the only way to change the login password is to make your own python script which will wrap webiopi.Server class.

Code: Select all

# First import webiopi
import webiopi
import time

# Instantiate the server on the port 8000, it starts immediately in its own thread
server = webiopi.Server(port=8000, login="webiopi", password="raspberry")

# We need to loop/sleep to keep the Server thread running
try:
    while True:
        time.sleep(5)        

# Break the loop by pressing CTRL-C
except KeyboardInterrupt:
    pass

# Cleanly stop the server
server.stop()
check http://code.google.com/p/webiopi/wiki/PYTHON

WebIOPi - Raspberry Pi REST Framework to control your Pi from the web
http://store.raspberrypi.com/projects/webiopi
http://code.google.com/p/webiopi/
http://trouch.com

ronnydm
Posts: 4
Joined: Sat Dec 15, 2012 1:03 pm
Location: belgium , mechelen

Re: WebIOPi : control your Pi’s GPIO with a browser

Sat Dec 15, 2012 1:36 pm

hello,

i am new in this stuff
i have installed the webiopi software (nice software)
i use the demo.py and demo.html piece

i have installed also the webiopi service when the system boot
/etc/init.d

when i open the demo.html page with a browser
http://x.x.x.x:8000/demo.html, i have a 404 error

when i stop the service service webiopi stop
then start the python script python3 demo.py &
then it works

what is the difference with the service and the python demo.py script

regards

ronny

Return to “Interfacing (DSI, CSI, I2C, etc.)”