This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Fuse Client and Server int o one. Make the server act as a Client

Hello  ! 
Hope I can get help with this as I am completely new to this and dont get a hang of it yet. 

What I am looking for is to be able to use the servers as clients. 

I have my app as a peripheral to lets say a light with a 2 button configuration, one is for power up and one is for power down. When I have paired everything I would like to group my lights. 

The Question ! 

How can I make a light control the other lights in the same group when pushing the power buttons ? 

Like fusing the light switch client and server into one and the same. 

When I have pushed on one button I want that server act as a client and send to all other lights to mimic the command. 

I hope its understandable. 

Thanks for any clues or examples in advance

Parents
  • Hello,

    This is possible. I don't think there is an example in the SDK that does exactly this out of the box, but you should be able to modify one of the light_switch examples to be both a server and a client. In mesh, there is no difference between servers and clients. They just have different settings where the client has a model that can publish, and the server can only subscribe, but there is nothing saying that one device can't have both.

    There is a demo called the Thingy Mesh provisioning demo. You would need a couple of thingys to run this, but maybe you can use this application as inspiration.

    This example has one button, which will publish, and one LED that can be used to subscribe to the on_off model. Since the provisioner example is set up to have one client and several servers, the easiest approach would be to use the nRF Mesh app for mobile to provision the devices. There is a link to a youtube video in the link above, which shows how to do this.

    Best regards,

    Edvin

Reply
  • Hello,

    This is possible. I don't think there is an example in the SDK that does exactly this out of the box, but you should be able to modify one of the light_switch examples to be both a server and a client. In mesh, there is no difference between servers and clients. They just have different settings where the client has a model that can publish, and the server can only subscribe, but there is nothing saying that one device can't have both.

    There is a demo called the Thingy Mesh provisioning demo. You would need a couple of thingys to run this, but maybe you can use this application as inspiration.

    This example has one button, which will publish, and one LED that can be used to subscribe to the on_off model. Since the provisioner example is set up to have one client and several servers, the easiest approach would be to use the nRF Mesh app for mobile to provision the devices. There is a link to a youtube video in the link above, which shows how to do this.

    Best regards,

    Edvin

Children
No Data
Related