Go Down

Topic: ardOSC and WIFI library help (Read 3133 times) previous topic - next topic



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:

Code: [Select]

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.

* 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:

  // check for the presence of the shield:
  if (WiFi.status() == WL_NO_SHIELD) {
    Serial.println("WiFi shield not present");
    // don't continue:
// attempt to connect to Wifi network:
  while ( status != WL_CONNECTED) {
    Serial.print("Attempting to connect to WPA SSID: ");
    // Connect to WPA/WPA2 network:   
    status = WiFi.begin(ssid, pass);

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


void loop() {
  // check the network connection once every 10 seconds:
  Serial.println("alive! ");
  analogWrite(led1, val1);

void func1(OSCMessage *_mes){
  float value = _mes->getArgFloat(0);
  val1 = (long)(value*255);

when i try to compile i get the following messages:

Code: [Select]

/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 -


Solving the first error may resolve the others. How have you tried to resolve it?


hi paul

i haven't as yet tried to resolve it - i have used this library before with the ethernet shield and it never came up with any error messages when compiling, so not really sure where to start with it. but guessing it is to do with some function of the ethernet library that it wants to connect to, i thought that is why i needed to include the SPI.h library..


i have used this library before with the ethernet shield and it never came up with any error messages when compiling

This library is missing a link.

It also seems unlikely that your WiFi shield has a W5100 chip on it, so any code that relies on a W5100 chip (with, for example, built in support for TCP/IP) isn't going to port well to another device without that built in support.


oh.. that is a shame, as it seems like a natural progression to allow for wireless control with the same capabilities as the wired option, the OSC protocol is so well suited for realtime sequencing and performance environments, i have been using the ethernet shields with great success and was really excited about the prospect of making my projects go wirelessly, the osc protocol works really well wirelessly and there are some great apps that allow for building great interfaces.. the wifi shield i am using is this one: http://arduino.cc/en/Main/ArduinoWiFiShield
which i think does support TCP/IP but again sadly this is a bit above my technical knowledge, it is frustrating knowing that there has to be a solution out there to a problem but not having the necessary skill set to realise it


Sep 13, 2012, 07:08 pm Last Edit: Sep 17, 2012, 02:10 am by Headroom Reason: 1

as it seems like a natural progression to allow for wireless control with the same capabilities as the wired option,

Unfortuantely that's an assumption that quite a few people make (me included ;-). The ArdOSC library uses some low level functions of the Ethernet library that "talk" directly to the Wizenet W5100 chip on the Ethernet shield. Using a different Ethernet shield, whether WiFi or Cable, that does not use this chip will most likely require you to find equivalent software functionality for that different chip that you can adapt the library to.

If you don't have that skill level ( I don't) then there still is an actually very simple WiFi solution that works perfectly for my project. Unfortunately, for now, you'll have to toss the WiFi shield and use a standard Ethernet shield, connected to a little pocket Router such as the TP-Link WR702n (approximately $30). My projects employs a Teensy++ 2 http://www.pjrc.com/teensy/index.html and a WIZ812 Ethernet Module http://www.saelig.com/product/ETH042.htm with the adapter http://www.pjrc.com/store/wiz812_adaptor.html. I am not trying to sell anything but listed these parts simply to help explain that I am not just suggesting something that may work but actually does work in my project.

The ArdOSC library is not the only library that depends on this low level functionality, btw, the DHCP/Bonjour libraries for example depend on the same low level functionality (w5100.h, w5100.cpp in the /utility subfolder).



Has anyone had a chance to look at the updated ArdOsc library made for the wifly module? https://github.com/Zapalot/ArdOscForWiFlyHQ unfortunately I have the arduino wifi module, not the wifly, but am planning to take a look and see if I can get it to communicate with my arduino...

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131