
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))
You would need to set up your laptop as a router so it creates a network your iphone can connect to. As far as i know, an iPhone can o ly do Infrastructure networking, not Adhoc, but there is software available that can make Windows 7 be an infrastructure router , I'll try and post a link tomorrow, but as I recall it was a bit complicated for someone who doesn't already understand networking, so your solution is actually not a bad one. (sorry for the run on sentence.. Long day, and i am falling asleep as I type).
Couple of other options available I'll post about tomorrow when more awake.
Hi if you can enter a URL and not an IP address into the Sensor Stream app then you should be able to setup port forwarding or your home router (not the laptop) using a service such as DTDNS.net
If you are lucky enough to have a fixed IP address @home then you don't need the DTDNS service but you will need to make sure the appropriate port is visible over the Internet normally say port 80 would be but is used for other services so that's why Sensor Stream uses port 1111
I stream my home CCTV (4 cameras) to my IPhone using DTDNS and I can keep an eye on the house when I out and about and connected to a WIFI internet access point
It may not be the best way to do this as Sensor Stream updates rapidly and being on the same network maybe the most efficient. It depends I guess on how you want to run your application?
If I get a chance later I may try setting the DTDNS option with the Iphone and see if it works
Hey Winstn,
The Sensor Stream and ARC are working perfectly in my home network through my access point. Sensor Stream sends to my accesspoint my laptop gets the data there through port 1111 on 192,168.1,3 which I find with cmd.exe>ipconfig
My issue is when I take it out doors, I'm having to power an 5v Asus wireless Access point via the EZ-B board. Which works but just consumes more power than I like. I was thinking there was a way to communicate with my phone out doors and conserve significant battery life.
I find the Iphone accelerometer far superior to the MMA7455 BTW.
Thanks much,
Bill...
I was thinking about using a Sierra Wireless 4G LTE AirCard® Hotspot instead of a router on my bot then the bot itselff will be a wifi hotspot and use less battery power
A wireless hotspot was going to be one of my suggestions. Even one without a contract will still act as an lan router, they are battery powered, and typically charge on 5v 0.5amp or less (usb).
Bill, I have an old 3g MiFi off contract that you can have. Email me at alan at thetechguru.net with your mailing address if interested.
Alan
A little bit of an expensive solution, but this device: Roving Networks WiFi can be used as a really low power access point (among many other things). I bought one to try using as a WiFi TTL, which unfortunately is not one of the things it does, but I have plans for it.
Alan
Hey Techguru,
Thanks for the offer of your hotspot. Though, Asus wireless access point thing is working pretty well. I don't have to have it in my robot so I can power it separately so it won't be that much trouble. That Roving Networks WIFI looks powerful also.
I'm starting to build the 4wd monster truck climber now. I'll use the Iphone Data Streamer app to read GPS, compass and accelerometer to communicate with the EZ-B. I'm hooking the digital pins of the EZ-B to the remote controller for the truck. That way I won't have to make any modifications to the truck other than securely housing my Iphone.
I plan to use the phone's sensors to tell if it's trying to accelerate but it's against something. Then I'll back up, go left and resume it's uphill climbing algorithm.
When the mini is released, I'll put one of them in the truck with it's RC controller to add some addition ping or perhaps my Neato LDS unit.
Bill
Update:
We can significantly simplify this method by jailbreaking our iphones and purchasing the hotspot MyFi app.
This eliminates the need for powering a wireless access point for outdoor use.
Best,
Bill