From the README's Development section - filing as a tracked issue.
Current state
Peer networking (YY_MODE_PEER_SERVER/YY_MODE_PEER_CLIENT) is entirely local: startPeerNetworkAsAP() puts a device into WIFI_AP_STA and runs its own DNS/captive-portal AP (src/YoYoWiFiManager.cpp), and peers find each other by joining that local AP directly. There's no mechanism for two Yo-Yo devices on different networks (or on the wider Internet) to discover or talk to each other - the POST/GET HTTP helper methods used for peer broadcast (broadcastMessage(), etc.) assume a local IP reachable directly.
Ask
This is a bigger architectural addition rather than a small fix - worth scoping out before implementation, e.g.:
- A relay/rendezvous approach (devices register with a known server, which relays messages between them - avoids NAT traversal entirely, easiest to build)
- NAT traversal (STUN/hole-punching) for more direct device-to-device connections
- Something MQTT/WebSocket-broker-based, reusing the existing
WebSocketsServer example's dependency
Given the amount of design work involved, might be worth a short design doc/discussion issue before picking an approach, rather than diving straight into implementation.
From the README's Development section - filing as a tracked issue.
Current state
Peer networking (
YY_MODE_PEER_SERVER/YY_MODE_PEER_CLIENT) is entirely local:startPeerNetworkAsAP()puts a device intoWIFI_AP_STAand runs its own DNS/captive-portal AP (src/YoYoWiFiManager.cpp), and peers find each other by joining that local AP directly. There's no mechanism for two Yo-Yo devices on different networks (or on the wider Internet) to discover or talk to each other - thePOST/GETHTTP helper methods used for peer broadcast (broadcastMessage(), etc.) assume a local IP reachable directly.Ask
This is a bigger architectural addition rather than a small fix - worth scoping out before implementation, e.g.:
WebSocketsServerexample's dependencyGiven the amount of design work involved, might be worth a short design doc/discussion issue before picking an approach, rather than diving straight into implementation.