Interfacing a RN-XV WiFly Module

Posted on
  • I set up my wifly to auto connect to my access point and connect to my website when data is received at the wifly rx pin. On page 63(not 100% sure) ofĀ­viceDoc/rn-wiflycr-ug-v1.2r.pdf it explains the alternate functionality of GPIO4. I would like to enable the alternate functionality of GPIO4 so the Espruino can monitor if the wifly is connected to the Access Point or not. Even though the manual explains how to achieve changing GPIO4 functionality I am still unsure what the bit code and command I am needing to use. Also, how do I setup a pin on the Espruino to check the status of the GPIO4 pin of the wifly?

  • I tried using digitalRead(A8) and digitalRead returned a 1 and read() returned true. I still get the same results when the power is disconnected from the wifly module. I thought the A8 pin would return false or 0 since GPIO4 of the wifly pin is no longer set to HIGH when the power is disconnected.

  • My god, that WiFly is one hell of a module...

    Is the pin supposed to be pulled up or pulled down by the Espruino?
    See if you get the expected behavior by setting pinMode to 'input_pulldown'...

  • DrAzzy, from my understanding the wifly GPIO 4 pin should be high when the wifly is connected to an access point, then the pin will go low when not connected. I need to, if at all possible, check the "status" of the GPIO4 pin using the Espruino. I will have to try your idea when I get home from work.

  • @DrAzzy

    pinMode(A8, 'input_pulldown');

    Worked as expected, but that is half the battle. When I remove the power from the wifly module I receive 'false'. When I reattach the power to the wifly module I receive 'true'. If you are familiar with the wifly module, to disconnect from a connected access point, you need to send the command "leave\r" while in cmd mode. I did just that, but I am still receiving a 'true'. Which led me to believe I did not change the GPIO4 pin functionality from LED to a GPIO. Changing the functionality from LED to GPIO is what I am having issues with. I am not sure how to achieve that. I read through the user manual, but I am still unsure how to achieve that.

  • AAah, well, then - that's the next challenge! Sounds like fun...

    I am not familiar with the WiFly module - I just looked it up though (after paging through that manual for a bit), and my jaw hit the floor - I expected to spend a fortune on something like that, but it's the same price as the CC3000 - while the feature set is miles beyond it; it sounds like it offloads a lot of stuff you'd rather not be using precious bits of Espruino memory for. I gotta get me one of those.

  • DrAzzy I asked for help in the forums. Hopefully I get a response back(keeping fingers crossed).

    @DrAzzy just so I understand this, here is some code that wrote to get the status of a specific pin.

      function readPin() {
        var dr =;

    If the dr variable returns a "true" that means the A8 pin is reading some sort of load? If dr returns "false" that means the A8 pin is NOT reading any load?

  • ha! I figured it out :-) apparently GPIO4 is not the actual pin "4". GPIO4 is actually pin "13". Oops.

    @DrAzzy, I think you should purchase the wifly module. It is well worth the money :)

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview

Interfacing a RN-XV WiFly Module

Posted by Avatar for d0773d @d0773d