Post by swanseamick on Jul 16, 2013 0:48:14 GMT -8
I modified the 'Sound Alert' control to send B2 to my Pi URL, but when I click Validate, or click the button I get an error!
Traceback reads as follows:
all the following refer to File: "/usr/local/lib/python2.7/dist-package/web/application.py",
Line 239, in process return self.handle() Line 230, in handle return self._delegate(fn, self.fvars, args) Line 420, in _delegate return handle_class(cls) Line 396 in handle_class return tocall(*args) TypeError: POST() takes exactly 1 argument (2 given)
192.168.1.100:49505 - - [16/Jul/2013 09:20:45] "HTTP/1.1 POST /" - 500 Internal Server Error
Post by swanseamick on Jul 16, 2013 22:55:24 GMT -8
I amended Config.py, set DEBUG = True, recompiled it and the results haven't changed from original scenario.
I can see the 'If Debug()' statements and their associated 'print' statements scattered around the code, but they are not being triggered.
Follow up: After some experimentation, discovered 'print' statements should 'print' to the 'Console'. As I am getting no prints when I run RasPiConnectServer, it would appear problems lie outside RasPiConnectServer, before any of its files are being used i.e. setting DEBUG to True is not triggering any 'prints' whatsoever.
Without knowing the sequence of events/calls that should occur when button or Validate is pressed I am unable to track any further.
Can you supply a noddies/idiots guide to sequence of events that should occur when Validate is pressed. This will at least give users a BIG clue as to how the RasPiConnectServer system operates.
I strongly suspect that error is occuring before any of the RasPiConnectServer software comes into play! Mike
Post by swanseamick on Jul 17, 2013 8:26:14 GMT -8
When I suggested an Idiots Guide, I was hoping it would explain the following:
There are various 'Execute' Modules for each Control on the page, but in my case, the ActionButton control is not making a sound, so the ExecuteActionButton module is not being called. So I need a guide to explain the sequence of events leading up to this module being called into play, along the lines of:
a. Validate triggers App to Refresh b. Message received in Server in Class xxxx in RasPiConnectServer.py c. Class xxx calls yyy in Web/Application.py ... ... z. RasPiConnectServer class zzz responds with "yes, I received this command ok"
i.e. something with a bit more meat in it.
This would serve 2 purposes 1. Explain how system works, so we can understand more fully how to get it to perform tasks we want. 2. Explain where to look if things don't work properly.
Post by swanseamick on Jul 17, 2013 22:22:04 GMT -8
Sorry, your assumption is incorrect. Whenever I try to get a Server Report in App, I get exactly the same error messages as I get when I try to Validate, and the Server Status LED stays Black (It goes Red if Server not running on Pi)
The final line of the error message: "500 - Internal Server error", comes from Web.py package, not from one of your RasPiConnect modules, therefore problem seems to be between RasPiConnect and Web.py, so not something a user can influence.
I suspect web.py may not be installed correctly. Is there any further tests I can do to check correct installation of web.py?
This is another reason why 'apt-get install RasPiConnect', should install everything, including a check for all dependencies, such as web.py. That way, you and the users know all the correct files are being installed. The current installation method relies too much on the skills of your user - especially newbies like myself. After all, that is the whole raison d'etre of the Raspberry Pi, to encourage computer newbies into computing.
We are both running Python 2.7, so that's not the problem.
I assume the .90 is a typo in your NB?
Run the command: "sudo easy_install web.py"
My results: --------- Searching for web.py Best match: web.py 0.37 web.py 0.37 is already the active version in easy-install.pth
Using /usr/local/lib/python2.7/dist-packages Processing dependencies for web.py Finished processing dependencies for web.py ----------
Are you running as the "pi" user and not root?
One more question:
From the manual:
System URLs are what RasPiConnect uses to communicate to the servers. If you are on an internal wireless network, these URLs are typically of the form: "http://ipnumber:portnumber/raspi" (Ex. "http://192.168.1.130:5700/raspi"). If you put your Raspberry Pi on an external network connected to the internet, they would be of the form "http://qualfieddomain:portnumber/raspi" (Ex. "http://raspi.example.com:5700:/raspi"). You can route your Raspberry Pi through your router (port forwarding) to only expose one port to the Internet. If you do this, make sure you change your passwords to something very complicated!
Do you have the system URL in the App in the form of: "http://192.168.1.130:5700/raspi" ?
Post by swanseamick on Jul 18, 2013 10:51:23 GMT -8
All this time we've been conversing, and this is first time you've mentioned adding '/raspi' to end of URL, despite last two posts from me clearly showing I hadn't appended it.
Nowhere in the documentation is this emphasised, and would you believe it, that was the problem!!!!!
In my defense, the sample URL shown in App when adding a new URL doesn't mention it - this needs changing, and the comments in Config.py need to show this as well. (You ought to know no-one reads the manual, and need leading by the hand)
Also the documentation (seen above) contradicts itself, in one case it shows 192.168.1.130:5700/raspi and in other example, adds an extra colon before /raspi.