Dear Massimo, i have tried those methods from the articles suggested by you
previously. However I am still getting the same error.
I have also tried to copy the "Serial" folder from python2.7 dist-packages
to web2py site-packages. the result is still the same.
Bellow is the detail of the error ticket. Please help me take a look and
tell me what's wrong. thank you so much for your kind patience in helping
me.

Ticket ID

10.0.0.190.2013-03-26.09-37-15.161acac2-83f7-447d-b0f4-7acd40b6497e
<class 'serial.serialutil.SerialException'> could not open port
/dev/ttyAMA0: [Errno 13] Permission denied: '/dev/ttyAMA0' Version  web2py™ (2,
4, 2, 'stable', datetime.datetime(2013, 3, 4, 3, 26, 21))  Python Python
2.7.3: /usr/bin/python (prefix: /usr)  Traceback

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.

Traceback (most recent call last):
  File "/home/www-data/web2py/gluon/restricted.py", line 212, in restricted
    exec ccode in environment
  File "/home/www-data/web2py/applications/Comfort2/controllers/default.py"
<https://10.0.0.132/admin/default/edit/Comfort2/controllers/default.py>,
line 27, in <module>
  File "/home/www-data/web2py/gluon/globals.py", line 193, in <lambda>
    self._caller = lambda f: f()
  File "/home/www-data/web2py/applications/Comfort2/controllers/default.py"
<https://10.0.0.132/admin/default/edit/Comfort2/controllers/default.py>,
line 19, in test
    serialport= serial.Serial("/dev/ttyAMA0", 9600, timeout=1)
  File "/usr/lib/python2.7/dist-packages/serial/serialutil.py", line
260, in __init__
    self.open()
  File "/usr/lib/python2.7/dist-packages/serial/serialposix.py", line
276, in open
    raise SerialException("could not open port %s: %s" % (self._port, msg))
SerialException: could not open port /dev/ttyAMA0: [Errno 13]
Permission denied: '/dev/ttyAMA0'




On Mon, Mar 18, 2013 at 3:04 PM, The Organisation of Secret Shoppers <
[email protected]> wrote:

> Thank you Massimo :D I will try it out! and Thank you for developing such
> an awesome application!! :)
>
>
> On Fri, Mar 15, 2013 at 9:40 PM, Massimo Di Pierro <
> [email protected]> wrote:
>
>> One solution is discussed here:
>>
>> http://rwsarduino.blogspot.com/2013/02/pi-progress-tidbits-and-serial.html
>>
>> It is not the most secure solution but should get you going for debugging
>> purposes.
>>
>> Another solution, better, suggested here
>> http://www.sbprojects.com/projects/raspberrypi/serialsetup.php
>>
>> "add the dialout group the the www-data user"
>>
>> Massimo
>>
>> On Friday, 15 March 2013 03:35:06 UTC-5, Niphlod wrote:
>>>
>>> it's fine, but what you need to check is for the user who started the
>>> web2py process to be able to use your /dev/serialwhatever interface....
>>> How did you install web2py ?
>>>
>>> PS: I have a raspberry too :P
>>>
>>> On Friday, March 15, 2013 9:28:09 AM UTC+1, The Organisation of Secret
>>> Shoppers wrote:
>>>>
>>>> so do you mean i must edit my controller and views from the terminal?
>>>> (currently i'm editing them through the web) and the current application
>>>> was created using application wizard, which i think it said that it have to
>>>> be modified in the wizard itself.
>>>>
>>>>
>>>> On Fri, Mar 15, 2013 at 3:33 PM, Christian Foster Howes <
>>>> [email protected]> wrote:
>>>>
>>>>> the "user" for web2py depends on how you launch it...
>>>>>
>>>>> if you call:
>>>>>
>>>>> python web2py.py
>>>>>
>>>>> then it runs as you
>>>>>
>>>>> if you:
>>>>>
>>>>> sudo su bob
>>>>> python web2py.py
>>>>>
>>>>> it runs a bob.
>>>>>
>>>>> if you use apache or some other server i believe by default it runs as
>>>>> the user that is running apache.
>>>>>
>>>>>
>>>>> On Thursday, March 14, 2013 8:41:25 PM UTC-7, The Organisation of
>>>>> Secret Shoppers wrote:
>>>>>
>>>>>> hmm how do i check? i think running the python script has to be
>>>>>> "root" user? but i'm not sure what is the user type for the web2py...
>>>>>>
>>>>>>
>>>>>> On Thu, Mar 14, 2013 at 4:24 PM, Niphlod <[email protected]> wrote:
>>>>>>
>>>>>>> did you check that the user running your "working" script is the
>>>>>>> same as the one running the "I'm going wrong" web2py ?
>>>>>>>
>>>>>>>
>>>>>>> On Thursday, March 14, 2013 8:30:38 AM UTC+1, [email protected]:
>>>>>>>>
>>>>>>>> Hello guys,
>>>>>>>>
>>>>>>>>
>>>>>>>> i hope someone can help me with this! i have been stuck here for
>>>>>>>> days. I just created a web app using web2py and i want to use it to 
>>>>>>>> send
>>>>>>>> some serial commands to a device through Raspberry Pi.
>>>>>>>>
>>>>>>>> I have successfully sent the commands from R-Pi to the device by
>>>>>>>> running a Python script in the terminal.
>>>>>>>>
>>>>>>>> But i thought web2py is using python as well so i did something
>>>>>>>> similar but i get the error below:
>>>>>>>> *<class 'serial.serialutil.SerialException'> could not open port
>>>>>>>> /dev/ttyAMA0: [Errno 13] Permission denied: '/dev/ttyAMA0'*
>>>>>>>>
>>>>>>>>
>>>>>>>> my codes are:
>>>>>>>>
>>>>>>>> in Controller:
>>>>>>>>
>>>>>>>>
>>>>>>>> def test():
>>>>>>>>
>>>>>>>>     import serial
>>>>>>>>
>>>>>>>>     serialport= serial.Serial("/dev/ttyAMA0", 9600, timeout=0.5)
>>>>>>>>
>>>>>>>> return dict() <-- not sure what to return
>>>>>>>> in view/default/index.html:
>>>>>>>>
>>>>>>>> <a href = "{{=URL 
>>>>>>>> <https://10.0.0.132/examples/global/vars/URL>(c='default', 
>>>>>>>> f='test')}}"><img src ="/Comfort2/static/images/off.******jpg" width 
>>>>>>>> ="75" height="75"</a>
>>>>>>>>
>>>>>>>>
>>>>>>>> i created a default/test.html as well.
>>>>>>>>
>>>>>>>>
>>>>>>>> i have no idea what's wrong! :( give me some hints please. thank
>>>>>>>> you!
>>>>>>>>
>>>>>>>  --
>>>>>>>
>>>>>>> ---
>>>>>>> You received this message because you are subscribed to a topic in
>>>>>>> the Google Groups "web2py-users" group.
>>>>>>> To unsubscribe from this topic, visit https://groups.google.com/d/**
>>>>>>> to**pic/web2py/tiWZkXMoo6E/**unsubsc**ribe?hl=en<https://groups.google.com/d/topic/web2py/tiWZkXMoo6E/unsubscribe?hl=en>
>>>>>>> .
>>>>>>>  To unsubscribe from this group and all its topics, send an email to
>>>>>>> web2py+un...@**googlegroups.com.
>>>>>>>
>>>>>>> For more options, visit 
>>>>>>> https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
>>>>>>> .
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>  --
>>>>>
>>>>> ---
>>>>> You received this message because you are subscribed to a topic in the
>>>>> Google Groups "web2py-users" group.
>>>>> To unsubscribe from this topic, visit https://groups.google.com/d/**
>>>>> topic/web2py/tiWZkXMoo6E/**unsubscribe?hl=en<https://groups.google.com/d/topic/web2py/tiWZkXMoo6E/unsubscribe?hl=en>
>>>>> .
>>>>> To unsubscribe from this group and all its topics, send an email to
>>>>> [email protected].
>>>>> For more options, visit 
>>>>> https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
>>>>> .
>>>>>
>>>>>
>>>>>
>>>>
>>>>  --
>>
>> ---
>> You received this message because you are subscribed to a topic in the
>> Google Groups "web2py-users" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/web2py/tiWZkXMoo6E/unsubscribe?hl=en.
>> To unsubscribe from this group and all its topics, send an email to
>> [email protected].
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to