[RESOLVED] Wireless communication with Arduino via Wifi

Is there a possibility to communicate from Touchdesigner to an Arduino via wifi? For the Arduino I guess will need a Wireless Module. Does anybody know any tutorial about this?

Hello,
Sorry I have no tutorial on it but my way to use easel Arduino with TD via Wifi is to use OSC protocol on Arduino, traducing OSC addresses and data to action in Arduino and Arduino measurement in OSC adresses and data. After that difficult task (but you find help on Arduino forum), its very easy to use it from the TD side.

ok, thanks, Jaques, I will have a look at it.

Hi Jaques,
I was trying trying the ESP8266 with my WEMOS D1 Mini and sending a code from it to TD workes . But I just cant get TD to send a message to the WEMOS board using the ESP8266ReceiveBundle sketch. I am trying the sendoscCHOP, but I am afraid nothing is revieved in the board. Does the TD messsage have some particular message type beside the name (path) of the message e.g. i my case “1/fader5”. This the text sketch use:

#ifdef ESP8266
#include <ESP8266WiFi.h>
#else
#include <WiFi.h>
#endif
#include <WiFiUdp.h>
#include <OSCMessage.h>
#include <OSCBundle.h>
#include <OSCData.h>

char ssid[] = “NETGEAR85”; // your network SSID (name)
char pass[] = “xxx”; // your network password

// A UDP instance to let us send and receive packets over UDP
WiFiUDP Udp;
const IPAddress outIp(10,40,10,105); // remote IP (not needed for receive)
const unsigned int outPort = 8000; // remote port (not needed for receive)
const unsigned int localPort = 9000; // local port to listen for UDP packets (here’s where we send the packets)

OSCErrorCode error;
unsigned int ledState = LOW; // LOW means led is on

#ifndef BUILTIN_LED
#ifdef LED_BUILTIN
#define BUILTIN_LED LED_BUILTIN
#else
#define BUILTIN_LED 13
#endif
#endif

void setup() {
pinMode(BUILTIN_LED, OUTPUT);
digitalWrite(BUILTIN_LED, ledState); // turn on led

Serial.begin(115200);

// Connect to WiFi network
Serial.println();
Serial.println();
Serial.print("Connecting to ");
Serial.println(ssid);
WiFi.begin(ssid, pass);

while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(“.”);
}
Serial.println(“”);

Serial.println(“WiFi connected”);
Serial.println("IP address: ");
Serial.println(WiFi.localIP());

Serial.println(“Starting UDP”);
Udp.begin(localPort);
Serial.print("Local port: ");
#ifdef ESP32
Serial.println(localPort);
#else
Serial.println(Udp.localPort());
#endif

}

void led(OSCMessage &msg) {
ledState = msg.getInt(0);
digitalWrite(BUILTIN_LED, ledState);
Serial.print("/led: ");
Serial.println(ledState);
}

void loop() {
OSCBundle bundle;
int size = Udp.parsePacket();

if (size > 0) {
while (size–) {
bundle.fill(Udp.read());
}
if (!bundle.hasError()) {
bundle.dispatch(“1/fader5”, led);
} else {
error = bundle.getError();
Serial.print("error: ");
Serial.println(error);
}
}
}OSC_send.tox (590 Bytes)

I fould out using the oscoutDat with a little bit of ajustment worked, and i get the messages in Arduino.