1

As a Mension, I'm doing some testing in RPi. The final objetive it's to control a motor and some sensor from Internet/Smartphone.

I was searching for information and I decided to use WebIOPi because seems pretty cool.

So,I wanna to make a client using the REST API, so first I'm trying with cUrl to make some testing.

The problems begun when I tried to change the GPIO or get some information. So a set a HTTP POST for example:

curl -v -X POST -u webiopi:raspberry http://10.42.43.112:8000/GPIO/2/function/out

And the output is this:

*   Trying 10.42.43.112...
* Connected to 10.42.43.112 (10.42.43.112) port 8000 (#0)
* Server auth using Basic with user 'webiopi'
> POST /GPIO/2/function/out HTTP/1.1
> Host: 10.42.43.112:8000
> Authorization: Basic d2ViaW9waTpyYXNwYmVycnk=
> User-Agent: curl/7.43.0
> Accept: */*
> 
* HTTP 1.0, assume close after body
< HTTP/1.0 403 Channel 2 is not allowed
< Server: WebIOPi/0.7.1/Python3.4
< Date: Fri, 25 Sep 2015 07:22:33 GMT
< Content-Type: text/html;charset=utf-8
< Connection: close
< Content-Length: 481
< 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
        "http://www.w3.org/TR/html4/strict.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
        <title>Error response</title>
    </head>
    <body>
        <h1>Error response</h1>
        <p>Error code: 403</p>
        <p>Message: Channel 2 is not allowed.</p>
        <p>Error code explanation: 403 - Request forbidden -- authorization will not help.</p>
    </body>
</html>
* Closing connection 0

At the moment, I don't seek out anything helpful, So if you know something I missed and wanna help I'll be grateful.

And I tried again with the advices of @SteveRobillard as this (output) : quique ALL=NOPASSWD: ALL and it doesn't work,

quique@quique-Vostro-3500:~$ curl -v -X POST http://10.42.43.112:8000/GPIO/2/function/out
*   Trying 10.42.43.112...
* Connected to 10.42.43.112 (10.42.43.112) port 8000 (#0)
> POST /GPIO/2/function/out HTTP/1.1
> Host: 10.42.43.112:8000
> User-Agent: curl/7.43.0
> Accept: */*
> 
* HTTP 1.0, assume close after body
< HTTP/1.0 403 Channel 2 is not allowed
< Server: WebIOPi/0.7.1/Python3.4
< Date: Fri, 25 Sep 2015 08:17:28 GMT
< Content-Type: text/html;charset=utf-8
< Connection: close
< Content-Length: 481
< 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
        "http://www.w3.org/TR/html4/strict.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
        <title>Error response</title>
    </head>
    <body>
        <h1>Error response</h1>
        <p>Error code: 403</p>
        <p>Message: Channel 2 is not allowed.</p>
        <p>Error code explanation: 403 - Request forbidden -- authorization will not help.</p>
    </body>
</html>
* Closing connection 0

The same issue :/

1

Resolved!!

I finally resolved this problem it was a bad patch of the WebIOPi 0.7.1, so only I installed this patch: .groups.google.com/forum/#!topic/webiopi/RGtrRfFJMKY and everything works fine :D

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.