RF24 Master +Slaves protocol

I'm looking for someone to try the library I'm writing about a Master + Slaves communication protocol with Arduino and RF24 ...
Try to use it to understand what functions need to be integrated and how to improve it ... maybe even to collaborate on development .... :slight_smile:

Are you aware of the TMRh20 RF24 library

...R
Simple nRF24L01+ Tutorial

yes...

but that library is only to comunicate with the radio...

this use the same library for low level comunication, but build over that layer a new protocol to replicate the data of the devices over all Arduino board that are in the network....

So you can write a variable on one Arduino and automatically found the same variable on another Arduino..

in this way you can build a connected database of devices and don't worry about low level comunication

ameste:
this use the same library for low level comunication, but build over that layer a new protocol to replicate the data of the devices over all Arduino board that are in the network....

Based on your Original Post I mistakenly thought you were creating a competitor for the TMRh20 library.

Perhaps you can give more details of the functionality your system is providing.

...R

roto is a library that allows you to replicate registers (which can be variables or copies of analog / digital input / output) from an arduino to all the others that create a network using RF24

In the network an arduino carries out the task of master while all the others of slaves ... Each node has a name and an address (autoconfiguring address through the master that always listens on a fixed configuration address and configures the addresses of the new cards) .

The slaves, when they present themselves to the Master, also list all the registers configured on the slave, so that the master and the other slaves can know the new variables that will enter the network. Each register has an address, a name and other features such as the type of register.

The registers can be updated on the master and therefore on all the other slaves whenever their value changes or through a polling by the master, the updating method can be configured register by register ....

Furthermore for the output registers if written by the master towards a slave, in addition to updating the register automatically, an event is triggered (via callback) which allows the slave to update any output signals of arduino ....

the library is all in a file that is compiled both on arduino and esp32 ..

All the communication is hidden in the library so whoever found himself using this library must not send and / or receive any message through RF24 but everything will be automatic, on each arduino you will find a database of registers that will be automatically applied to the other nodes of the network ...

At the moment the whole library has yet to be tested ....

ameste:
roto is a library that allows you to replicate registers

I run into a problem straight away. In the microprocessor world "register" has a special meaning - on an Atmega 328, for example, the register EIMSK holds two bit values that determine whether the external interrupts are enabled.

I strongly suspect that is not what you mean by "register" because most Arduino programming is done at a higher level - for example with digitalWrite() and pin numbers.

Writing documentation that is understandable by someone who has not been involved in the development of a program is not simple, and it takes time. But without it there seems to me little purpose in publishing the program because users will not understand its purpose, the types of tasks it might be suitable for, or the details of how to use it.

With a simple library such as the Arduino Servo library a few examples may be sufficient to allow people to understand ow to use it. When the library is for the purpose of advanced communication proper documentation is essential. Indeed there is case for saying the documentation should be written before the code is written.

The RF24 library is well documented. Nothing you have said, so far, has convinced me that a newbie would get things working with less learning using your system rather than the raw RF24 library.

I am not trying to dissuade you from developing your project - it may indeed be very useful. But there are some hurdles still to be crossed before you reach the finish line.

...R

Register => Protocol Register.... or Variable....

a Variable can be a Float, Int8, int16, int32 or bool

I write an example of master and slave....

now during the test I will build more examples....

ameste:
Register => Protocol Register.... or Variable....

a Variable can be a Float, Int8, int16, int32 or bool

But what is a "Protocol Register" ?

...R

Sorry... but may be for the english...may be because is not so easy to explain something... I have some problem to explain how it works ....

In my library I call this variables, Devices... but I know this is another frequent used word....

here an example....

you must create some devices that can be input or output devices...like here....

Device temperature{Input,AnalogFloat,0,0,"Temp1"};
Device humidity{Input,AnalogFloat,0,0,"Hum1"};
Device level{Input,AnalogInt16,0,0,"Level1"};

this devices are not field devices connected to arduino but they replicate the values of some sensor connected to arduino or they can be some variable that you want to replicate on the all nodes of the network....

After you have create an instance of the class proto as here

Proto slave1(radio,"Slave1",10,5,false);

and you have added the devices to proto

slave1.deviceIndex.addDevice(temperature);
slave1.deviceIndex.addDevice(humidity);
slave1.deviceIndex.addDevice(level);

the proto will send the values of local devices to all node of the network ....

and the instance of proto slave1 will receive the values of all devices of all other nodes of the network ....

so you can have local and remote sensor values on the arduino board and you can command output of remote arduino boards....

I'm very conscious that my comments have sounded negative even though (or perhaps because) I don't know what your project is for. As I said earlier, I am not trying to dissuade you.

However the language in Reply #9 ("create some devices", "instance of the class proto" for example) suggests that your library is targeted at experts rather than beginners.

I find it very useful to describe (for my own benefit) the types of person I expect to be using a piece of software that I write and what background knowledge I expect them to have.

Maybe think about writing a story about a fictitious person "John" who has a project he wants to implement and in the story describe how John uses your library to create his project. Keep the project as simple as possible.

Another thought is that you might develop the project, and especially the documentation, in your native language and with help from other people who speak your language and then when you have the documentation finished get someone to help translating it into English.

...R

thank you for your insight

The repository has been updated and now the minimal functions are working...

There is also one working example ...

I have looked at your GitHub example programs and even though I am trying very hard to be positive I just don't have a clue what is intended to happen.

...R