How to control a rc toy with Android app - java

I have a rc drone. I want to create an Android app to control it but I do not know where to begin and how. I browsed the internet and found only one useful tutorial but it required use of Adruino and was through Bluetooth but I want to create my own Android app and not use Adruino or Raspberry Pi. Please help

First you need to connect via bluetooth (If you have no documentation of your RC drone it will be had to figure out the commands etc).
Maybe you can find a bluetooth sniffer program on the www to record what is going on when using the original hardware.
But I think its not worth the effort. To figure all this out will most likely take a lot of time and might not lead to success at all. So I recommend: next time by a drone where the communication protocol is documented or better a SDK is provided with it.

First, you have to figure out, if this drone uses Wifi or Bluetooth for control, or, some custom- build wireless device. If it use custom adapter, working on another frequency, you won't be able to do anything from software, only reverse- engineer control schematics.

Related

Is there a way to find out what a bluetooth LE device listens to?

I have a bluetooth LE device that is powered by its developer's app.
Sadly it is not maintained anymore and therefore I intend to rewrite the app from scratch.
Additionally it is not possible to pair to the device. It only listens to BLE.
Is it possible in any way to find out, how the device is being controlled?
I tried to decompile the code via JADX but since the manufacturer is chinese and decompilation already comes with its own problems, I thought if it would be possible to find it out without this procedure. (GitHub)App-Decompiled-Code (External)Original-APK-Download-Page
It depends what the device is really. There are number of profiles/services defined in the Bluetooth standard. If the device uses one of them then you could design from the specification rather than the device/app.
A good place to start is to use a generic Bluetooth Low Energy scanning and exploration tool such as nRF Connect to explore the device. Find out the UUIDs of the services and characteristics and compare it to the assigned 16-bit UUIDs values on https://www.bluetooth.com/specifications/assigned-numbers/
If it has a custom BLE profile/service then you can still use the nRF Connect app to explore it. If it is not obvious how to access the data or what commands need to be sent, then looking at the HCI logs on the phone after using the developer's app might be helpful.

Is it possible to set pin programmatically for bluetooth pairing?

I have an application (however I'm testing using the sample bluetooth chat from the SDK) where two android devices connects each other, and exchange data.
I already have part of the pairing process hardcoded using the BT address, problem is: the dialog it appears to confirm the pin. Is there a way to make that work programmatically? The only thing that "appeared" to solve my problem was in this question, but that API is completely abandoned, has no documentation and many issues.
As fair as I know the problem is that if the device is not the device database with paired devices, without root access the standard API is always going to prompt the user, but I'm still wondering if there's a way.
Bluetooth autopairing is defined only for some devices. To change this you should rewrite Android framework. So, from the application, it seems to me, this is impossible to do.

Simple application that simulates a bluetooth accessory

I'm looking for a no-brain application that allows me to send a pre-defined list of commands through a bluetooth connection, or an equivalent Java/Scala library that works decently in OSX (64bits).
In short, I want to use my computer to "simulate" a bluetooth accessory, so I must be able to control the pairing, the exchanged code, and so on...
Thoughts?
Simulating jsr-82 can be done with the BlueCove Emulator Module:
http://bluecove.org/bluecove-emu/
http://bluecove.org/ works on OS/X and am sure there wouldn't be any issues with a 64bit OS.
I'd refer you to this Answer: https://askubuntu.com/questions/20195/bluetooth-emulator
You may want to reconsider your question...
To emulate a bluetooth device you would need to develop a bluetooth driver getting it's input from a different source, this would be far more complex than buying a real device.
If you are looking to get some NMEA data though, you may be interested in this:
Most bluetooth enabled phones have apps that do that:
Android: https://market.android.com/details?id=com.cajax.gps2bt2
Any J2ME: http://www.digitalmobilemap.com/bluetooth-gps-simulator-for-j2me-phone
Haven't found one for iPhone, only reference it can be done: http://spench.net/drupal/software/iphone-gps
Hope that helps!
Can you be more exact?
Simulate a Bluetooth accessory for ..?
There are different BT accessories for different smartphones...
Making a BT accessory for iPhone usually requires an authentication chip from Apple...I don't know if a Mac can do it, probably it could - however I'm pretty sure it couldn't describe itself as an accessory.
Accessories usually imply a piece of hardware, in my understanding at least.

How to autoconnect to a bluetooth device when its near programmatically in android?

I am writing an app that creates RFCOMM socket with another device (not necessarily an android), and send some data over it. Right now I can connect and transfer data over the socket, but I also want to be able to stop when the device is far and auto start transfer when the device is near again. How do I know if the device is near again? Any pointers will be greatly appreciated. :)
I'm not aware of a nice, easy Java interface to it. You can connect using the NDK and call the hci_read_rssi() function (you need to write a native java call to this). This requires you to have already connected to the device. It will give you a signal strength reading which is relative to your distance, you will need to tweak this of course.
Many Bluetooth devices will allow you to program their operational mode (ref http://www.sparkfun.com/datasheets/Wireless/Bluetooth/rn-bluetooth-um.pdf). In this mode you can set the device to automatically connect without the need for pairing which could be what you're after. Of course you are limited by the actual device you need to work with.
Good luck!

Discover mobile devices using wifi

I'm doing some work for my theses in networking, and have stumbled into a little problem. One of the first steps in the work I must do consists on having a computer working as an AP (I am using hostapd for this) and with it, detect all the devices in the room which currently have wifi turned on (do not need to be associated with any AP).
I have found a thread that pretty much asks the same ( discover mobil devices using wifi ), and I understand the answers that were given, but they don't give any hint as to how this can be done. The post ends saying that the person was able to do this using Kismet, however I can only seem to use Kismet to discover clients already associated with an AP.
Can someone point me in the right direction here please? If not using Kismet, then maybe suggest a different tool that works with Ubuntu.
Ps. I will need to run a continuous scan of the "room" to find any new devices and then send this information to an event manager written in Java.
I guess you could have a WiFi card, in monitor mode, scanning every channel for beacons. On Linux, aircrack-ng is the tool suite you are looking for. airodump-ng is the tool that shows you a list of devices present around your location. It is designed to display first the hotspots with the potentials clients, but also shows all the devices that are connected to an AP or trying to probe to an AP.
However, you won't be able to scan devices having their WiFi connection turned down. I'm not sure about devices not associated to an AP, my guess is you will be able to detect them if they send beacons one way or another (for example, to detect WiFi hotspots).
If you need this in Java, you can write a wrapper to airodump-ng, or you can launch airodump-ng as a service outputing to a file and read this file from a Java app.
No concrete answer I'm afraid, but I hope these will help you figure a way to solve your problem.

Categories