I am trying to connect to an obi simulator, the torque app connects perfectly but i am not able to do it. I don't know if I need to check the protocols.
Any help would be great thanks
You should use UUID SPP for the connection and you must know that the Device Class for the OBD II adapters is 0x1f00 for Bluetooth Connections
You should check the protocol before ordering a OBD tool. Some support OBD2, some fits CAN BUS protocol.
Related
I am doing STM32 programming for my summer internship. Currently I am attempting to use an HC05 bluetooth module to send serial data over to the stm32 board. However, my HC05 bluetooth module does not connect to any of my devices. I am using android devices as well. I can find the device over bluetooth and I can pair the device as well, however it never connects. Does anyone know how I may be able to solve this issue. The HC05 is receiving 3.3 volts as well.
The problem turned out to be a hardware problem by the hardware engineers, not a problem with my code. The TX of the board was connected to the Tx of the HC05 and the RX of the Board was connected to the RX of the HC05. It should have been connected the other way around
which app are you using for testing your Bluetooth module? I recommend you use this one: https://play.google.com/store/apps/details?id=com.clarence.bluetoothserial, with which you can customize your frequently used commands as buttons. It’s very convenient.
I want to transmit some data (text) between android devices.
Like zapya or shareIt applications.
I don't want to connect each device to a same modem.
I want just to connect two devices over wifi and send/receive data between them.
How can i implement this in android ?
Thanks in advance :)
You'll find what you're looking for here Wifi P2P Android
You can create a peer to peer network between two devices that support it and send arbritrary data between both
I want communication between two Android phones, both the phones are connected to the same Wi-Fi network. Knowing the IP address I can directly use sockets to communicate with both the devices, but my question is, is it possible to get the IP address at the run time? Or is there some other way in which I can do this?
You can use jmDNS to achieve this. It's a really helpful library and once you detect the all devices connected to the same wifi you can get their ip and port so you can establish a connection. You can learn more about how to use it here.
Or you can use Android Wi-Fi Direct API which works only for API Level 14+. Here is more information about the API : Wifi-Direct.
Hope it is what you are looking for! : )
You can use Google Android NSD service.
Check out http://developer.android.com/training/connect-devices-wirelessly/nsd.html
Assuming that both devices are in the same local network you could use/write kind of ip scanner (Check every single ip adress whether is alive and if it is try to connect).
I'am trying to make an app that receives some binary data from a other device which is not running android. The Android phone should not transfer any data to this device. So over to my questions:
Should the phone act as the server which establishes the RCOMM channel?
Is it possible to connect the phone and this device without paring, as long as I know the MAC-address of the device? If so, how?
And yes, I have read http://developer.android.com/guide/topics/connectivity/bluetooth.html so no need to only answer with that link. :)
Thanks in advance!
1)
Phone should act as a receiver.
I found that the tricky part is to use correct UUID.
If you connect two phones you should be generating those and everything work fine, but on your hardware you can't change UUID that easily.
Take a look at these reserved UUIDs.
For a Serial Port Profile's (SPP) communication use UUID 00001101-0000-1000-8000-00805F9B34FB.
2)
You can connect to a device without pairing if you already know the MAC address, you don't even need to use BlueTooth discovery.
To get device using MAC address call getRemoteDevice(String)
and then createRfcommSocketToServiceRecord(UUID) to get BlueToothSocket.
Also take a look at checkBluetoothAddress(String) to validate MAC address.
Can I setup a pc to act as a virtual serial port to mimic a device using SPP bluetooth profile that I need to talk to an android phone?
The device would not have no way receiving the UUID that it needs to be listening for to connect to my phone.
I saw the "reflection" method being used to avoid UUID. Is this how to communicate with devices agnostic to android's communication process?
I don't really understand the final part of your question.
For the first part however, you can. You just need a BT adapter inside your PC/laptop, Windows,Python installed, and a little library called PyBluez.
After installing everything, you can communicate via SPP with client-server roles established as you like (PC server & Android client or viceversa). You have examples for both those:
PyBluez server example and client example
Android examples here
You have to have a UUID, but, in the examples above, it is the standard UUID for SPP. Basically SPP is RFCOMMM with this UUID:
00001101-0000-1000-8000-00805F9B34FB
Don't forget to vote if useful!