Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. General Discussion
  3. Disconnecting client from gateway

Disconnecting client from gateway

Scheduled Pinned Locked Moved General Discussion
12 Posts 4 Posters 2.2k Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    icmathad
    wrote on last edited by
    #1

    Hi,

    I am checking the functionality of nrf51822 device at the client side, client side I am using both mysensor.h library and BlePeripheral.h library and WaveShare ble 400 nrf51822 device. I have given condition like when a button is LOW the client should connect to the gateway device (gateway side: nrf24L01 and NODE MCU(esp8266) and GatewayEsp8266MQTTclient program).
    when a button is high the client should connect to the mobile device but during the LOW (not pressed)condition of a button it is connecting to the gateway i.e to nrf24L01 when I pressed the button means HIGH it is not advertising properly how do I make it disconnect from gateway and make it to normal advertising. please help me.

    1 Reply Last reply
    0
    • gohanG Offline
      gohanG Offline
      gohan
      Mod
      wrote on last edited by
      #2

      I don't fully understand what is the purpose of this setup... Could you please give better details.

      1 Reply Last reply
      0
      • I Offline
        I Offline
        icmathad
        wrote on last edited by
        #3

        Hi,
        In the client side am using the nRF51822 device and I am giving condition like if button state is LOW the client device should connect gateway device (nrf24L01) and then sending command ON and OFF from gateway to client to turn on the buzzer or LED. The gateway is connected to MQTT broker, if the button is HIGH it should disconnect from the gateway device and it should start advertising and it should connect to the mobile app (NRF connect app), through the mobile app I am sending command 0 and 1 to switch ON and OFF the led of client device.

        The gateway side the NRF24L01 is connected to NODE MCU(ESP8266MOD), this device is connected to MQTT broker.

        At the client side, I am using both libraries like BLEpepheral.h for advertising and connect to mobile and MySensor.h library for connecting to the gateway and communicate with the gateway device.

        The problem I am facing is when the button is HIGH whether the gateway is a disconnect or not, and it is not advertising to connect mobile app( (NRF connect app).

        1 Reply Last reply
        0
        • scalzS Offline
          scalzS Offline
          scalz
          Hardware Contributor
          wrote on last edited by
          #4

          Hello,
          If I understand what you're trying to do, you can't use softdevice (BLE mode) with MySensors (nrf24 mode). This is not compatible actually.

          1 Reply Last reply
          0
          • I Offline
            I Offline
            icmathad
            wrote on last edited by
            #5

            Hi scalz,

            can you please elaborate, why it is not compatible, please tell me.

            d00616D 1 Reply Last reply
            0
            • scalzS Offline
              scalzS Offline
              scalz
              Hardware Contributor
              wrote on last edited by scalz
              #6

              maybe you already know it, but softdevice is sort of OS, providing features like BLE etc.
              So it already uses some stuff in the nrf5x like timers, flash memory mapping for softdevice, fw, eeprom emulation etc.

              On the other side, because of softdevice license at the moment I think, the nrf5x MySensors port made by @d00616 don't use the above API, it directly uses the nrf5 hardware and is tailored for MySensors use.
              (see here for more infos https://www.openhardware.io/view/376/MySensors-NRF5-Platform and you can also see "At the current state, BLE is not supported by MySensors").

              To keep things simple, the two modes resources are conflicting.

              1 Reply Last reply
              1
              • I icmathad

                Hi scalz,

                can you please elaborate, why it is not compatible, please tell me.

                d00616D Offline
                d00616D Offline
                d00616
                Contest Winner
                wrote on last edited by
                #7

                There are two reasons missing SoftDevice support. The License at the time of starting my port of MySensors to NRF5 and I don't like to have the SoftDevice on my Nodes. I have never tested MySensors with a SoftDevice present.

                At the moment I reimplement the ESB protocol, because there is an bug in the NRF52 hardware (PAN102) which I had no luck fixing it in the current ESB implementation. The new version uses more resources like PPI and Timer and splits the code for TX, TX with ACK and RX. I hope this is better to debug and easier to understand.

                When I find some time, I do some tests if this code works with a SoftDevice present. When it works, then I remove or change the error/warning message about SoftDevice support. I have no plans to add code for dual Stack (BLE, ESB) or SoftDevice cooperation, but Pull Requests to do this are welcome.

                If someone have plans to add BLE support, please look into the SoftDevice/DFU bootloader memory map. I think the DFU bootloader conflicts with the NVM library, which is used to store the MySensors configuration.

                1 Reply Last reply
                3
                • I Offline
                  I Offline
                  icmathad
                  wrote on last edited by
                  #8

                  Is it possible to disconnect client nrf5 from the gateway nrf24L01 by pressing any predefined button?

                  1 Reply Last reply
                  0
                  • gohanG Offline
                    gohanG Offline
                    gohan
                    Mod
                    wrote on last edited by
                    #9

                    Just add some code that before sending it checks a variable, you change the variable by pressing button.

                    1 Reply Last reply
                    1
                    • I Offline
                      I Offline
                      icmathad
                      wrote on last edited by
                      #10

                      I want to disconnect the gateway nrf24L01 device from the client nrf24L01 and then client radio should be free for advertising and connecting to mobile device until the button state is low it should not try to connect to gateway nrf24L01. when the button is high the client should be disconnecting from the gateway.

                      1 Reply Last reply
                      0
                      • gohanG Offline
                        gohanG Offline
                        gohan
                        Mod
                        wrote on last edited by
                        #11

                        I can't help you here...

                        1 Reply Last reply
                        0
                        • scalzS Offline
                          scalzS Offline
                          scalz
                          Hardware Contributor
                          wrote on last edited by
                          #12

                          @icmathad
                          for the reasons previously explained, you can't do this actually; using both "api" at same time in code as softdevice is loaded in background.
                          unless you make some changes in Mysensors nrf52 port code..

                          1 Reply Last reply
                          2
                          Reply
                          • Reply as topic
                          Log in to reply
                          • Oldest to Newest
                          • Newest to Oldest
                          • Most Votes


                          14

                          Online

                          11.7k

                          Users

                          11.2k

                          Topics

                          113.1k

                          Posts


                          Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                          • Login

                          • Don't have an account? Register

                          • Login or register to search.
                          • First post
                            Last post
                          0
                          • MySensors
                          • OpenHardware.io
                          • Categories
                          • Recent
                          • Tags
                          • Popular