Does anybody used the RN131C in Arduino 2.x.x?

Hi, the title is the content.

I try to use RN131C in Arduino IDE 2.x.x on Atmega2560 board. And I also use this library: GitHub - sparkfun/SparkFun_WiFly_Shield_Arduino_Library: Arduino Library for the SparkFun WiFly Shield
I ran a WiFly_Webserver.ino example, but it didn't work. But when I ran on old Arduino IDE version(1.0.5-rc2), it work!.

What is the problem?

Hi @diadntjr. Please add a forum reply here that provides a detailed explanation of what you mean by "didn't work", including:

  • What did you do?
  • What were the results you expected from doing that thing?
  • What were the results you observed that did not match your expectations?

Make sure to include the full and exact text of any error or warning messages you might have encountered.

  • What did you do? : I just download in upward github link site. And just append on my Arduino IDE 2.x.x librarys list. And then load example source in WiFly library.

  • What were the results you expected from doing that thing? : Just Working. Connect another wifi and open the HTTP server. I saw it at old Arduino Version(1.0.5-rc)

  • What were the results you observed that did not match your expectations? : When the program passed on WiFly.join() part, it return "false". It means the association is failed. So I checked the parameters and WiFly.join func, I couldn't find error.

I moved your topic to an appropriate forum category @diadntjr.

In the future, please take some time to pick the forum category that best suits the subject of your topic. There is an "About the _____ category" topic at the top of each category that explains its purpose.

This is an important part of responsible forum usage, as explained in the "How to get the best out of this forum" guide. The guide contains a lot of other useful information. Please read it.

Thanks in advance for your cooperation.

Thanks for the clarification. I'm going to ask you to post the full verbose output from a compilation of the WiFly_Webserver.ino example in both Arduino IDE 2.x.x and Arduino IDE 1.0.5-rc2. We may be able to spot a significant difference between the two outputs that would explain the different results.


:exclamation: This procedure is not intended to solve the problem. The purpose is to gather more information.


Please do this:

  1. Select File > Preferences... (or Arduino IDE > Settings... for macOS users) from the Arduino IDE 2.x menus.
    The "Preferences" dialog will open.
  2. Check the box next to "Show verbose output during: ☐ compilation" in the "Preferences" dialog.
  3. Click the "OK" button.
  4. Select Sketch > Verify/Compile from the Arduino IDE menus.
  5. Wait for the compilation to finish.
  6. Right click on the black "Output" panel at the bottom of the Arduino IDE window.
  7. From the context menu, click Copy All.
  8. Open a forum reply here by clicking the "Reply" button.
  9. Click the <CODE/> icon on the post composer toolbar.
    This will add the forum's code block markup (```) to your reply to make sure the error messages are correctly formatted.
    Code tags icon on toolbar
  10. Press Ctrl+V.
    This will paste the compilation output into the code block.
  11. Move the cursor outside of the code tags before you add any additional text to your reply.
  12. Now repeat the process above, only using Arduino IDE 1.0.5-rc2 this time. The interface of Arduino IDE 1.0.5-rc2 is a bit different from Arduino 2.x so you will need to adapt the instructions slightly, but I think it will be manageable. If you get stuck, just let me know and I'll provide instructions for the old IDE as well.
  13. Click the "Reply" button to post the output.

In case the output is longer than the forum software will allow to be added to a post, you can instead save it to a .txt file and then attach that file to a reply here:

  1. Open any text editor program.
  2. Paste the copied output into the text editor.
  3. Save the file in .txt format.
  4. Open a forum reply here by clicking the "Reply" button.
  5. Click the "Upload" icon (image) on the post composer toolbar:
    Upload icon on toolbar
    A dialog will open.
  6. In the dialog, select the .txt file you saved.
  7. Click the "Open" button.
  8. Click the "Reply" button to publish the post.

Alternatively, instead of using the "Upload" icon on the post composer toolbar as described in steps (5) - (7) above, you can simply drag and drop the .txt file onto the post composer field to attach it.

compile_log.txt (31.3 KB)

Here are the compiler's log as you said. And also I upload used code.

/*
 * Web Server
 *
 * (Based on Ethernet's WebServer Example)
 *
 * A simple web server that shows the value of the analog input pins.
 */

#include <SPI.h>
#include <WiFly.h>

#include "Credentials.h"

WiFlyServer server(80);

void setup() {
  WiFly.begin();

  if (!WiFly.join(ssid, passphrase)) {
    while (1) {
      // Hang on failure.
    }
  }

  Serial.begin(9600);
  Serial.print("IP: ");
  Serial.println(WiFly.ip());
  
  server.begin();
}

void loop() {
  WiFlyClient client = server.available();
  if (client) {
    // an http request ends with a blank line
    boolean current_line_is_blank = true;
    while (client.connected()) {
      if (client.available()) {
        char c = client.read();
        // if we've gotten to the end of the line (received a newline
        // character) and the line is blank, the http request has ended,
        // so we can send a reply
        if (c == '\n' && current_line_is_blank) {
          // send a standard http response header
          client.println("HTTP/1.1 200 OK");
          client.println("Content-Type: text/html");
          client.println();
          
          // output the value of each analog input pin
          for (int i = 0; i < 6; i++) {
            client.print("analog input ");
            client.print(i);
            client.print(" is ");
            client.print(analogRead(i));
            client.println("<br />");
          }
          break;
        }
        if (c == '\n') {
          // we're starting a new line
          current_line_is_blank = true;
        } else if (c != '\r') {
          // we've gotten a character on the current line
          current_line_is_blank = false;
        }
      }
    }
    // give the web browser time to receive the data
    delay(100);
    client.stop();
  }
}

Thank you for your reply.