I've created my own custom model which allows a client to control the duty cycle of a couple PWM outputs which are on the server. My model is quite simple, it just consists of a few opcodes which send the channel status and the channel duty cycle to the server, and the ability to retrieve the status of the channels from the server.
There is only 1 client and 1 server, but I need to provision them. I tried using the Simple OnOff provisioner, but it won't work. It attempts to connect to my client with my custom model but fails. I notice in the source in files like node_setup.c, there are references to the Simple OnOff model all over the place.
Is there a template somewhere for creating a barebones provisioner to provision a single client and server without anything extra?
I looked at https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.meshsdk.v0.9.2%2Fmd_doc_getting_started_how_to_models.html&cp=4_1_0_3_6 but it there are just mentions to single functions without any code.
Is there somewhere I can look to for creating a custom provisioner?
What I have done is to replace all the VENDOR_ID and MODEL_ID references in the node_setup.c with my own, and then the provisioner works fine with my custom model.
Although I did need to make a modification to the client setup where it assigned the publication addresses to match the servers.
supershirobon Did this approach work for you? I do not believe we have a barebones provisioner available unfortunately. All of the documentation for the mesh sdk is located in our Infocenter.
Hi, thanks for responding. I replaced all those references with my own and now I am able to provision the client, but what exactly do you mean by modifying the client setup where it assigned the publication address? Which function(s) are you referring to?
There are these
NODE_SETUP_CONFIG_PUBLICATION_MYMODEL_CLIENTn steps, there is a call to
client_pub_state_set(&pubstate, element_addr, pub_addr);
I had to adjust the pub_addr to make communication to servers other then the first work. Here I needed to increase the pub_addr with 5 for each server