Connect Seeeduino Studio Wifi Shield RN-171 to Blynk or IoT Cloud

Is there any possibility to connect RN171 Wifi Shield by Seeeduino Studio to Blynk or IoT Cloud? I wish to control LED remotely.

only a very few boards are supported on IoT cloud and all of them have WiFi on board.

do you have some problem connecting it to Blynk with Blynk examples? the WiFly library for RN171 is supported by Blynk

I tried this code after choosing RN-XV WiFly in Blynk examples

... I replaced of course.

The RN171 seems like was recognised although the connection is always failed in serial monitor. I tried multiple networks as well.

#define BLYNK_TEMPLATE_ID            "..."
#define BLYNK_DEVICE_NAME           "..."
#define BLYNK_AUTH_TOKEN            "..."

// Comment this out to disable prints and save space
#define BLYNK_PRINT Serial

#include <WiFlyHQ.h>
#include <BlynkSimpleWiFly.h>

char auth[] = BLYNK_AUTH_TOKEN;

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "...";
char pass[] = "...";

//#define WiFlySerial Serial1
// This can be a SoftwareSerial object:
#include <SoftwareSerial.h>
SoftwareSerial WiFlySerial(2, 3); // RX, TX

WiFly wifly;

void setup()
{
  // Debug console
  Serial.begin(115200);

  WiFlySerial.begin(9600);  // Set your RN-XV baud rate
  delay(10);

  // Bind WiFly driver to the serial
  if (!wifly.begin(&WiFlySerial)) {
    BLYNK_FATAL("Failed to start wifly");
  }

  // You can try increasing baud rate:
  //wifly.setBaud(115200);
  //WiFlySerial.begin(115200);

  Blynk.begin(auth, wifly, ssid, pass);
}

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

This code (example from WiFly) connect the RN171 to my network successfully although I'm not sure how to make the connection to Blynk.

#include <Arduino.h>
#include <SoftwareSerial.h>
#include "WiFly.h"

#define SSID      "..."
#define KEY       "..."
#define AUTH      WIFLY_AUTH_WPA2_PSK


SoftwareSerial uart(2, 3);
WiFly wifly(&uart);

void setup() {
  uart.begin(9600);

  Serial.begin(9600);
  Serial.println("--------- WIFLY TEST --------");
  
  // wait for initilization of wifly
  delay(3000);
  
  uart.begin(9600);     // WiFly UART Baud Rate: 9600
  
  wifly.reset();
  
  Serial.println("Join " SSID );
  if (wifly.join(SSID, KEY, AUTH)) {
    Serial.println("OK");
  } else {
    Serial.println("Failed");
  }
  
  // get WiFly params
  wifly.sendCommand("get everthing\r");
  char c;
  while (wifly.receive((uint8_t *)&c, 1, 300) > 0) {
    Serial.print((char)c);
  }
  
  if (wifly.commandMode()) {
    Serial.println("Enter command mode. Send \"exit\"(with \\r) to exit command mode");
  }
}

void loop() {
  while (wifly.available()) {
    Serial.write(wifly.read());
  }
  
  while (Serial.available()) {
    wifly.write(Serial.read());
  }
}

you have to setup a Blynk account, template and device on cloud and put templateid and deviceid into the sketch

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.