John Gantner's Posts (2)

Sort by

The emulator running some demo data, and showing the result.

The Bluetooth/GPRS application I've been working on is now functional enough that it might be of use to someone. Feedback and suggestions are appreciated. Currently, the application has been left as a dumb bent pipe, so the mcu has complete control over the data stream (though it must conform to the var1=xxx&var2=yyy......\n format for parsing to work, see code and documentation).Code here bb.zipDescription:BlueBot is a bridge between Bluetooth and HTTP. Bluetooth's Serial Port Profile (AKA RFCOMM) is a streaming protocol that acts like a serial port. Due to carrier gateway restrictions, streaming network sockets are often impossible, so HTTP is used. HTTP is not streaming, so BlueBot listens for \n's in the SPP data stream to separate packets. Each packet is then forwarded to a remote server, returning a response that is streamed back over Bluetooth.Use:The UI is rough, and the program surely has bugs. I'll be tidying it up - adding a live display of data, etc... The application was built for the lowest common denominator of phones, so it should work on almost any phone that has JSR-82 and some sort of data capabilites. Be sure to install the PHP script on an accessible IP or else handshaking won't work.The general use is:-Start application-Set up network--Handshake with the remote server-Set up Bluetooth--Search for devices--Connect to a device-Run (Both Bluetooth and Network have to be setup before this)-DisconnectInstallation:I can't really offer any advice on the installation onto the phone - I am very new at this. It has been tested on 2 Blackberry phones and on the Sun ME emulator. It is an unsigned application, so it has to at least ask for permission to use Bluetooth and the network, or it might not even be allowed to install on some phones.Contents:BlueBot.java - Handles program flow and UI elements.BluetoothConnection.java - Bluetooth utilitiesNetworkConnection.java - HTTP Utilities and the network send threadReceiveThread.java - Reads the Bluetooth input and condenses them into packets for SendThread.SendThread.java - Sends packets over HTTP and sends the responses back over Bluetooth.SPP.java - A MIDlet that simulates a Bluetooth device to communicate with. Just prints some test data at 1Hz right now.kmlupdate.php - A slightly updated PHP script that parses incoming data. It doesn't return anything yet except for the handshaking phase.
Read more…

Google Earth Live FPV & Cellular Telemetry

This post is about a live (simulated) FPV system using Google Earth, relaying data over a cellular GPRS/3G network. A while ago I saw a commercial OSD setup that used Google Earth to simulate an FPV display. Needless to say, I was immediately smitten. However, video TX gear is expensive and a hassle, so Google Earth here serves as a simulated FPV. Hopefully this will eventually mature into a Google Earth HUD (like the Flight Sim easter egg already in it, but real-life!) Comments/Questions/Suggestions welcome. This is just a proof of concept for now, so it is really just an experiment to help me learn KML.

Basically, it is:[Controller]--Serial-->[Bluetooth module]--Bluetooth-->[Cellphone]--GPRS/3G-->[Server]<--GPRS/3G/Wifi/Wired-->[Ground Station]The server, and the roundabout, non-streaming nature of the system, is required because of NATing, and carrier APNs generally not allowing anything but straight HTTP and outgoing connections (and generally being terribly unreliable).So here's some simple PHP scripts. PHP was used because I found a free host that offered it. These have very little error-checking and are generally hacky. There isn't really anything written up about how to use them yet. Caveat emptor.kmlupdate.php - Called by the UAV. Takes any POST/GET data and appends it to a csv file on the server.loadkml.php - Generates a KML file for GE that has 2 NetworkLinks in it. The ground station calls this page once at the beginning of the flight to setup for live telemetry.lightkml.php - This one is called by GE via the KML NetworkLinks that loadkml generated. It dynamically returns (only) the latest data in a 3D point form and in a simulated FPV form. It's called lightkml because it is designed to use only a small amount of bandwidth, useful if the ground station is on costly GPRS/3G. I could really cut it down by building the file locally, but I can't really be bothered to do it right now.heavykml.php - Still working on this one. It has a rollercoaster-like animated FPV tour and 2D/3D line tracks. It returns the entire flight each time it is called, not just the last point, so it is only suitable for post-flight review.I don't actually have the Bluetooth module yet (or the actual controller for that matter, but I do have a program spitting out simulated datapoints for testing), so I won't upload the J2ME stuff until I get a chance to test it. Right now I am only simulating the Bluetooth and the UAV data on a J2ME emulator. Theoretically, it should work on any Bluetooth J2ME phone that properly implements JSR-82 with RFCOMM and has HTTP available.To try it out you can load the scripts somewhere then do something like://Some simulated data stored at "test". Google Earth's camera roll/pitch/yaw is not like a plane. Altitude is absolute.http://127.0.0.1/kml/kmlupdate.php?filename=test&latitude=37.796037&longitude=-122.390736&altitude=200&roll=-40&pitch=82&yaw=178//Generate the KML file. Save this and rename it to a .kmlhttp://127.0.0.1/kml/loadkml.php?filename=test//Start Google Earth and load the "loadkml.kml" file//Select one of the 2 types of views, static view 3D point or animated FPV. The annoying "bouncy" effect on FPV will be removed soon. It will autoupdate every second, so try entering new data in kmlupdate and watch the results. It only displays the last point to (eventually) save on bandwidth. To stop the bouncing or to stop updating uncheck the boxes.Files: phpkml.zip
Read more…