I need to develop an Android app that retrieves data from a OBD-II Bluetooth dongle. As first step, I downloaded the API from https://code.google.com/p/android-obd-reader/ and tried to run the Sample Application in it, but it didn’t work for me. Can someone tell me who used that API and where is the error on that code? There are lots of packages and classes on it. I’m unable to clarify them.
It is very difficult to know which can be your problem. I have used the library you mentioned and it includes an application example that can help you to understand how the library works.
I recommend you to use the application called obdgpslogger (http://icculus.org/obdgpslogger/) that includes an OBDSim module (http://icculus.org/obdgpslogger/obdsim.html).
This module can work as an emulator of the ELM327 device. Using it under linux you will be able to emulate a Bluetooth ELM327 dongle. Using this application you will be able to get a log the Bluetooth connection and disconnection, the configuration AT commands sent to the ELM327 device and the querying rate.
I think it will be more easy than using a real vehicle.
I know that it takes some time to understand everything, but you can do it.
I hope it helps.
Related
I am working with a peripheral device that communicates with an app via BLE UART.
To test and modify the peripheral’s firmware, I want to find a starter Android app that can communicate with the peripheral. I want to be able to modify the app along the way as I modify the peripheral firmware.
I got the Nordic nRF Toolbox app working in Android Studio and running on my tablet. However, when I look through this project it is far too difficult for me to understand right now. I have worked through several tutorials that offer a far simpler solution, however not a single one of them has ever fully compiled correctly at the end – I assume they are all out of date. So it has been a difficult journey so far.
I need the app to be able to scan for devices, and allow the user to connect to one – and then be able to communicate with the BLE peripheral via UART.
Can anyone point me to (a) a starter app with code on GitHub or similar, that they have tried recently, or (b) a tutorial / walk-through, that they have successfully completed recently?
Thanks in advance for any suggestions
Garrett
I'm working with a Laird BT900 Bluetooth dongle which I can program to be a peripheral. When I add a service to it I can find it with a Bluetooth explorer on windows but on android I can find them.
Anyone knows what the problem can be? I'm open for suggestions.
What tool are you using on android? I generally use Nordic Semiconductor's NRFconnect tool for android to debug these kinds of issues, as it can provide raw Hex dumps for these kinds issues.
Also check, that you are configuring the service properly, as some modules need to be reset before service changes take place.
If you are writing your own app for android, the NRFconnect tool still comes in handy, as it can help debug something that is wrong in your service discovery code.
I am trying to figure out how to make game which will work only locally using Wifi Direct without any internet access.
The concept is very simple. It will be some kind of presentation so I need to have one master/host device and other connected devices will be slaves/clients. When I press button on master/host than should be changed only one value (string or int) in all slaves/clients devices.
With support of 20-40 connected devices in same time.
I have Tried:
UNet - it works only if it is connected to some router with use of local IP's but it does not support Wifi direct communication.
I have tried to find some plugins but I cannot decide which to choose or get information about support of Wifi direct.
I tried to find some other solution like Bluetooth but it supports only 4-13 connected devices at same time but I need to he connected around 20-40 devices in same time.
List of plugins I have found:
Forge Networking - https://www.assetstore.unity3d.com/en/#!/content/38344
1.1 I do not know if this supports a feature i required.
WifiDirect Plugin - https://www.assetstore.unity3d.com/en/#!/content/50112
2.1. This plugins have errors and have no support.
What I would like to ask about:
Does 1. plugin support Wifi direct?
Do you think That I should buy 2. plugin and try to fix it and hopefully I can find a problem and it will work?
Do you know some better or "any" solution how to solve this problem?
I am interested in any tips and help how to make it work.
Thank you very much for your help!
Jakub Kučera
After research I have realised a working solution!
Unity Asset Store: https://www.assetstore.unity3d.com/kr/#!/content/53955
Video of usage: Video
Plugin I have tested on a few Android devices and it works for Wifi Direct with no connection to internet.
This plugin supports much more than that for example:
TCP
Client / Server
Complete C# 2.0 native
Stand alone library (DLL)
Multi-Thread
Event Driven
Support [Binary/Json] message data
Log Server & MySQL Sample Code
New Feature
Unreliable UDP
MNF Server based WinFrom without MySql
I hope it helps somebody else!
And I would like to say thanks to author and his support!
I'm writing an android app which is to connect a special BLE device, reading data feedback from the device. First I need to write a shake-hand code "234" to the device, and it will return a code, then start to feeding data.
I've done with the iOS version, which is quite simple to implement, however the android version has so many problems. Hope you guys have any sample which can be used for me to understand how it works in whole process. Many thx.
This is documentation from Android: http://developer.android.com/guide/topics/connectivity/bluetooth-le.html
There is an example. Please use it as guide. Pretty simple example.
About your question. What Profile to you use? You should know that BLE exchange data through the Service/Characteristic/Descriptor system. So on your device should be any Profile. Or your use any of standard?
I am creating app in which I had to send data to phone via embedded device.
Is it possible to send file via embedded device to Android phone with Bluetooth?
I don't find any of example of it and I think I need another embedded device like dongle for implementing obex protocol.
You need to read in the bytes of the file that is being submitted by your device. Sample code that connects the android to a separate device can be found in this SO post. There is also a robust documentation of the API as well as a specific sample application. Be aware that many people are finding issues when using the sample application to try and connect the android to a separate device. The issue is explained in this SO post (see the accepted answer), but essentially the connectivity problem is caused by calling listenUsingRfcommWithServiceRecord.
I myself ran into problems with Bluetooth, but using the above resources have been able to quite successfully connect my android with an embedded device. Hopefully this aggregate of information will be of use to you.
You can use the very common UUID for SPP devices: ("00001101-0000-1000-8000-00805F9B34FB");