hello
i am trying to get the ardosc library working with the wifi library to allow for some great realtime wireless control. The ArdOSC library work really well with the ethernet library and i was hoping it was going to be a straight forward port across to the wifi option (using the new arduino wifi shields) however i get some errors compiling which i am not sure how to fix. digging around online, it seems that the ardosc library uses some deep rooted functions of the ethernet library, but alas that is a bit out of my technical knowledge..
the code i have so far is this - which would just in theory allow for a fading control of an led over a wifi network using the OSC protocol:
/*
This example connects to an unencrypted Wifi network.
Then it prints the MAC address of the Wifi shield,
the IP address obtained, and other network details.
Circuit:
* WiFi shield attached
created 13 July 2010
by dlf (Metodo2 srl)
modified 31 May 2012
by Tom Igoe
*/
#include <SPI.h>
#include <ArdOSC.h>
#include <WiFi.h>
char ssid[] = "kazimier_workshop"; // your network SSID (name)
char pass[] = "password"; // your network password
int status = WL_IDLE_STATUS; // the Wifi radio's status
int serverPort = 9000;
int destPort=12000;
long val1 = 0;
OSCServer server;
OSCClient client;
int led1 = 6;
void setup() {
//Initialize serial and wait for port to open:
Serial.begin(9600);
// check for the presence of the shield:
if (WiFi.status() == WL_NO_SHIELD) {
Serial.println("WiFi shield not present");
// don't continue:
while(true);
}
// 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");
server.begin(serverPort);
server.addCallback("/1/light1",&func1);
}
void loop() {
// check the network connection once every 10 seconds:
if(server.aviableCheck()>0){
Serial.println("alive! ");
}
analogWrite(led1, val1);
}
void func1(OSCMessage *_mes){
float value = _mes->getArgFloat(0);
val1 = (long)(value*255);
Serial.println(val1);
}
when i try to compile i get the following messages:
/Applications/Arduino.app/Contents/Resources/Java/libraries/ArdOSC/OSCClient.cpp:22:27: error: utility/w5100.h: No such file or directory
/Applications/Arduino.app/Contents/Resources/Java/libraries/ArdOSC/OSCClient.cpp: In member function 'int16_t OSCClient::sockOpen()':
/Applications/Arduino.app/Contents/Resources/Java/libraries/ArdOSC/OSCClient.cpp:39: error: 'W5100' was not declared in this scope
/Applications/Arduino.app/Contents/Resources/Java/libraries/ArdOSC/OSCClient.cpp:40: error: 'SnSR' has not been declared
/Applications/Arduino.app/Contents/Resources/Java/libraries/ArdOSC/OSCClient.cpp:40: error: 'SnSR' has not been declared
/Applications/Arduino.app/Contents/Resources/Java/libraries/ArdOSC/OSCClient.cpp:48: error: 'SnMR' has not been declared
does anyone have any suggestions? or any experience with this?
all help greatly appreciated -