WiFly Shield code library alpha 2 release

rickburgen:
Great work on this WiFly library so far.

Thanks. Apologies for the delay in answering.

My question(if it hasn’t been answered already) is, how is the MAC Address handled. I know with the Ethernet class you have to provide one.

Each WiFly module has a MAC address hardcoded–there’s a sticker on the module that shows the address.

The module handles the MAC address directly so you don’t have to (nor can you) supply it to the library.

–Philip;

I do not have a sticker on my Shield. So how can I get it another way.

Also, When I call join on the WiFly class in the setup function, it doesn’t hang or initiate it just keeps trying to connect(I assume). What would cause this?

rickburgen:
I do not have a sticker on my Shield. So how can I get it another way.

Upload the ‘SpiUartTerminal’ sketch from the File > Examples > WiFly > tools menu. Open the serial monitor. Enter “$$$” as directed (without line endings). Enable line ending and type this followed by the enter/return key or send button: get macYou should get a response similar to:```
Mac Addr=00:ca:fe:00:be:ef


<QUOTE>

> When I call join on the WiFly class in the setup function, it doesn't hang or initiate it just keeps trying to connect(I assume). What would cause this?

</QUOTE>Can you provide more detail on this please?

--Philip;

Thanks for your reply.

When I try to get the MAC Address, this what I see, and entering $$$ or get mac seems to have to effect(serial continues to output “Auto-Assoc roving1 chan=0 mode=NONE FAILED”).

SPI UART on WiFly Shield terminal tool


This is a tool to help you troubleshoot problems with the WiFly shield.

For consistent results unplug & replug power to your Arduino and WiFly shield.

(Ensure the serial monitor is not open when you remove power.)

Attempting to connect to SPI UART…

Connected to SPI UART.

  • Use $$$ (with no line ending) to enter WiFly command mode. (“CMD”)

  • Then send each command followed by a carriage return.

Waiting for input.

Auto-Assoc roving1 chan=0 mode=NONE FAILED

And here is my setup function, the serial never outputs “here” or “Associated”

void setup() {

Serial.begin(9600);

Serial.println(“\n\r\n\rWiFly Shield Terminal Routine”);

WiFly.begin();

if (!WiFly.join(ssid)) {

Serial.println(“Association failed.”);

while (1) {

Serial.println(“here”);

// Hang on failure.

}

}

Serial.println(“Associated!”);

}

I have the same problem as rickburgen

rickburgen:
Also, When I call join on the WiFly class in the setup function, it doesn’t hang or initiate it just keeps trying to connect(I assume). What would cause this?

I changed the “Credentials.h” for the put my ssid and passphrase network, but in the passphrase I leave it clear cause my networks is open but it doesn’t work.

I’m using WiFly_Autoconnect_Terminal sketch and the code of Credentials.h is:

#ifndef __CREDENTIALS_H__
#define __CREDENTIALS_H__

// Wifi parameters
char passphrase[] = "";
char ssid[] = "PRUEBA";

#endif

the result on the Serial Monitor is:

WiFly Shield Terminal Routine

just that

Hi i am using WEP-128 and so far didint had any big problems looks like it works quit stable left it on for 4 days and nights and after still connected to my hosted web page.

Thanx again for you work on library Philip.

Hi I use your library on arduino mega 2560 and wifly shield. All sketch i’ve tried don’t work. When the procedur going to activate the spi_uart it’s block. Whatever char i send in the terminal don’t produce effect. What i do wrong?

hi.

is it possible to use this library for the WiFly GSX Breakout by somehow not using the SPI part of this library ?

Thanks,

Stephan.

Hi,

is there any chance to get the WiFly library to work with the Bonjour/Zeroconf library (http://gkaindl.com/software/arduino-ethernet/bonjour)? Is there anything “obvious” that I can do (I’m not too experienced with C programming)?

Thanks

René

PS: I appreciate your work a lot!

From my attempts to connect to my WPA network and a reading of the library source code it appears this library does not support spaces in the SSID. Is that correct? It wasn’t obvious why this doesn’t work (I tried connecting with both a space in the name and replacing the space with a $). I verified WiFly works OK with my network by modifying the sketch Gary posted (i.e. by not using the library). Using that I can connect just fine (with a $ substituted for the space).

I’d prefer to use the library and wouldn’t mind implementing the TODO noted in the library source code to add support for spaces/$. But it’s not clear why neither a space nor a $ works in the Library. If you know where in the code (uart.print?) the limitation exists it would save me some time…

I posted a solution to space in the SSID name on another thread viewtopic.php?f=32&t=28163&p=126503#p126503

Hi,

I a little bit new to this…

I was using the Ethernet library from Arduinos core libraries.

But right now i wanted to use the HTTPclient from http://interactive-matter.eu/how-to/ard … t-library/ interactive matter.

But in the last updates of this library, they started using the WiFly library as way to control the ethernet and wireless hardware of arduino.

i wanted to know, how should i proceed to substitute the actual Ethernet library for the Wifly library.

Is it transparent? What should i be expecting and what cares should i take?

Cheers

Well, I updated the firmware on my shield per the manufacturer (to fix the RTC bug) and now the library refuses to connect to a webserver. I was able to connect before using the example client sketch, now it just sits on “connecting…” and the PIO4 led flashes fast (in command mode). I think the commands have changed for opening a connection but I can’t seem to verify…

Any help is much appreciated…

On a related note, is it possible to get an update to the Alpha 2 library? Is it likely that we might get to beta sometime? Thanks for all the efforts to this end so far. Most appreciated.

Guys, since I’m having issues with the latest firmware and the WiFly library alpha 2, I forked genetikayos’s alpha 2 library and added new functions and will have support for firmware versions 2.26 and above. Since there hasn’t been any activity on the library in a few months, I figured this would be helpful for some.

The 2.26 firmware fixes some major bugs with the module and is highly recommended you upgrade, unfortunately this will break the client and server portions of the library. I’m actively working on a fix and will let folks know when it’s working.

Some highlights of what’s been added:

int getSignalStrength()

Will return the last reported signal from the module as an int.

long getTime()

Will return the time in Unix (Epoch) format from the NTP server. In UTC time.

long getUpTime()

Will return the time in seconds since the last reboot/power up.

https://github.com/jaycollett/WiFly-Shield

UPDATE: I have now updated the code at github to work with the client side parts of the library when using firmware 2.26 or later. I’ll update the post again once I have the server side parts updated.

Jay, this is wonderful!!! Thank you so very much for your contribution. Most appreciated.

Hi, somebody could indicate me how to reboot the wifly using the WiFly library?

I implemented some client to get a simple html from a remote webserver every 1 minute, but after 1 hour or less it hangs on client.connect() and green led blink fast (No IP?). So I thought I could just reboot the shield every 10 minutes or so.

Thanks!

jaycollett:
I’ll update the post again once I have the server side parts updated.

Hi Jay, did you have a chance to look into the server side? Would be wonderful if you could kindly share. Thank you very much!

For those interested in AdHoc mode for your WiFly adapter, and still want to use the WiFly Library, I’ve hacked together the function below to make it easier to setup.

void WiFlyDevice::beginAdhoc() {
  /*
    Create and AdHoc network with the WiFly Shield.
   */
   
  DEBUG_LOG(1, "Entered WiFlyDevice::beginAdhoc()");
  
  uart.begin();
  reboot(); // Reboot to get device into known state
  requireFlowControl();
  enterCommandMode();

  // Turn on Adhoc Mode
  sendCommand("set wlan join 4");
  // Set SSID of Adhoc Network
  sendCommand("set wlan ssid MY_SSID");
  // Set Channel for Adhoc Network
  sendCommand("set wlan chan 1");
  // Set IP for Adhoc Network
  sendCommand("set ip address 169.254.1.1");
  sendCommand("set ip netmask 255.255.0.0");
  // Turn off DHCP
  sendCommand("set ip dhcp 0");
  // Set server port
  sendCommand("set ip localport ", true);
  uart.print(serverPort);
  sendCommand("");

  // Turn off remote connect message
  sendCommand("set comm remote 0");
  
  sendCommand("save", false, "Storing in config");
  //Ensures sucessful reboot. See requireFlowControl for more info.
  sendCommand("get uart", false, "Flow=0x1");
  reboot();
  
  //After rebooting, your AdHoc network will be available.
}

Run this function in the setup() routine and you’ll have an adhoc network ready to go.

It takes the WiFly around a minute to issue an IP to the connecting device, but once the address is issued it works great.

Hi Jay,

Just got a WiFly shield - and when I update the firmware the latest one it will give is 2.23 !! I cannot find/get 2.26.

Also your library appears to have lost the WiFly.Configure(…) method along the way (your commit of 2011-07-19 19:21:32) - was this intentional?

Best regards

John.