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!
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:
PORTNO = 10552
newmsg = self.rfile.readline().rstrip()
print "Client %s said ``%s''" % (self.client_address, newmsg)
self.server.oldmsg = newmsg
s = SocketServer.UDPServer(('',PORTNO), handler)
print "Awaiting UDP messages on port %d" % PORTNO
s.oldmsg = "This is the starting message."
// 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:
Upgrade to ARC Pro
Your robot can be more than a simple automated machine with the power of ARC Pro!
I have a Radio Shack monster truck I'm building up to with the tank chassis. I trashed a few things before getting the tank for tests first. Rather than tearing my tank apart, I'm waiting for the new EZ-Bs to become available for the truck climber.
Here's the final script that keeps it renegotiating until it climbs to the highest point of whatever it's placed on. I find it fascinating how with so few rules something with just one sense can perform such complex behaviors.
When I took the tank outside for rock climbing, I realized the IP address I was connecting to 192.168.1.2 was my laptop with ARC but through my wifi network.
I've tried connecting to local host 127.0.0.1 on port 1111
When enter netstat at the cmd.exe prompt I see the local host with 8 different ports but none with port 1111.
When I run Microsoft's TCP view (which is a really cool program) I see the ARC.exe with a local IP Address at 0.0.0.0 on port 1111
I've tried entering in 0.0.0.0 on port 1111 on the Sensor Streamer Iphone app.
I've tried opening port 1111 in my windows firewall but not sure I did it right.
I'm wanting to give the tank a GPS location up a steep hill and let it navigate around until it finds a way to the top. Then I'll hook this up to a high powered 4x4 truck.
I powered an 5 v Asus Wireless access point from the EZ-b board. It consumes a lot of power but works.
I can't figure out why the phone can't connect directly to the wifi on the laptop. Is it a firewall issue? Network things baffle me.
Couple of other options available I'll post about tomorrow when more awake.
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
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.
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
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.
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.
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.