Write Bluetooth Relay App for Android

Hello,

im new in programming for Bluetooth.

I would start it to create a Bluetooth App for Android to control a relay.

The old App for this is not obtainable anymore.

I think im right that its a nRF51822 chip on it how you can see in the picture (click on it to see it complete).

Can someone tell me how should I proceed?

Parents Reply Children
  • Hi Andreas,

    The nRF51 series, as I mentioned earlier, is quite old, so it is only supported by the nRF5 SDK. Also, please note that the highest version of nRF5 SDK that supports nRF51 series programming is the nRF5SDK v12.3.0. So please be careful to download that version from our website. You can find some interesting sample applications and examples when you download the nRF5SDK from our website: https://www.nordicsemi.com/Products/Development-software/nRF5-SDK/Download?lang=en#infotabs:~:text=12.3.0,nRF5%20SDK 

    Please take a look at the examples available on this SDK: https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v12.3.0/examples.html?cp=9_5_10_4 

    Unlike what @Jörg Fischer mentioned, you cannot use the entire nRF Connect for Desktop application, because it is meant for mainly the nRF52 series onwards and also mainly intended for the nRF Connect SDK. But you can use the "Programmer" app within this application with the help of which you can write a firmware onto the board.

    -Priyanka

  • Should have menioned in my post: The NRF connect app in Android and iOS are very different from the NRF connect app for desktop.

    The NRF connect apps on mobile devices allow inspecting service UUIDs and allow sending/recveiving arbitrary bytes. I don't think that you can do that with the desktop app, at least not without additional hardware.

  • Hi Andreas,

    Hope the information helps. 

    -Priyanka

  • Yes, but before i can write a firmware, i must find out, how to control the 4 relays.
    From others i know it can do with two hex strings (on/off). But is here the same?
    I dont know, and i think i must find it out first.
    I got a connection with the Android App NRF Connect, but every 5 Seconds it disconnected.
    In the Logs can you see that a Timout is set to 5000ms, but how can I disable this?

    nRF Connect, 2023-03-03
    FOREVER30144 (D7:86:94:18:DB:BF)
    D	22:37:38.743	gatt.close()
    D	22:37:38.745	wait(200)
    V	22:37:38.946	Connecting to D7:86:94:18:DB:BF...
    D	22:37:38.946	gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE, preferred PHY = UNKNOWN (0))
    D	22:37:39.406	[Callback] Connection state changed with status: 0 and new state: CONNECTED (2)
    I	22:37:39.406	Connected to D7:86:94:18:DB:BF
    V	22:37:39.422	Discovering services...
    D	22:37:39.422	gatt.discoverServices()
    D	22:37:39.426	[Broadcast] Action received: android.bluetooth.device.action.ACL_CONNECTED
    I	22:37:39.807	Connection parameters updated (interval: 7.5ms, latency: 0, timeout: 5000ms)
    D	22:37:39.898	[Callback] Services discovered with status: 0
    I	22:37:39.898	Services discovered
    V	22:37:39.903	Generic Access (0x1800)
    - Device Name [R W] (0x2A00)
    - Appearance [R] (0x2A01)
    - Peripheral Preferred Connection Parameters [R] (0x2A04)
    Generic Attribute (0x1801)
    Unknown Service (0000ffe0-0000-1000-8000-00805f9b34fb)
    - Unknown Characteristic [N W WNR] (0000ffe2-0000-1000-8000-00805f9b34fb)
       Client Characteristic Configuration (0x2902)
    - Unknown Characteristic [W WNR] (00000002-0000-1000-8000-00805f9b34fb)
    D	22:37:39.903	gatt.setCharacteristicNotification(0000ffe2-0000-1000-8000-00805f9b34fb, true)
    I	22:37:39.974	Connection parameters updated (interval: 50.0ms, latency: 0, timeout: 5000ms)
    D	22:37:43.888	[Callback] Connection state changed with status: 19 and new state: DISCONNECTED (0)
    W	22:37:43.888	Connection terminated by peer (status 19)
    I	22:37:43.888	Disconnected
    D	22:37:43.958	[Broadcast] Action received: android.bluetooth.device.action.ACL_DISCONNECTED
    

  • Hi Andreas,

    Which is the board that you are working on? Also, which sample are you using? 

    -Priyanka

Related