This directory contains a modified version of the official WiFi Telemetrix sketch that adds automatic IP address broadcasting for network discovery.
This sketch extends the standard WiFi_Telemetrix4UnoR4WiFi example with:
- UDP broadcast functionality that periodically announces the Arduino's IP address
- Automatic discovery by BrightOS without manual IP configuration
- Multicast support for better network compatibility
WiFi_Telemetrix4UnoR4WiFi_AutoDiscovery.ino- Main Arduino sketch with auto-discoveryarduino_secrets.h- WiFi credentials (you need to fill this in)
In Arduino IDE:
- Go to Sketch → Include Library → Manage Libraries
- Search for "Telemetrix4UnoR4"
- Click Install
-
Copy
arduino_secrets.h.templatetoarduino_secrets.h:# In the arduino directory cp arduino_secrets.h.template arduino_secrets.h -
Edit
arduino_secrets.hand replace with your WiFi network details:
#define SECRET_SSID "YOUR_WIFI_NETWORK_NAME"
#define SECRET_PASS "YOUR_WIFI_PASSWORD"- Connect your Arduino Uno R4 WiFi board
- Open
WiFi_Telemetrix4UnoR4WiFi_AutoDiscovery.inoin Arduino IDE - Select your board: Tools → Board → Arduino Uno R4 WiFi
- Select your port: Tools → Port → (select your Arduino)
- Click Upload
Open Serial Monitor (115200 baud) and you should see:
Starting WiFi Telemetrix with Auto-Discovery...
Connecting to WiFi network: YourNetworkName
WiFi connected successfully!
========================================
SSID: YourNetworkName
IP Address: 192.168.1.xxx
Signal strength (RSSI): -45 dBm
========================================
Setup complete!
Broadcasting IP address for auto-discovery...
The Arduino broadcasts its IP address every 5 seconds using UDP:
- Broadcast IP: 255.255.255.255
- Multicast IP: 239.255.255.250
- Port: 48879
- Message format:
BRIGHTOS_ARDUINO:192.168.1.xxx
BrightOS listens on port 48879 for these broadcasts and automatically connects when an Arduino is discovered.
Arduino doesn't connect to WiFi:
- Double-check your WiFi credentials in
arduino_secrets.h - Make sure your network uses 2.4GHz (Arduino Uno R4 WiFi doesn't support 5GHz)
- Check if your network has client isolation disabled
BrightOS doesn't discover Arduino:
- Make sure both devices are on the same network
- Check if your router allows UDP broadcasts (some routers block this)
- Verify the Arduino is running (check Serial Monitor)
- Try setting the IP manually using the environment variable:
export ARDUINO_IP_ADDRESS=192.168.1.xxx
Connection is unstable:
- Move Arduino closer to your WiFi router
- Check signal strength in Serial Monitor (should be above -70 dBm)
- Ensure your computer's firewall allows UDP traffic on port 48879
| Feature | Standard WiFi Sketch | Auto-Discovery Sketch |
|---|---|---|
| Telemetrix protocol | ✅ Yes | ✅ Yes |
| WiFi connectivity | ✅ Yes | ✅ Yes |
| IP broadcast | ❌ No | ✅ Yes |
| Auto-discovery | ❌ No | ✅ Yes |
| Manual IP config | ✅ Required |
- Arduino and computer must be on the same local network
- Router must allow UDP broadcasts (most home routers do)
- No client isolation enabled
- Firewall must allow UDP port 48879
This sketch broadcasts the Arduino's IP address on your local network. This is generally safe for home networks, but be aware that any device on the same network can see the broadcast. For sensitive environments, use the manual IP configuration method instead.