
EEGbiofeedback

I'm inches away from creating a method for us to use Iphones GPS, Acclerometer, gyro, data for our robots.
This app rapidly streams data to the PC via wireless UDP stream.
With Python 2.7 or greater installed, this Python script updates the PC with comma delimited data of telemetry data.
I've been trying for about 12 hours to make the Python script below write to the C drive so EZ-Script can read that line and split it into an array with it's split string function.
I don't know how to add that write function to the script?
Thanks in advance! Bill...
Below is info on the Iphone APP: Sensor Data Iphone App
Below is the correct format of the script above: Sensor Data PC script
Below makes me drule. The Specifications of the data the python script receives from the Iphone: App Specifications
import SocketServer
PORTNO = 10552
class handler(SocketServer.DatagramRequestHandler):
def handle(self):
newmsg = self.rfile.readline().rstrip()
print "Client %s said ``%s''" % (self.client_address[0], newmsg)
self.wfile.write(self.server.oldmsg)
self.server.oldmsg = newmsg
s = SocketServer.UDPServer(('',PORTNO), handler)
print "Awaiting UDP messages on port %d" % PORTNO
s.oldmsg = "This is the starting message."
s.serve_forever()
// REM below is a python write function that writes over the contents of an existing file and leaves it open for other programs to read
// with open("C:\\syslog.txt", "w+") as myfile:
// myfile.write(str(s.oldmsg))
That's a brilliant idea!
There is a lot of overhead with reading and writing to files - and having to install Python. I have a suggestion
In your iPhone app, include a section for IP Address and Username. Also maybe names of the variables to configure (i.e. $AccelX and $AccelY, and $CompassDegree, etc)
Have the iPhone set the variables directly in ARC. You can do so with the HTTP Server, easily. The syntax is..
You can repeat the above URL for each parameter, $AccelY, $CompassDegree, etc...
So essentially you skip the Python step and communicate with ARC directly. It's a good start to having an app that can have additional functionality too. For example, you can even have your iPhone control direction using ...
Any EZ-Script commands can be sent to the HTTP Server using that URL
hmmmm DJ with that little bit of code could i set variables directly in ARC from other programs that are running on my computer and is it posible for ARC to send data out to another program maybe using a get command ¿¿¿ confused
Yes. I used to do similar to operate Jarvis from ARC which was running some PHP which took the "event" and passed it to EventGhost.
In my cloud I believe the example is still there for the EZ-Script (this one). Somewhere I have posted the PHP code too but I'll see if I can find it if anyone wants it. Different apps will use different methods so it may not be useful other than as a reference.
The above has been scrapped now in favour of Telnet to communicate directly with ARC.
Any bit of code for that sort of thing would be something im VARY interested in
Thank You 
Thanks DJ and others for the rapid response.
I agree there are a lot of moving parts to this one. I didn't create the app. But Python has built in compiler so that if /when someone modifies the above code with a segment that rewrite a single line of the current comma delimited data sent, I could compile it to an .exe and you could make it available for us.
Bill
What's the name of the App? I'll write a control in ARC to receive the network connection.
Awsome! It's called "Sensor Data" by Wavefront Labs; https://itunes.apple.com/us/app/sensor-data/id397619802?mt=8
Sensor Data
Thanks,
Bill
You can mark this issue is resolved. I'm in the same room as DJ and he's working on the ARC control