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:
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
<a href = "{{=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/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/groups/opt_out.
wget http://web2py.googlecode.com/hg/scripts/setup-web2py-ubuntu.sh
chmod +x setup-web2py-ubuntu.sh
./setup-web2py-ubuntu.sh
:D
10.0.0.190.2013-03-26.09-37-15.161acac2-83f7-447d-b0f4-7acd40b6497e
| web2py™ | (2, 4, 2, 'stable', datetime.datetime(2013, 3, 4, 3, 26, 21)) |
|---|---|
| Python | Python 2.7.3: /usr/bin/python (prefix: /usr) |
1. | Traceback (most recent call last): |