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或您喜歡的方法










