LoRa Mesh
1.0.0


메쉬 네트워크는 본질적으로 네트워크 인프라의 모든 노드가 계층 적으로 고려하지 않고 동적으로 직접 통신하는 유형학을 특징으로합니다. 따라서 노드는 데이터를 효율적으로 라우팅하기 위해 서로 협력합니다. 우리 사이의 의존성 부족은 각 사람이 그들 사이의 정보의 전송 및 수신에 참여할 수있게합니다. 메쉬 네트워크는 자체 구성 능력을 통해 동적으로 구성 될 수있어 정보 흐름의 동적 배포, 특히 이러한 매듭 중 하나에서 실패 상황에서 동적입니다.

이 저장소 복제 : $ git clone https://github.com/daeynasvistas/LoRa-Mesh/
VisualStudio Code (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을 빌드하고 원하는 것을 포함하거나 변경합니다.
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 이것은 모든 노드의 모든 센서가 오는 노드 싱크에서 Serial.print의 결과입니다. 노드 싱크대는 JSON을 보내는 책임이 있습니다.










