Bluetooth + GPRS Cellular Telemetry, Part II

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.
E-mail me when people leave their comments –

You need to be a member of diydrones to add comments!

Join diydrones

Comments

  • I wish. I bought a c168i off ebay but I found it didn't support AT command GPRS data over serial, and SMS is too expensive, too small, and too slow. In any case, I wanted to develop a relatively phone-agnostic solution so this was the only way. I decided early on that modules were not the answer because they are a hassle to deal with, and I wanted to investigate the possibility of using the phone as an onboard processor (and maybe access the camera). The G1 supposedly has a serial port that can be hacked into, but it is expensive.
    On a side note, I asked a question in the forums about bluetooth/2.4GHz rc gear interference but I don't think there were any responses. I could probably get some mu-metal for it if necessary
  • 3D Robotics
    Any chance of a hard-wired serial link from the autopilot the cellphone? One generally tries to avoid adding more RF sources than necessary onboard.
  • The cellular link will eventually be able to issue commands but for now it is just telemetry. I'd appreciate suggestions on a command set for the base station. See my previous blog post for more details on the Google Earth live FPV simulator I intend to use it for.
    I intend to eventually fly at long range, and I am not convinced that xbee will cut it if there are structures or mountains around. Long range radio gear seems expensive and complex to me, and I don't have an amateur radio license anyways. Cellphones are really good radios in disguise, and everyone has one!
    So I'll just throw any bluetooth cellphone (ebay) with a GoPhone SIM ($0.01/kb data, very cheap) in the UAV and use a wifi or data card on the laptop (or maybe use another cellphone as the base station). The controller will have a bluetooth module which is cheaper and lower power than a full-on cellular module, so you could use it with either the IMU dev board or the ArduPilot (or anything else), or even use the cellphone processor as a more powerful onboard controller.
  • 3D Robotics
    What kind of UAV applications can you envision for this?
This reply was deleted.