0

UDP local port 2390 在Apple Airport Extreme/Express 的WiFi hotspot 不允許直接開2390的洞, 因為Apple OSX 有自訂的Time server NTP port 123

https://support.apple.com/zh-tw/HT202944

論壇上有討論開洞的方法

https://discussions.apple.com/docs/DOC-3414

 

 

在Example: AmebaDS1307RTC-SetTimeNtp裡

// NTP Servers:
IPAddress timeServer(132, 163, 4, 101); // time-a.timefreq.bldrdoc.gov
// IPAddress timeServer(132, 163, 4, 102); // time-b.timefreq.bldrdoc.gov
// IPAddress timeServer(132, 163, 4, 103); // time-c.timefreq.bldrdoc.gov

const int timeZone = 8; // Beijing Time, Taipei Time
//const int timeZone = 1; // Central European Time
//const int timeZone = -5; // Eastern Standard Time (USA)
//const int timeZone = -4; // Eastern Daylight Time (USA)
//const int timeZone = -8; // Pacific Standard Time (USA)
//const int timeZone = -7; // Pacific Daylight Time (USA)

// A UDP instance to let us send and receive packets over UDP
WiFiUDP Udp;
unsigned int localPort = 2390; // local port to listen for UDP packets

sean 回答了