LoRa Mesh
1.0.0


网格网络基本上以类型学为特征,在该类型中,网络基础架构中的所有节点在它们之间直接在它们之间直接通信,而无需考虑任何层次。因此,节点彼此合作,以便有效地填写数据。我们之间缺乏依赖性使每个人都可以参与他们之间的信息传输和接收。网格网络可以通过其自我配置的能力动态组织,从而使信息流的动态分布,尤其是在其中一个结中的失败情况下。

克隆此存储库: $ git clone https://github.com/daeynasvistas/LoRa-Mesh/
使用VisualStudio代码(Platformio):
2.1。您可以在单独的项目中打开ESP32粘贴和Arduino糊。
// Este node e servidor
// 0 = Servidor internet
// 1 = Vizinho de servidor internet
// 2 = Vizinho com um Vizinho de um servidor internet
byte isServer = getIsServer();
String nodeFunction[ 4 ] = { " SINK " , " ESTRADA " , " CAMINHO " , " SOLTEIRO " }; if (msgCount> 10 )
{
message = sendTable ();
sendMessage (message, 255 ); if (msgCount> 10 )
{
message = sendTable ();
sendMessage (message, 255 );String nodeFunction[ 4 ] = { " SINK " , " ESTRADA " , " CAMINHO " , " SOLTEIRO " }; // Posicionamento dos servidores na mesh
switch (incomingMsgHand) {
case 0 :
// statements
if (! arrayIncludeElement (myServers,sender,maxTableArrayServers)){
Serial. println ( " Encontrei um SINK! " +sender);
arrayAddElement (myServers,sender,maxTableArrayServers);
display. drawString ( 0 , 32 , " NOVO: " + String (sender));
}
destination = sender;
break ;
case 1 :
// statements
if (! arrayIncludeElement (myNeighbours,sender,maxTableArrayVizinhos)){
Serial. println ( " Encontrei AUTOESTRADA para SINK! " +sender);
arrayAddElement (myNeighbours,sender,maxTableArrayVizinhos);
display. drawString ( 0 , 32 , " NOVO: " + String (sender));
}
if (isServer!= 0 ){
destination = sender;
}
break ;
case 2 :
// statements
Serial. println ( " Encontrei CAMINHO para SINK! " );
break ;
default :
// statements
break ;
} } else {
// enviar para mais próximo do SINK
destination = myNeighbours[ 0 ];
sendMessage (message, destination);
}要配置您必须更改main.cpp并包括您预测的传感器。 ESP32包括BME的磅和DHT11的Arduino
该项目使用#include pound <arduinojson.h>构建在每个节点中发送的JSON,其中包括或更改所需的json。
void makeData (){
// add some values
array. add (MAC); // <- Lora MAC
array. add ( 1556969160 ); // <-- Timestamp
array. add (bme. readTemperature ());
array. add (bme. readHumidity ());
array. add (bme. readPressure () / 100 . 0F );
array. add ( 0 );
array. add ( 0 );
array. add ( 0 );
array. add ( 0 );
array. add ( 0 );
array. add ( 0 );
// serialize the array and send the result to Serial
// serialize the array and send the result to Serial
serializeJson (doc, Values);
serializeJson (doc, Serial);
Serial. println ( " " );
}32在邻居表中最大
byte const maxTableArrayVizinhos = 32 ; // quantidade de vizinhos pode ser aumentada conform memoria dispo
byte myNeighbours[maxTableArrayVizinhos] = {}; // address of vizinhos directos
byte const maxTableArrayServers = 4 ; // quantidade de servidores ao qual tenho acesso pode ser aumentada
byte myServers[maxTableArrayServers] = {}; // address dos servidores que encontrei 这是序列上的结果。在节点接收器中,所有节点的所有传感器都会出现。节点接收器负责发送JSON ... by Lora(网关),MQTT或您喜欢的方法










