You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to do a simple setup with 2 esp8266 to. My intention is to have its LED blinking synchronously, so time sync is needed. I've used StatHere example.
I guess there is a bug while calculating adjustment value but I've been not able to find it.
My code is this:
//************************************************************
// this is a simple example that uses the easyMesh library
//
// 1. blinks led once for every node on the mesh
// 2. blink cycle repeats every BLINK_PERIOD
// 3. sends a silly message to every node on the mesh at a random time betweew 1 and 5 seconds
// 4. prints anything it recieves to Serial.print
//
//
//************************************************************
#include <easyMesh.h>
// some gpio pin that is connected to an LED...
// on my rig, this is 5, change to the right number of your LED.
#define LED 2 // GPIO number of connected LED
#define BLINK_PERIOD 1000000 // microseconds until cycle repeat
#define BLINK_DURATION 100000 // microseconds LED is on for
#define MESH_PREFIX "whateverYouLike"
#define MESH_PASSWORD "somethingSneeky"
#define MESH_PORT 5555
easyMesh mesh;
uint32_t sendMessageTime = 0;
void setup() {
Serial.begin(115200);
pinMode( LED, OUTPUT );
//mesh.setDebugMsgTypes( ERROR | MESH_STATUS | CONNECTION | SYNC | COMMUNICATION | GENERAL | MSG_TYPES | REMOTE ); // all types on
mesh.setDebugMsgTypes( ERROR | STARTUP | SYNC ); // set before init() so that you can see startup messages
mesh.init( MESH_PREFIX, MESH_PASSWORD, MESH_PORT );
mesh.setReceiveCallback( &receivedCallback );
mesh.setNewConnectionCallback( &newConnectionCallback );
randomSeed( analogRead( A0 ) );
}
void loop() {
mesh.update();
// run the blinky
bool onFlag = true;
uint32_t cycleTime = mesh.getNodeTime() % BLINK_PERIOD;
for ( uint8_t i = 0; i < ( mesh.connectionCount() + 1); i++ ) {
uint32_t onTime = BLINK_DURATION * i * 2;
if ( cycleTime > onTime && cycleTime < onTime + BLINK_DURATION )
onFlag = false;
}
digitalWrite( LED, onFlag );
// get next random time for send message
if ( sendMessageTime == 0 ) {
sendMessageTime = mesh.getNodeTime() + random( 1000000, 5000000 );
}
// if the time is ripe, send everyone a message!
if ( sendMessageTime != 0 && sendMessageTime < mesh.getNodeTime() ){
String msg = "Hello from node ";
msg += mesh.getChipId();
mesh.sendBroadcast( msg );
sendMessageTime = 0;
}
}
void receivedCallback( uint32_t from, String &msg ) {
Serial.printf("startHere: Received from %d msg=%s\n", from, msg.c_str());
Serial.printf("Node time: %u\n", mesh.getNodeTime());
}
void newConnectionCallback( bool adopt ) {
Serial.printf("startHere: New Connection, adopt=%d\n", adopt);
}
They do time sync procedure but time is not actually syncd. Besides one of the two nodes keep asking time forever.
Here Serial output in node number 1:
setDebugTypes 0x13
0x2 init():
0x2 apInit(): Starting AP with SSID=whateverYouLike12617095 IP=192.168.135.1 GW=192.168.135.1 NM=255.255.255.0
0x2 DHCP server started
0x2 AP tcp server established on port 5555
0x2 stationInit():
0x10 startNodeSync(): with 0
0x10 handleNodeSync(): with 0
0x10 handleNodeSync(): conn->chipId updated from 0 to 1282846
0x10 handleNodeSync(): valid NODE_SYNC_REPLY from 1282846
0x10 startTimeSync(): with 1282846
0x10 buildTimeStamp(): num=0
0x10 buildTimeStamp(): timeStamp={"time":5661707,"num":0,"adopt":false}
0x10 handleTimeSync(): with 1282846 in timestamp={"time":4249843,"num":0,"adopt":false}
0x10 processTimeStamp(): str={"time":4249843,"num":0,"adopt":false}
0x10 buildTimeStamp(): num=1
0x10 buildTimeStamp(): timeStamp={"time":5706159,"num":1,"adopt":true}
0x10 handleTimeSync(): with 1282846 out timestamp={"time":5706159,"num":1,"adopt":true}
0x10 handleTimeSync(): with 1282846 in timestamp={"time":4272217,"num":1,"adopt":true}
0x10 processTimeStamp(): str={"time":4272217,"num":1,"adopt":true}
0x10 buildTimeStamp(): num=2
0x10 buildTimeStamp(): timeStamp={"time":5751075,"num":2,"adopt":false}
0x10 handleTimeSync(): with 1282846 out timestamp={"time":5751075,"num":2,"adopt":false}
0x10 handleTimeSync(): with 1282846 in timestamp={"time":4317041,"num":2,"adopt":false}
0x10 processTimeStamp(): str={"time":4317041,"num":2,"adopt":false}
0x10 buildTimeStamp(): num=3
0x10 buildTimeStamp(): timeStamp={"time":5795597,"num":3,"adopt":true}
0x10 handleTimeSync(): with 1282846 out timestamp={"time":5795597,"num":3,"adopt":true}
0x10 handleTimeSync(): with 1282846 in timestamp={"time":4361691,"num":3,"adopt":true}
0x10 processTimeStamp(): str={"time":4361691,"num":3,"adopt":true}
0x10 buildTimeStamp(): num=4
0x10 buildTimeStamp(): timeStamp={"time":5840406,"num":4,"adopt":false}
0x10 handleTimeSync(): with 1282846 out timestamp={"time":5840406,"num":4,"adopt":false}
0x10 handleTimeSync(): with 1282846 in timestamp={"time":4406378,"num":4,"adopt":false}
0x10 processTimeStamp(): str={"time":4406378,"num":4,"adopt":false}
0x10 buildTimeStamp(): num=5
0x10 buildTimeStamp(): timeStamp={"time":5885137,"num":5,"adopt":true}
0x10 handleTimeSync(): with 1282846 out timestamp={"time":5885137,"num":5,"adopt":true}
0x10 handleTimeSync(): with 1282846 in timestamp={"time":4451127,"num":5,"adopt":true}
0x10 processTimeStamp(): str={"time":4451127,"num":5,"adopt":true}
0x10 buildTimeStamp(): num=6
0x10 buildTimeStamp(): timeStamp={"time":5930394,"num":6,"adopt":false}
0x10 handleTimeSync(): with 1282846 out timestamp={"time":5930394,"num":6,"adopt":false}
0x10 handleTimeSync(): with 1282846 in timestamp={"time":4495834,"num":6,"adopt":false}
0x10 processTimeStamp(): str={"time":4495834,"num":6,"adopt":false}
0x10 buildTimeStamp(): num=7
0x10 buildTimeStamp(): timeStamp={"time":5975167,"num":7,"adopt":true}
0x10 handleTimeSync(): with 1282846 out timestamp={"time":5975167,"num":7,"adopt":true}
0x10 handleTimeSync(): with 1282846 in timestamp={"time":4541142,"num":7,"adopt":true}
0x10 processTimeStamp(): str={"time":4541142,"num":7,"adopt":true}
0x10 buildTimeStamp(): num=8
0x10 buildTimeStamp(): timeStamp={"time":6019944,"num":8,"adopt":false}
0x10 handleTimeSync(): with 1282846 out timestamp={"time":6019944,"num":8,"adopt":false}
0x10 handleTimeSync(): with 1282846 in timestamp={"time":4585875,"num":8,"adopt":false}
0x10 processTimeStamp(): str={"time":4585875,"num":8,"adopt":false}
0x10 buildTimeStamp(): num=9
0x10 buildTimeStamp(): timeStamp={"time":6064542,"num":9,"adopt":true}
0x10 handleTimeSync(): with 1282846 out timestamp={"time":6064542,"num":9,"adopt":true}
startHere: New Connection, adopt=1
0x10 handleTimeSync(): with 1282846 in timestamp={"time":4630542,"num":9,"adopt":true}
0x10 processTimeStamp(): str={"time":4630542,"num":9,"adopt":true}
0x10 handleTimeSync(): with 1282846 out timestamp={"time":4630542,"num":9,"adopt":true}
0x10 calcAdjustment(): odd=0
0x10 best interval=67198, best index=0
0x10 new calc time=4272217, adoptedTime=4272217
startHere: Received from 1282846 msg=Hello from node 1282846
Node time: 6829478
0x10 handleNodeSync(): with 1282846
0x10 handleNodeSync(): valid NODE_SYNC_REQUEST 1282846 sending NODE_SYNC_REPLY
startHere: Received from 1282846 msg=Hello from node 1282846
Node time: 10047099
0x10 handleNodeSync(): with 1282846
0x10 handleNodeSync(): valid NODE_SYNC_REQUEST 1282846 sending NODE_SYNC_REPLY
0x10 handleNodeSync(): with 1282846
0x10 handleNodeSync(): valid NODE_SYNC_REQUEST 1282846 sending NODE_SYNC_REPLY
0x10 handleNodeSync(): with 1282846
0x10 handleNodeSync(): valid NODE_SYNC_REQUEST 1282846 sending NODE_SYNC_REPLY
startHere: Received from 1282846 msg=Hello from node 1282846
Node time: 14539637
0x10 handleNodeSync(): with 0
0x10 handleNodeSync(): conn->chipId updated from 0 to 1282846
0x10 handleNodeSync(): valid NODE_SYNC_REQUEST 1282846 sending NODE_SYNC_REPLY
0x10 manageConnections(): starting timeSync with 1282846
0x10 startTimeSync(): with 1282846
0x10 buildTimeStamp(): num=0
0x10 buildTimeStamp(): timeStamp={"time":19217694,"num":0,"adopt":false}
0x10 handleTimeSync(): with 1282846 in timestamp={"time":17817582,"num":0,"adopt":false}
0x10 processTimeStamp(): str={"time":17817582,"num":0,"adopt":false}
0x10 buildTimeStamp(): num=1
0x10 buildTimeStamp(): timeStamp={"time":19240242,"num":1,"adopt":true}
0x10 handleTimeSync(): with 1282846 out timestamp={"time":19240242,"num":1,"adopt":true}
0x10 handleTimeSync(): with 1282846 in timestamp={"time":17862162,"num":1,"adopt":true}
0x10 processTimeStamp(): str={"time":17862162,"num":1,"adopt":true}
0x10 buildTimeStamp(): num=2
0x10 buildTimeStamp(): timeStamp={"time":19285246,"num":2,"adopt":false}
0x10 handleTimeSync(): with 1282846 out timestamp={"time":19285246,"num":2,"adopt":false}
0x10 handleTimeSync(): with 1282846 in timestamp={"time":17907121,"num":2,"adopt":false}
0x10 processTimeStamp(): str={"time":17907121,"num":2,"adopt":false}
0x10 buildTimeStamp(): num=3
0x10 buildTimeStamp(): timeStamp={"time":19331121,"num":3,"adopt":true}
0x10 handleTimeSync(): with 1282846 out timestamp={"time":19331121,"num":3,"adopt":true}
0x10 handleTimeSync(): with 1282846 in timestamp={"time":17953072,"num":3,"adopt":true}
0x10 processTimeStamp(): str={"time":17953072,"num":3,"adopt":true}
0x10 buildTimeStamp(): num=4
0x10 buildTimeStamp(): timeStamp={"time":19377963,"num":4,"adopt":false}
0x10 handleTimeSync(): with 1282846 out timestamp={"time":19377963,"num":4,"adopt":false}
0x10 handleTimeSync(): with 1282846 in timestamp={"time":17999819,"num":4,"adopt":false}
0x10 processTimeStamp(): str={"time":17999819,"num":4,"adopt":false}
0x10 buildTimeStamp(): num=5
0x10 buildTimeStamp(): timeStamp={"time":19423722,"num":5,"adopt":true}
0x10 handleTimeSync(): with 1282846 out timestamp={"time":19423722,"num":5,"adopt":true}
0x10 handleTimeSync(): with 1282846 in timestamp={"time":18045709,"num":5,"adopt":true}
0x10 processTimeStamp(): str={"time":18045709,"num":5,"adopt":true}
0x10 buildTimeStamp(): num=6
0x10 buildTimeStamp(): timeStamp={"time":19468829,"num":6,"adopt":false}
0x10 handleTimeSync(): with 1282846 out timestamp={"time":19468829,"num":6,"adopt":false}
0x10 handleTimeSync(): with 1282846 in timestamp={"time":18091268,"num":6,"adopt":false}
0x10 processTimeStamp(): str={"time":18091268,"num":6,"adopt":false}
0x10 buildTimeStamp(): num=7
0x10 buildTimeStamp(): timeStamp={"time":19515793,"num":7,"adopt":true}
0x10 handleTimeSync(): with 1282846 out timestamp={"time":19515793,"num":7,"adopt":true}
0x10 handleTimeSync(): with 1282846 in timestamp={"time":18137766,"num":7,"adopt":true}
0x10 processTimeStamp(): str={"time":18137766,"num":7,"adopt":true}
0x10 buildTimeStamp(): num=8
0x10 buildTimeStamp(): timeStamp={"time":19560866,"num":8,"adopt":false}
0x10 handleTimeSync(): with 1282846 out timestamp={"time":19560866,"num":8,"adopt":false}
0x10 handleTimeSync(): with 1282846 in timestamp={"time":18182683,"num":8,"adopt":false}
0x10 processTimeStamp(): str={"time":18182683,"num":8,"adopt":false}
0x10 buildTimeStamp(): num=9
0x10 buildTimeStamp(): timeStamp={"time":19606042,"num":9,"adopt":true}
0x10 handleTimeSync(): with 1282846 out timestamp={"time":19606042,"num":9,"adopt":true}
startHere: New Connection, adopt=1
0x10 handleTimeSync(): with 1282846 in timestamp={"time":18227919,"num":9,"adopt":true}
0x10 processTimeStamp(): str={"time":18227919,"num":9,"adopt":true}
0x10 handleTimeSync(): with 1282846 out timestamp={"time":18227919,"num":9,"adopt":true}
0x10 calcAdjustment(): odd=0
0x10 best interval=89539, best index=0
0x10 new calc time=17862162, adoptedTime=17862162
startHere: Received from 1282846 msg=Hello from node 1282846
Node time: 20947325
0x10 handleNodeSync(): with 1282846
0x10 handleNodeSync(): valid NODE_SYNC_REQUEST 1282846 sending NODE_SYNC_REPLY
startHere: Received from 1282846 msg=Hello from node 1282846
Node time: 22835867
0x10 manageConnections(): start nodeSync with 1282846
0x10 startNodeSync(): with 1282846
0x10 handleNodeSync(): with 1282846
0x10 handleNodeSync(): valid NODE_SYNC_REPLY from 1282846
0x10 manageConnections(): start nodeSync with 1282846
0x10 startNodeSync(): with 1282846
0x10 handleNodeSync(): with 1282846
0x10 handleNodeSync(): valid NODE_SYNC_REPLY from 1282846
0x10 manageConnections(): start nodeSync with 1282846
0x10 startNodeSync(): with 1282846
startHere: Received from 1282846 msg=Hello from node 1282846
Node time: 28343599
startHere: Received from 1282846 msg=Hello from node 1282846
Node time: 28456673
0x10 handleNodeSync(): with 1282846
0x10 handleNodeSync(): valid NODE_SYNC_REPLY from 1282846
0x10 manageConnections(): start nodeSync with 1282846
0x10 startNodeSync(): with 1282846
Same for node 2:
setDebugTypes 0x13
0x2 init():
0x2 apInit(): Starting AP with SSID=whateverYouLike1282846 IP=192.168.30.1 GW=192.168.30.1 NM=255.255.255.0
0x2 DHCP server started
0x2 AP tcp server established on port 5555
0x2 stationInit():
0x10 handleNodeSync(): with 0
0x10 handleNodeSync(): conn->chipId updated from 0 to 12617095
0x10 handleNodeSync(): valid NODE_SYNC_REQUEST 12617095 sending NODE_SYNC_REPLY
0x10 manageConnections(): starting timeSync with 12617095
0x10 startTimeSync(): with 12617095
0x10 buildTimeStamp(): num=0
0x10 buildTimeStamp(): timeStamp={"time":4249843,"num":0,"adopt":false}
0x10 handleTimeSync(): with 12617095 in timestamp={"time":5661707,"num":0,"adopt":false}
0x10 processTimeStamp(): str={"time":5661707,"num":0,"adopt":false}
0x10 buildTimeStamp(): num=1
0x10 buildTimeStamp(): timeStamp={"time":4272217,"num":1,"adopt":true}
0x10 handleTimeSync(): with 12617095 out timestamp={"time":4272217,"num":1,"adopt":true}
0x10 handleTimeSync(): with 12617095 in timestamp={"time":5706159,"num":1,"adopt":true}
0x10 processTimeStamp(): str={"time":5706159,"num":1,"adopt":true}
0x10 buildTimeStamp(): num=2
0x10 buildTimeStamp(): timeStamp={"time":4317041,"num":2,"adopt":false}
0x10 handleTimeSync(): with 12617095 out timestamp={"time":4317041,"num":2,"adopt":false}
0x10 handleTimeSync(): with 12617095 in timestamp={"time":5751075,"num":2,"adopt":false}
0x10 processTimeStamp(): str={"time":5751075,"num":2,"adopt":false}
0x10 buildTimeStamp(): num=3
0x10 buildTimeStamp(): timeStamp={"time":4361691,"num":3,"adopt":true}
0x10 handleTimeSync(): with 12617095 out timestamp={"time":4361691,"num":3,"adopt":true}
0x10 handleTimeSync(): with 12617095 in timestamp={"time":5795597,"num":3,"adopt":true}
0x10 processTimeStamp(): str={"time":5795597,"num":3,"adopt":true}
0x10 buildTimeStamp(): num=4
0x10 buildTimeStamp(): timeStamp={"time":4406378,"num":4,"adopt":false}
0x10 handleTimeSync(): with 12617095 out timestamp={"time":4406378,"num":4,"adopt":false}
0x10 handleTimeSync(): with 12617095 in timestamp={"time":5840406,"num":4,"adopt":false}
0x10 processTimeStamp(): str={"time":5840406,"num":4,"adopt":false}
0x10 buildTimeStamp(): num=5
0x10 buildTimeStamp(): timeStamp={"time":4451127,"num":5,"adopt":true}
0x10 handleTimeSync(): with 12617095 out timestamp={"time":4451127,"num":5,"adopt":true}
0x10 handleTimeSync(): with 12617095 in timestamp={"time":5885137,"num":5,"adopt":true}
0x10 processTimeStamp(): str={"time":5885137,"num":5,"adopt":true}
0x10 buildTimeStamp(): num=6
0x10 buildTimeStamp(): timeStamp={"time":4495834,"num":6,"adopt":false}
0x10 handleTimeSync(): with 12617095 out timestamp={"time":4495834,"num":6,"adopt":false}
0x10 handleTimeSync(): with 12617095 in timestamp={"time":5930394,"num":6,"adopt":false}
0x10 processTimeStamp(): str={"time":5930394,"num":6,"adopt":false}
0x10 buildTimeStamp(): num=7
0x10 buildTimeStamp(): timeStamp={"time":4541142,"num":7,"adopt":true}
0x10 handleTimeSync(): with 12617095 out timestamp={"time":4541142,"num":7,"adopt":true}
0x10 handleTimeSync(): with 12617095 in timestamp={"time":5975167,"num":7,"adopt":true}
0x10 processTimeStamp(): str={"time":5975167,"num":7,"adopt":true}
0x10 buildTimeStamp(): num=8
0x10 buildTimeStamp(): timeStamp={"time":4585875,"num":8,"adopt":false}
0x10 handleTimeSync(): with 12617095 out timestamp={"time":4585875,"num":8,"adopt":false}
0x10 handleTimeSync(): with 12617095 in timestamp={"time":6019944,"num":8,"adopt":false}
0x10 processTimeStamp(): str={"time":6019944,"num":8,"adopt":false}
0x10 buildTimeStamp(): num=9
0x10 buildTimeStamp(): timeStamp={"time":4630542,"num":9,"adopt":true}
0x10 handleTimeSync(): with 12617095 out timestamp={"time":4630542,"num":9,"adopt":true}
startHere: New Connection, adopt=1
0x10 handleTimeSync(): with 12617095 in timestamp={"time":6064542,"num":9,"adopt":true}
0x10 processTimeStamp(): str={"time":6064542,"num":9,"adopt":true}
0x10 handleTimeSync(): with 12617095 out timestamp={"time":6064542,"num":9,"adopt":true}
0x10 calcAdjustment(): odd=0
0x10 best interval=89331, best index=2
0x10 new calc time=5795597, adoptedTime=5795597
startHere: Received from 12617095 msg=Hello from node 12617095
Node time: 5627037
0x10 manageConnections(): start nodeSync with 12617095
0x10 startNodeSync(): with 12617095
0x10 handleNodeSync(): with 12617095
0x10 handleNodeSync(): valid NODE_SYNC_REPLY from 12617095
startHere: Received from 12617095 msg=Hello from node 12617095
Node time: 8071057
0x10 manageConnections(): start nodeSync with 12617095
0x10 startNodeSync(): with 12617095
0x10 handleNodeSync(): with 12617095
0x10 handleNodeSync(): valid NODE_SYNC_REPLY from 12617095
startHere: Received from 12617095 msg=Hello from node 12617095
Node time: 9863930
0x10 manageConnections(): start nodeSync with 12617095
0x10 startNodeSync(): with 12617095
0x10 handleNodeSync(): with 12617095
0x10 handleNodeSync(): valid NODE_SYNC_REPLY from 12617095
0x10 manageConnections(): start nodeSync with 12617095
0x10 startNodeSync(): with 12617095
0x10 startNodeSync(): with 0
0x10 handleNodeSync(): with 0
0x10 handleNodeSync(): conn->chipId updated from 0 to 12617095
0x10 handleNodeSync(): valid NODE_SYNC_REPLY from 12617095
0x10 startTimeSync(): with 12617095
0x10 buildTimeStamp(): num=0
0x10 buildTimeStamp(): timeStamp={"time":17817582,"num":0,"adopt":false}
0x10 handleTimeSync(): with 12617095 in timestamp={"time":19217694,"num":0,"adopt":false}
0x10 processTimeStamp(): str={"time":19217694,"num":0,"adopt":false}
0x10 buildTimeStamp(): num=1
0x10 buildTimeStamp(): timeStamp={"time":17862162,"num":1,"adopt":true}
0x10 handleTimeSync(): with 12617095 out timestamp={"time":17862162,"num":1,"adopt":true}
0x10 handleTimeSync(): with 12617095 in timestamp={"time":19240242,"num":1,"adopt":true}
0x10 processTimeStamp(): str={"time":19240242,"num":1,"adopt":true}
0x10 buildTimeStamp(): num=2
0x10 buildTimeStamp(): timeStamp={"time":17907121,"num":2,"adopt":false}
0x10 handleTimeSync(): with 12617095 out timestamp={"time":17907121,"num":2,"adopt":false}
0x10 handleTimeSync(): with 12617095 in timestamp={"time":19285246,"num":2,"adopt":false}
0x10 processTimeStamp(): str={"time":19285246,"num":2,"adopt":false}
0x10 buildTimeStamp(): num=3
0x10 buildTimeStamp(): timeStamp={"time":17953072,"num":3,"adopt":true}
0x10 handleTimeSync(): with 12617095 out timestamp={"time":17953072,"num":3,"adopt":true}
0x10 handleTimeSync(): with 12617095 in timestamp={"time":19331121,"num":3,"adopt":true}
0x10 processTimeStamp(): str={"time":19331121,"num":3,"adopt":true}
0x10 buildTimeStamp(): num=4
0x10 buildTimeStamp(): timeStamp={"time":17999819,"num":4,"adopt":false}
0x10 handleTimeSync(): with 12617095 out timestamp={"time":17999819,"num":4,"adopt":false}
0x10 handleTimeSync(): with 12617095 in timestamp={"time":19377963,"num":4,"adopt":false}
0x10 processTimeStamp(): str={"time":19377963,"num":4,"adopt":false}
0x10 buildTimeStamp(): num=5
0x10 buildTimeStamp(): timeStamp={"time":18045709,"num":5,"adopt":true}
0x10 handleTimeSync(): with 12617095 out timestamp={"time":18045709,"num":5,"adopt":true}
0x10 handleTimeSync(): with 12617095 in timestamp={"time":19423722,"num":5,"adopt":true}
0x10 processTimeStamp(): str={"time":19423722,"num":5,"adopt":true}
0x10 buildTimeStamp(): num=6
0x10 buildTimeStamp(): timeStamp={"time":18091268,"num":6,"adopt":false}
0x10 handleTimeSync(): with 12617095 out timestamp={"time":18091268,"num":6,"adopt":false}
0x10 handleTimeSync(): with 12617095 in timestamp={"time":19468829,"num":6,"adopt":false}
0x10 processTimeStamp(): str={"time":19468829,"num":6,"adopt":false}
0x10 buildTimeStamp(): num=7
0x10 buildTimeStamp(): timeStamp={"time":18137766,"num":7,"adopt":true}
0x10 handleTimeSync(): with 12617095 out timestamp={"time":18137766,"num":7,"adopt":true}
0x10 handleTimeSync(): with 12617095 in timestamp={"time":19515793,"num":7,"adopt":true}
0x10 processTimeStamp(): str={"time":19515793,"num":7,"adopt":true}
0x10 buildTimeStamp(): num=8
0x10 buildTimeStamp(): timeStamp={"time":18182683,"num":8,"adopt":false}
0x10 handleTimeSync(): with 12617095 out timestamp={"time":18182683,"num":8,"adopt":false}
0x10 handleTimeSync(): with 12617095 in timestamp={"time":19560866,"num":8,"adopt":false}
0x10 processTimeStamp(): str={"time":19560866,"num":8,"adopt":false}
0x10 buildTimeStamp(): num=9
0x10 buildTimeStamp(): timeStamp={"time":18227919,"num":9,"adopt":true}
0x10 handleTimeSync(): with 12617095 out timestamp={"time":18227919,"num":9,"adopt":true}
startHere: New Connection, adopt=1
0x10 handleTimeSync(): with 12617095 in timestamp={"time":19606042,"num":9,"adopt":true}
0x10 processTimeStamp(): str={"time":19606042,"num":9,"adopt":true}
0x10 handleTimeSync(): with 12617095 out timestamp={"time":19606042,"num":9,"adopt":true}
0x10 calcAdjustment(): odd=0
0x10 best interval=67552, best index=0
0x10 new calc time=19240242, adoptedTime=19240242
0x10 manageConnections(): start nodeSync with 12617095
0x10 startNodeSync(): with 12617095
0x10 handleNodeSync(): with 12617095
0x10 handleNodeSync(): valid NODE_SYNC_REPLY from 12617095
startHere: Received from 12617095 msg=Hello from node 12617095
Node time: 21951040
0x10 handleNodeSync(): with 12617095
0x10 handleNodeSync(): valid NODE_SYNC_REQUEST 12617095 sending NODE_SYNC_REPLY
0x10 handleNodeSync(): with 12617095
0x10 handleNodeSync(): valid NODE_SYNC_REQUEST 12617095 sending NODE_SYNC_REPLY
startHere: Received from 12617095 msg=Hello from node 12617095
Node time: 25705848
0x10 handleNodeSync(): with 12617095
0x10 handleNodeSync(): valid NODE_SYNC_REQUEST 12617095 sending NODE_SYNC_REPLY
The text was updated successfully, but these errors were encountered:
I have exactly the same behaviour and NodeTimes are not in sync while that.
I am also using this with a slowly blinking LED and the NodeTimes differ ~1 second.
I'm trying to do a simple setup with 2 esp8266 to. My intention is to have its LED blinking synchronously, so time sync is needed. I've used StatHere example.
I guess there is a bug while calculating adjustment value but I've been not able to find it.
My code is this:
They do time sync procedure but time is not actually syncd. Besides one of the two nodes keep asking time forever.
Here Serial output in node number 1:
Same for node 2:
The text was updated successfully, but these errors were encountered: