Yes, you should be able to use socket functions under Apache.
Originally Posted by bruce2000
That's correct, you cannot use appuifw; it's a current limitation of PyS60. See also my other posting in the Camera access restrictions thread.
What it is the limitation python script in PSP compare with Python for S60?
we knew we can NOT "import appuifw" in PSP,right?
No, you can place it anywhere you like provided you modify httpd.conf. But why not start with having it in that directory and move it to its final location when you know that it otherwise works.
The PSP page would look like below:
Should this python script work with PSP?
Must PSP page been placed in .../mod_python/psp folder?
I can't comment in detail since I don't know anything about the LightBlue API.
# server socket
But it seems to me that you intend to create a server socket inside a request handler. That's not likely to be a good idea. Namely, a request handler is supposed to execute fast, and if you create a server socket inside it, it's completely unbounded exactly how long the execution will take. Conceptually that's difficult and will in practice lead to number of problems - for instance, since Raccoon currently is single threaded, it will be completely blocked in that handler while waiting for someone to connect.
A better approach would be to have a separate server listening for Bluetooth connections and then from within the request handler connect to that server and ask for the data. That is, the request handler would look like:
connect to server
ask for data
print error message