Problem with ArdOSCForWiFlyHQ

Hi,

I just downloaded ArdOSCForWiFlyHQ and WiflyHQ and wanted to build the SimpleReceive example but I get the following error, Im using an Arduino Due:

C:\...\WiFlyHQ.cpp: In member function 'int8_t WiFly::getDHCPMode()':
C:\...\WiFlyHQ.cpp:1515: error: 'strncmp_P' was not declared in this scope
C:\...\WiFlyHQ.cpp: In member function 'boolean WiFly::getres(char*, int)':
C:\...\WiFlyHQ.cpp:1611: error: 'strncpy_P' was not declared in this scope

Here is the Sketch (which I just downloaded):

// How to send OSC messages from an Arduino.
// This Example is in the public domain.

// Important known issues:
// The Wifly provides no means to get the data from a single UDP package at a time
// Everything is just dumped to the serial connection.
// The only hint that a package is finished is that reading from the serial *might* time out
// To make things work anyway:
// 1. Use a high baud rate for communication with the Wifly: 115200 on a hardware serial is perfect.
// 2. Adjust the timeout in server.availableCheck(). 2ms works fine with 115200baud.
// 3. If possible, let the controlling Program pause at least 1.5 times the timout between sending OSC messages.

#include <WiFlyHQ.h>
#include <ArdOSCForWiFlyHQ.h>

//uncomment this to use a software serial if you dont own a MEGA
//#include <SoftwareSerial.h>
//SoftwareSerial softSerial(softSerialRx,softSerialTx);

WiFly wifly;
OSCServer server(&wifly);

int ledPin=13;

void setup()
{ 
  Serial.begin(115200);
  //use the convenient setup. Replace <HardwareSerial> by <SoftwareSerial> if you use one.
  wifly.setupForUDP<HardwareSerial>(
    &Serial1,   //the serial you want to use (this can also be a software serial)
    9600, // if you use a hardware serial, I would recommend the full 115200. This does not work with a software serial.
    true,	// should we try some other baudrates if the currently selected one fails?
    "WLAN-466B23",  //Your Wifi Name (SSID)
    "SP-213B33501", //Your Wifi Password 
    "WiFly",                 // Device name for identification in the network
    "192.168.2.201",         // IP Adress of the Wifly. if 0 (without quotes), it will use dhcp to get an ip
    8000,                    // WiFly receive port
    "255.255.255.255",       // Where to send outgoing Osc messages. "255.255.255.255" will send to all hosts in the subnet
    8001,                     // outgoing port
    true	// show debug information on Serial
  );
  wifly.printStatusInfo(); //print some debug information 

  pinMode(ledPin,OUTPUT); //prepare to fade th einternal LED by OSC
   // Register a callback fuction of the LED fading.
   // When a message is with the adress "/ard/ledFade" is received, "setLedFade" will be invoked.
   server.addCallback("/ard/ledFade",&setLedFade);
}


void loop()
{
	//check for new incoming messages. If a message with a registered adress is recieved, the callback function will be invoked.
  if(server.availableCheck(2)>0)
  {  
    //debugoutln("alive!"); //callback after process
  }
}

void setLedFade(OSCMessage *_mes){
  //get 1st argument(int32) and use it to fade the LED
  int fadeValue=_mes->getArgInt32(0);
  Serial.println(fadeValue);
  analogWrite(ledPin,fadeValue );
}

Link for the libraries:
https://github.com/Zapalot

-tsaG

So, no one?

I thought this could be a simple fault in using some kind of function wrong :-/

So,

I got it finally working (kind of)! Im receiving messages and can send messages to Touchosc using the wifly.

But the thing is, im Receiving messages like this:

/field1/rotary1 ,f BEï?
/field1/rotary1 ,f A 
/field1/rotary1 ,f Bwb2
/field1/rotary1 ,f B™Z
/field1/rotary1 ,f B«.I
/field1/rotary1 ,f B¶
/field1/rotary1 ,f B\Û9
/field1/rotary1 ,f BÆ£
/field1/rotary1 ,f AÓöˆ
/field1/rotary1 ,f AK¹Ñ

Im using Serial.write( Serial1.read() ); to read the data from the wifly, does anyone know what I'm doing wrong? Do I have to convert the value?

Also, when I hold the button in TouchOSC the message is repeatedly sent, after one second of pressing the button this is what I get:

/field1/rotary1 ,f @Ãï¢/field1/rotary1 ,f @ÂW•/engine/r/fi/fi/fie/fie,/ot/fi/fi

Is this a buffer overflow?

Hello tsag,

I just came over your thread since I am working on a similar project: Until today I use TOUCHosc with Arduino and Ethernetshield. The Ethernet and Z-OSC libraries are working pretty well.

Not I acquired a WIFLY RN 171 Module which I am using over RX TX (Gnd+3.3v) Pins. As for libraries I came over WiFlyHQ and ArdOSCforWiFlyHQ. Unfortunately I already get error messages when trying to compile one of the default sketches: (Simple Receive or Send) it seems like the method "setupForUDP" does not exist in the WiFlyHQ class:

Build options changed, rebuilding all In file included from SimpleReceive.ino:13: C:\Program Files (x86)\Arduino\libraries\WiFlyHQ/WiFlyHQ.h:78: error: conflicting declaration 'typedef const char prog_char' c:/program files (x86)/arduino/hardware/tools/avr/lib/gcc/../../avr/include/avr/pgmspace.h:212: error: 'prog_char' has a previous declaration as 'typedef char prog_char' SimpleReceive.ino: In function 'void setup()': SimpleReceive:29: error: 'class WiFly' has no member named 'setupForUDP' SimpleReceive:29: error: expected primary-expression before '>' token SimpleReceive:42: error: 'class WiFly' has no member named 'printStatusInfo'

Can someone help?? Best// Thorsten