How would you send data from an Nano 33 IoT to a computer?

Hey guys thanks again for the all your help and suggestions.

Sorry for not being specific in what I want to achieve. What I want is to connect two IMU sensors to the 33 IoT (or maybe even use the built-in one), that will be worn on a dancer/performer on each hand, and the performers will control music and visuals with their movement. The idea here is to connect both computer and Arduino boards to same WiFi network. Would this work with OSC over UDP?

@Idahowalker somebody else suggested me to work with MQTT, but thought it was an overkill for my application, but I might be wrong and could work better. I need to dig deeper on it.

In the meantime I have been trying to get some data with OSC using the UDP protocol. I have mixed and joined some examples from the WifiNINA and OSC libraries to connect to WPA Network, and to actually send the data wirelessly to TouchDesigner on the computer. I managed to get OSC messages over to TouchDesigner when the 33 IoT board was connected to the computer via a USB cable, but when I plugged it into another power source to test it out without any physical connection to computer, it didn't work. When the board is powered from another source, I am not sure if the Arduino is connecting to the WiFi router since I cannot check on the Serial Monitor now.

I might be missing something really important here..

Here is the code for this, as I said I mixed some library examples from WifiNINA and OSC Library (I left some print functions out):

#include <SPI.h>
#include <WiFiNINA.h>
#include <WiFi.h>
#include <WiFiUdp.h>
#include <SPI.h>3
#include <OSCMessage.h>


// WIFI
#include "arduino_secrets.h"
///////please enter your sensitive data in the Secret tab/arduino_secrets.h
char ssid[] = SECRET_SSID;        // your network SSID (name)
char pass[] = SECRET_PASS;    // your network password (use for WPA, or use as key for WEP)
int status = WL_IDLE_STATUS;     // the WiFi radio's status

WiFiUDP Udp;

//the Arduino's IP
IPAddress ip(192, 168, 0, 100);
//destination IP
IPAddress outIp(192, 168, 0, 101);

const unsigned int outPort = 7000;    // local port to listen on

int count = 0;

void setup() {

  Udp.begin(8080);

  //Initialize serial and wait for port to open:
  Serial.begin(9600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only
  }

  // check for the WiFi module:
  if (WiFi.status() == WL_NO_MODULE) {
    Serial.println("Communication with WiFi module failed!");
    // don't continue
    while (true);
  }

  String fv = WiFi.firmwareVersion();
  if (fv < WIFI_FIRMWARE_LATEST_VERSION) {
    Serial.println("Please upgrade the firmware");
  }

  // attempt to connect to WiFi network:
  while (status != WL_CONNECTED) {
    Serial.print("Attempting to connect to WPA SSID: ");
    Serial.println(ssid);
    // Connect to WPA/WPA2 network:
    status = WiFi.begin(ssid, pass);

    // wait 10 seconds for connection:
    delay(10000);
  }

  // you're connected now, so print out the data:
  Serial.print("You're connected to the network");


}


void loop() {

  //delay(100);
  printCurrentNet();

  //the message wants an OSC address as first argument
  OSCMessage msg("/Acc1");
  msg.add(int32_t(count));
  msg.add(int32_t(count+180));
  msg.add(int32_t(count+360));

  
  Udp.beginPacket(outIp, outPort);
    msg.send(Udp); // send the bytes to the SLIP strea
  Udp.endPacket(); // mark the end of the OSC Packet
  
  msg.empty(); // free space occupied by message  
  delay(100);

  count++;

  Serial.print("working");
  

}

I would really appreciate if someone could set some light on what am I missing here.

In the meantime I will be checking out MQTT :slight_smile:

Thanks guys :heart: