RN-XV (WiFly) support

@currymuetze, @StephR, …

Hey, there are two libraries out there for supporting this module.

I wanted to ask you which is better in terms of stability and consuming Flash/RAM?
What is your experience?
I really saw a some garbage in received data when using WiFly-Shield. This doesn’t look good.

We need a library with a working WebClient (or HttpClient/TcpClient) example :slight_smile:

Did you experience similar problems? How can it be fixed?
Thanks for any help.

Hi,
I was using a specific version of WiflyHQ that is needed for the ArduinoWiflyOSC library.
HOwever, I dont like the OSC way anymory but like youre application much more so cant wait to see it working with Wifly. I am not much of a help for you since I am not very deep into develloping libraries etc…just know how to use given libraries :wink:
Thats why I need you guys :wink:
Best
Thorsten

Did you work on the library yet?
I just saw on githup that you updated some files a few days ago but there was no statement here so I did not try it out…

Thx
Thorsten

@currymuetze, @StephR, …

RN-XV support is now in master branch on github (in beta).
Please check it out, and drop me a note about how it works.

Thanks.

hi,
can you post the link to the wifly library you used?
Also; I am using an atmega1284 - shall I chose Wildfire2 as board in blynk app?
Cheers

ok - found the library as you noted it in your example sketch :wink:
However, I cannot compile cause I am using Mighty1284p 16 Mhz using Optiboot Library.
Compiling with any othe library worx. Would be cool if you could help me out with that:

here is what i get:

In file included from D:\Arduino\1_05\libraries\Blynk/Adapters/BlynkWiFly.h:22,
from D:\Arduino\1_05\libraries\Blynk/BlynkSimpleWiFly.h:14,
from RN_XV_WiFly.ino:39:
D:\Arduino\1_05\libraries\Blynk/BlynkApiArduino.h: In member function ‘void BlynkApi::processCmd(const void*, size_t)’:
D:\Arduino\1_05\libraries\Blynk/BlynkApiArduino.h:132: error: ‘INPUT_PULLUP’ was not declared in this scope
RN_XV_WiFly.ino: In function ‘void setup()’:
RN_XV_WiFly:50: error: no match for ‘operator!’ in ‘!Serial’
RN_XV_WiFly.ino:50: note: candidates are: operator!(bool)
RN_XV_WiFly:53: error: no match for ‘operator!’ in ‘!Serial1’
RN_XV_WiFly.ino:53: note: candidates are: operator!(bool)

About INPUT_PULLUP, this is not Blynk’s problem: https://github.com/maniacbug/mighty-1284p/pull/8 and
http://forum.arduino.cc/index.php?topic=204438.0

As for the “no match for ‘operator!’ in ‘!Serial’”, you can safely remove those lines.

Ok,here we go:

  • I was able to fix the INPUT_PULLUP bug, at least it is compiling now
  • I commented out the Serial lines as you commented
  • Then I installed the sketch with my maniac1284 arduino bootloader

=> unfortunately it is not connecting - the first LED is blinking very fast but nothing is happening

Which hardware model do I need to chose if I am using an atmega1284? I tried wildfire v2 and v3 but no changes.

Also - why is there a 10000ms delay in the setup?

Thx for further help
Thorsten

one more: Tried to figure out where it does not work, so see my sketch:

//#define BLYNK_DEBUG
//#define BLYNK_PRINT Serial    // Comment this out to disable prints and save space
#include <SPI.h>
#include <WiFly.h>
#include <BlynkSimpleWiFly.h>
char auth[] = "ac5639ce971f46d4a9b990c28cbdf4a2";
#define WiFlySerial Serial1 // Could be a SoftwareSerial object
boolean autoLED=true;

void setup()
{

  Serial.begin(9600);
  WiFlySerial.begin(9600);  // Set your RN-XV baud rate
  pinMode(4, OUTPUT);
  digitalWrite(4,HIGH);
  WiFly.setUart(&WiFlySerial);
  delay(10000);
  Blynk.begin(auth, "xxx", "xxx");
  pinMode(4, OUTPUT);
  digitalWrite(4,LOW);
}

void loop()
{
  Blynk.run();
}

BLYNK_WRITE(6) { 
  if (autoLED==1 && param.asInt()==1) { autoLED=0; Blynk.virtualWrite(7, 0); Blynk.virtualWrite(8, 255); }
  else if (autoLED==0 && param.asInt()==1) { autoLED=1; Blynk.virtualWrite(7, 255); Blynk.virtualWrite(8, 0); }
}

=> the led (D4) goes high then the board starts trying to connect. However if I put the D4 to go LOW before the Blynk.begin(auth, “tnthome”, “testtest”); the LED goes LOW. If i put it behind it does not go LOW; so it seems there is sth strange in my setup with the blynk.begin.

Hope it helps you

You may also need to fix the rn-xv identifier in the library (look in the sketch header comments)

I will check that. Also fast blinking of green led means no IP set. Sure that has to do with model ID?

Anyways…still one question open: what Plattform do I chose in blynk applications?

ok - does anyone here has an idea how to find out what version I have and what exactly I need to insert as exact identifier in the *.cpp file??

sorry but i do not find any information about the identifier…neither which I own nor what exactly i would need to insert…
I am not even sure if thhats the problem…
would be cool if you could provide more help on this - i am lost :frowning:

THX
EDIT//
so i checked my module:
where this one(https://www.sparkfun.com/datasheets/Wireless/WiFi/WiFlyGSX-um2.pdf) says
“WiFly RN-131GSX” (sth that you have also in your basic code) mine says:
“WiFly RN-171” (and also: FCC ID = T9J-RN171)

=> so can you tell me what exactly I need to enter in the *.cpp file?

I think you can change it to:

if (findInResponse("\r\nwifly", 1000)) {

I think that’s a more generic way…

doesnt change anything…
I dont think its an identifier bug.
Thats my setup code:

void setup()
{

  Serial.begin(9600);
  WiFlySerial.begin(9600);  // Set your RN-XV baud rate
  pinMode(4, OUTPUT);
  digitalWrite(4,HIGH);
  WiFly.setUart(&WiFlySerial);
  delay(10000);
  Blynk.begin(auth, "xxx", "xxxx");
  pinMode(4, OUTPUT);
  digitalWrite(4,LOW);
}

it hangs up at Blynk.begin(…) => I can tell cause LED4 will never be LOW.
If I put it before Blynk.begin, LED4 goes LOW.

So that is at least one thing not working for me.
The other one is, that WiFly.setUart(&WiFlySerial); doesnt connect - i tries to but ends up with fast blinking green WiFly LED

hope you can help me

ok - some small progress:
I always wrote it WiFly - no i tired with “wifly” and it seems like sths working now:
Instead of fast blinking green LED (=no IP) now its small blinking (=IP address is assigned)
Got the information from here: http://www.instructables.com/id/WiFly-RN-XV-Module-Wireless-Arduino-Board-Tutorial/

However, I still cannot connect with blynk app: “Your wildfire V2 is not in network”
and it still seems to hang on Blynk.begin(auth, “xxx”, “xxxx”); (Cause LED4 still does not change to LOW)

sth more I figured out:
It works if I comment out all blynk.XY commands

//#define BLYNK_DEBUG
//#define BLYNK_PRINT Serial    // Comment this out to disable prints and save space
#include <SPI.h>
#include <WiFly.h>
#include <BlynkSimpleWiFly.h>
char auth[] = "ac5639ce971f46d4a9b990c28cbdf4a2";
#define WiFlySerial Serial1 // Could be a SoftwareSerial object
boolean autoLED=true;

void setup()
{

  Serial.begin(9600);
  WiFlySerial.begin(9600);  // Set your RN-XV baud rate
  pinMode(4, OUTPUT);
  digitalWrite(4,HIGH);
  WiFly.setUart(&WiFlySerial);
  delay(10000);
 // Blynk.begin(auth, "xxx", "xxxx");
  digitalWrite(4,LOW);
}

void loop()
{
//  Blynk.run();
}

BLYNK_WRITE(6) { 
  if (autoLED==1 && param.asInt()==1) { autoLED=0; Blynk.virtualWrite(7, 0); Blynk.virtualWrite(8, 255); }
  else if (autoLED==0 && param.asInt()==1) { autoLED=1; Blynk.virtualWrite(7, 255); Blynk.virtualWrite(8, 0); }
}

The prvious bug was that the LED4 went off but right away rebooted the arduino so i didnt notice the OFF.
Question is: Why is blynk.run or blynk.begin rebooting???

Hey guys, I did some stability tests and it looks like using WiFlyHQ is much better…
It will take me 1-2 days to integrate it. I believe it will be much easier to start and more fast, reliable.
Sorry for the confusion, and thanks for your efforts!

Hi,
well i would rather say, thank you for your efforts!!!
Let me know once youve fixed it, I willl then test it
Best//

I pushed this version to the master few minutes ago…
I was able to connect and operate my project (Wildfire with same ATmega1284P) with WiFlyHQ library (without modifications).
Could you check it?