Trying to send a OSC message over WIFI

Hi, i'm trying to send an OSC message to my PC over WiFi with my MKR1000, but i'm kinda stuck. I can ping my device but that's about the only way i can see any traffic. This is my code:

#include <WiFi101.h>
#include <WiFiUdp.h>
#include <OSCBundle.h>


// Wi-Fi settings
char ssid[] = "xxxx";
char password[] = "xxxx";

// IP address of the computer running the OSC receiver
IPAddress destinationIP(192, 168, 8, 213);
const unsigned int destinationPort = 3250;  // OSC receiver port

// Create a UDP instance for sending OSC messages
WiFiUDP Udp;

void setup() {
  // Initialize serial communication for debugging
  Serial.begin(9600);

  // Connect to Wi-Fi network
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }
  Serial.println("Connected to Wi-Fi");

  // Print the local IP address
  IPAddress localIP = WiFi.localIP();
  Serial.print("Local IP: ");
  Serial.println(localIP);
}

void loop() {
  // Create an OSC bundle
  OSCBundle bundle;

  // Add OSC messages to the bundle
  int valueOSC = 1;  // Read an analog sensor
  bundle.add("/control/t1/play").add(valueOSC);

  // Send the OSC bundle
  Udp.beginPacket(destinationIP, destinationPort);
  bundle.send(Udp);  // Send the bundle over UDP
  Udp.endPacket();

  Serial.print("Sent OSC message: ");


  // Wait for a while before sending the next message
  delay(1000);
}

Do you have Wireshark (or similar) to see what's actually happening on the network?

Do you mean ping the MKR1000 from the PC, or vice versa?

Do you have to create a client first to open the port for sending?

I can ping the Arduino from my pc, but that's about the only traffic i see from it in Wireshark. I tried tracking anything being sent from the Arduino's IP but only the pings appear.

I don't think that's the problem, as it's a WiFi connection. Ethernet is only for cabled connections, right?

I'm more referencing the client aspect of it. I haven't worked with the wifi or UDP protocol much so I don't know if you need to start a client first that will send those UDP packets.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.