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,

    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