Hi all
I'm working on a network of nodes and am based in the library of Mr. TMRH20 RF24 MESH. As compared with the library MIRF and other library MANIACBUG. I think this is the best library created so far.
My project is built by more than 300 nodes and each node has (1 arduino nano, humidity sensor 1 relay and NRF24L01 +.)
Each node is separated 50 meters from the other
Now I have some small problems or bugs are perhaps the library
here is the first
To test I have connected only 2 nodes, the master node reads well,
The problem is that when I turn off one of the two radio, the teacher still continues to say that the two nodes are active
this is the terminal
******** ******** Addresses assigned*****************
NodeID 198 network address: 04
NodeID: 75 network address: 03
NODE TOTAL: 2
this is the code
displayTimer = millis();
Serial.println(" ");
Serial.println(F("********direcciones asignadas********"));
for (int i = 0; i < mesh.addrListTop; i++) {
Serial.print("NodoID: ");
Serial.print(mesh.addrList[i].nodeID);
Serial.print(" en la red su direccion es: 0");
Serial.println(mesh.addrList[i].address, OCT);
}
Serial.println(F("**********************************"));
Serial.print("TOTAL DE NODOS: ");
Serial.println(mesh.addrListTop);
this code is the RF24Mesh_Example_master_To_Nodes.ino example I only add
Serial.print("TOTAL DE NODOS: ");
Serial.println(mesh.addrListTop);
Second I want to increase the maximum number of nodes because the library is built for a maximum of 255 nodes
We see the structure of the HEADER
- .from_node .to_node .ID .Type .reserved
-
- | FROM NODE | FOR NODE | IDmsg | TYPE | RESERVED |
- | _________ | |||______|
- 16BIT 16BIT 16 BIT CHAR CHAR = 64 BIT IN HEADER
.FROM_NODE = 16bit node where the message originates
.TO_NODE = 16bit node to which the message is addressed
.ID = 16bit increases each this structure is created
.TYPE = Character (8bit) type of message to be sent
. reserved = character (8bit) ... R.E.S.E.R.V.E.D
I can not understand why only use 255 nodes if .FROM_NODE / .TO_NODE both sections are constructed of 16bit, and when they are built for 16 bit would be the maximum number of nodes nodes 65535
i modified nodeID to 16bit, because mr. tmrh20 build to 8 bit
rf24mesh.h
uint16_t addrListTop; /**< The number of entries in the assigned address list */
^
rf24mesh.cpp
bool RF24Mesh::write(const void* data, uint8_t msg_type, size_t size, uint16_t nodeID){
^
int16_t RF24Mesh::getAddress(uint16_t nodeID){
^
int16_t RF24Mesh::getNodeID(uint16_t address){
^
void RF24Mesh::setNodeID(uint16_t nodeID){
^
void RF24Mesh::setStaticAddress(uint16_t nodeID, uint16_t address){
^
void RF24Mesh::setAddress(uint16_t nodeID, uint16_t address){
^
uint16_t position = addrListTop;
^
addrList[addrListTop].nodeID = 65535
^^^^^
addrList[addrListTop].address = 05555;
^^^^^
rf24mesh.h
bool write(const void* data, uint8_t msg_type, size_t size, uint16_t nodeID=0);
^
void setNodeID(uint16_t nodeID);
^
int16_t getAddress(uint16_t nodeID);
^
void setAddress(uint16_t nodeID, uint16_t address);
^
uint16_t _nodeID;
^
uint16_t nodeID; /**< NodeIDs and addresses are stored in the addrList array using this structure */
^
void setStaticAddress(uint16_t nodeID, uint16_t address);
^
RF24Network.cpp
uint16_t digit = node & 0B111;
the truth is that the amendment does not work for me, only if I use number less that 255
3
This is a possible bug.
If I schedule multiple nodes with RF24Mesh_Example.ino program and give them all the same node number (#define nodeID 75) the system does not recognize me that several nodes with the same name.
This bug I have not worked
