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] wrote: > > 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 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.

