Devices not joining the mesh

150 views
Skip to first unread message

Satish Bhandare

unread,
Dec 4, 2023, 7:25:54 AM12/4/23
to painlessmesh-user
Hi,
I have 2 esp32 nodes connected on painless mesh network.  The program loaded is basic in both the nodes.  The ssid, password and port are same for both the nodes.  

The following msg on serial port is detected 
COMMUNICATION: sendBroadcast(): msg=Hello from node 2 4023223593  COMMUNICATION: sendBroadcast(): msg=Hello from node 2 4023223593             
COMMUNICATION: sendBroadcast(): msg=Hello from node 2 4023223593    
COMMUNICATION: sendBroadcast(): msg=Hello from node 2 4023223593           
COMMUNICATION: sendBroadcast(): msg=Hello from node 2 4023223593           
CONNECTION: stationScan(): SCB                                               
CONNECTION: eventScanDoneHandler: ARDUINO_EVENT_WIFI_SCAN_DONE                
CONNECTION: scanComplete(): Scan finished                                
CONNECTION: scanComplete():-- > Cleared old APs.
CONNECTION: scanComplete(): num = 1
CONNECTION:    Found 0 nodes                   
CONNECTION: connectToAP(): No unknown nodes found scan rate set to normal
COMMUNICATION: sendBroadcast(): 

Similarly, I get the same msg for the second node.  
But the nodes are not detecting each other.

can anyone please help me...  Thanks in advance.

here is the program I have loaded
/************************************************************
// this is a simple example that uses the painlessMesh library
//
// 1. sends a silly message to every node on the mesh at a random time between 1 and 5 seconds
// 2. prints anything it receives to Serial.print
//
//
//************************************************************
#include "painlessMesh.h"

#define   MESH_PREFIX     "SCB"
#define   MESH_PASSWORD   "SCB5555"
#define   MESH_PORT       5555

Scheduler userScheduler; // to control your personal task
painlessMesh  mesh;

// User stub
void sendMessage() ; // Prototype so PlatformIO doesn't complain

Task taskSendMessage( TASK_SECOND * 1 , TASK_FOREVER, &sendMessage );

void sendMessage() {
  String msg = "Hello from node 1 ";
  msg += mesh.getNodeId();
  mesh.sendBroadcast( msg );
  taskSendMessage.setInterval( random( TASK_SECOND * 1, TASK_SECOND * 5 ));
}

// Needed for painless library
void receivedCallback( uint32_t from, String &msg ) {
  Serial.printf("startHere: Received from %u msg=%s\n", from, msg.c_str());
}

void newConnectionCallback(uint32_t nodeId) {
    Serial.printf("--> startHere: New Connection, nodeId = %u\n", nodeId);
}

void changedConnectionCallback() {
  Serial.printf("Changed connections\n");
}

void nodeTimeAdjustedCallback(int32_t offset) {
    Serial.printf("Adjusted time %u. Offset = %d\n", mesh.getNodeTime(),offset);
}

void setup() {
  Serial.begin(115200);

mesh.setDebugMsgTypes( ERROR | MESH_STATUS | CONNECTION | SYNC | COMMUNICATION | GENERAL | MSG_TYPES | REMOTE ); // all types on
//  mesh.setDebugMsgTypes( ERROR | STARTUP );  // set before init() so that you can see startup messages

  mesh.init( MESH_PREFIX, MESH_PASSWORD, &userScheduler, MESH_PORT );
  mesh.onReceive(&receivedCallback);
  mesh.onNewConnection(&newConnectionCallback);
  mesh.onChangedConnections(&changedConnectionCallback);
  mesh.onNodeTimeAdjusted(&nodeTimeAdjustedCallback);

  userScheduler.addTask( taskSendMessage );
  taskSendMessage.enable();
}

void loop() {
  // it will run the user scheduler as well
  mesh.update();
}
17:34:41.510 -> CONNECTION: connectToAP(): No unknown nodes found scan rate set to normal
17:34:41.948 -> COMMUNICATION: sendBroadcast(): msg=Hello from node 1 2989872965
17:34:44.511 -> COMMUNICATION: sendBroadcast(): msg=Hello from node 1 2989872965
17:34:48.655 -> COMMUNICATION: sendBroadcast(): msg=Hello from node 1 2989872965
17:34:53.103 -> COMMUNICATION: sendBroadcast(): msg=Hello from node 1 2989872965
17:34:54.436 -> COMMUNICATION: sendBroadcast(): msg=Hello from node 1 2989872965
17:34:56.509 -> CONNECTION: stationScan(): SCB
17:34:56.605 -> CONNECTION: eventScanDoneHandler: ARDUINO_EVENT_WIFI_SCAN_DONE
17:34:56.605 -> CONNECTION: scanComplete(): Scan finished
17:34:56.605 -> CONNECTION: scanComplete():-- > Cleared old APs.
17:34:56.605 -> CONNECTION: scanComplete(): num = 1
17:34:56.605 -> CONNECTION: Found 0 nodes
17:34:41.510 -> CONNECTION: connectToAP(): No unknown nodes found scan rate set to normal
17:34:41.948 -> COMMUNICATION: sendBroadcast(): msg=Hello from node 1 2989872965
17:34:44.511 -> COMMUNICATION: sendBroadcast(): msg=Hello from node 1 2989872965
17:34:48.655 -> COMMUNICATION: sendBroadcast(): msg=Hello from node 1 2989872965
17:34:53.103 -> COMMUNICATION: sendBroadcast(): msg=Hello from node 1 2989872965
17:34:54.436 -> COMMUNICATION: sendBroadcast(): msg=Hello from node 1 2989872965
17:34:56.509 -> CONNECTION: stationScan(): SCB
17:34:56.605 -> CONNECTION: eventScanDoneHandler: ARDUINO_EVENT_WIFI_SCAN_DONE
17:34:56.605 -> CONNECTION: scanComplete(): Scan finished
17:34:56.605 -> CONNECTION: scanComplete():-- > Cleared old APs.
17:34:56.605 -> CONNECTION: scanComplete(): num = 1
17:34:56.605 -> CONNECTION: Found 0 nodes
Reply all
Reply to author
Forward
0 new messages