Skip to content
/ DIYTags Public

Android App for connecting to BT device (Arduino + HC-05) and make it work like AirTags.

Notifications You must be signed in to change notification settings

25b3nk/DIYTags

Repository files navigation

DIY Tags

Design and documentation

Everything can be currently found in this document: google docs link

Setup

Arduino

  1. Tx of HC-05 connected to Rx of Arduino.
  2. Rx of HC-05 connected to Tx of Arduino.

Current status

  1. Currently turns on bluetooth.
  2. Shows paired devices.
  3. Select paired device to connect.
  4. Send stream to arduino via BT.

To-Do

Bluetooth communication

  • Need to make it work with Tx from arduino connected.
  • Need to run input stream loop along with output stream.
  • Make the connection in background using AsyncTask or similar.
  • Add feature to pair device from app.
  • Receive data from arduino.
  • BLE device must be emitting public key at all times. This public key will be shared to DB & will put the device on map.
  • BLE device must share private key only when paired to a device.

DB

  • Store data of tag and location in DB.
  • Create a DB server in my PC and use it as cloud server to store/fetch data.
  • For AirTag type of application, we need to show only paired devices on the map.
  • For public transport application, all the devices can be shown on the map.

Map

  • Integrate a basic map.
  • Get current user location from app.
  • Show the tag location on map.

UI

  • Improve screen transition from MapActivity to MainActivity.

General

  • Remove unnecessary code.
  • Add docstrings.
  • Move the documentation from google docs to wiki ? (Maybe later)

Bugs & Improvements

  • Stable and robust bluetooth connection, and making sure no duplicate threads are created.
  • Fix this bug: com.example.diytags E/Sending to device: java.io.IOException: Broken pipe (I get this sometimes when I try to communicate with the BT module after connection is established)
  • Fix this warning: W/BluetoothAdapter: getBluetoothService() called with no BluetoothManagerCallback
  • Fix this bug: E/example.diytag: Failed to open file '/data/data/com.example.diytags/code_cache/.overlay/base.apk/assets/Mapnik/16/46893/30391.png': No such file or directory
  • The BT devices list must appear as a pop up and disappear after its purpose is served.
  • A check if the BT module is already connected.
  • Connect to BT device only which is compatible with the application (mostly BT modules connected to Arduino)

Arduino code reference

Github repo for arduino code

References

  1. https://www.tutorialspoint.com/android/android_bluetooth.htm
  2. https://developer.android.com/guide/topics/connectivity/bluetooth
  3. https://stackoverflow.com/a/22899728/5258060
  4. https://stackoverflow.com/questions/22899475/android-sample-bluetooth-code-to-send-a-simple-string-via-bluetooth
  5. https://stackoverflow.com/a/18480297/5258060
  6. Changing UI in non-UI thread by calling a UI thread
  7. https://www.electronics-lab.com/get-sensor-data-arduino-smartphone-via-bluetooth/
  8. Using Open Street Map API
  9. How to use the osmdroid library (Kotlin)

About

Android App for connecting to BT device (Arduino + HC-05) and make it work like AirTags.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published