Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No LED sync #3

Open
Magdenen opened this issue Jun 6, 2024 · 1 comment
Open

No LED sync #3

Magdenen opened this issue Jun 6, 2024 · 1 comment

Comments

@Magdenen
Copy link

Magdenen commented Jun 6, 2024

Good afternoon. I have 3 esp8266 modules. I write an example of Blink1588 in them, but I don’t get synchronization with the LED. All modules are connected correctly and are assigned an IP. In Serial I see "PTP status: UNLOCKED Master no, Candidate no". I tried a phone, an ESP module, a router, a laptop as an access point. What could be wrong?
image

@Joss59
Copy link

Joss59 commented Jan 18, 2025

Hello,
I have the same problem here (2 x eps32-S3). I checked that udp multicast works between the 2 esp32 : test is OK (test code below).
I set the debugger flags in PTP.h. See below. Did I miss something ? Thanks !

Blink1588 output :
WiFi connected
IP address:
192.168.150.60
Joined multicast group 224.0.1.129
PTP status: UNLOCKED Master no, Candidate no
Master : ID 00 00 00 00 00 00 00 00 Prio 255 1-step
Candidate: ID 00 00 00 00 00 00 00 00 Prio 255 1-step

SyncMgr is not receiving packets.
SyncMgr is not receiving packets.
PTP status: UNLOCKED Master no, Candidate no
Master : ID 00 00 00 00 00 00 00 00 Prio 255 1-step
Candidate: ID 00 00 00 00 00 00 00 00 Prio 255 1-step
etc ...

Test code :
#include "WiFi.h"
#include "WiFiUdp.h"

#define SENDER
//#define RECEIVER

const char * ssid = "xxxx";
const char * password = "xxxxxx";

WiFiUDP udp;
IPAddress multicastIP=IPAddress(224,0,1,129);
const uint16_t multicastPort = 12345;

void setup() {
Serial.begin(115200);
WiFi.begin(ssid, password);

while (WiFi.status() != WL_CONNECTED) {
delay(1000);
Serial.println("WiFi connection...");
}

Serial.println("WiFi connected");
#ifdef RECEIVER
// join multicast
if (udp.beginMulticast(multicastIP, multicastPort)) {
Serial.println("Join multicast group");
}
#endif
}

void loop() {
#ifdef SENDER
String message = "Hello from Sender!";
udp.beginPacket(multicastIP, multicastPort);
udp.print(message);
udp.endPacket();

Serial.println("Sent message: " + message);
delay(2000);
#endif

#ifdef RECEIVER
int packetSize = udp.parsePacket();
if (packetSize) {
char incomingPacket[255];
int len = udp.read(incomingPacket, 255);
if (len > 0) {
incomingPacket[len] = 0;
}
Serial.printf("Message received: %s\n", incomingPacket);
}
#endif
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants