Hi all!
I have been struggling with getting OSC over ethernet working on a Wemos D1 mini clone with W5500 board. I have no idea where I'm going wrong here. I have my D1 connected like this:
D1 mini - W5500
5v - 5v
Ground - Ground
D4 - CS
D5 - CLK
D6 - MISO
D7 - MOSI
I have gotten a pic of the W5500 of the internet, moved the writing so I can fit in what I connected to what pin, the bottom left in this picture says NC (what is that?) but mine says GND theere.
The code I've uploaded is the following. My serial monitor got dumped full of "CUT HERE FOR EXCEPTION DECODER" with a whole lot of data after it every like second and I read that can be fixed with the yield(); like this but it didn't fix it.
#include <OSCMessage.h>
#include <Ethernet.h>
#include <EthernetUdp.h>
#include <SPI.h>
unsigned long mills;
unsigned long last;
EthernetUDP Udp;
//the Arduino's IP
IPAddress ip(192, 168, 88, 252);
//destination IP
IPAddress outIp(192, 168, 88, 250);
const unsigned int outPort = 10024;
byte mac[] = {
0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; // you can find this written on the board of some Arduino Ethernets or shields
bool onoff;
void setup() {
Serial.begin(31250);
Ethernet.begin(mac,ip);
Udp.begin(8888);
}
void sendOscTestMessage(bool onoff){
OSCMessage msg("/testmessage/onoff ");
msg.add(onoff);
Udp.beginPacket(outIp, outPort);
msg.send(Udp); // send the bytes to the SLIP stream
Udp.endPacket(); // mark the end of the OSC Packet
msg.empty(); // free space occupied by message
}
void loop() {
mills = millis();
if(mills-100>=last){
Serial.println(onoff);
sendOscTestMessage(onoff);
Serial.println();
onoff =! onoff;
last = mills;
}
while(mills-100<last){
yield();
}
}
What am I doing wrong here?
Cheers