[Solved] NEW Arduino UNO WiFi board

I confirm that the Ciao library is also able to write values from hard pins to app, I guess we can deal with all RESTful APIs .
One step forward could be implementing a “syncing” loop like in the httprequest() function in this example:

I think the problem of calling complex blynk functions in the sketch remains because the board remains “not on network” in the app (not tested yet however). This can reduce functionality of many widgets.

presumably you use the Ciao.write function in place of the Ciao.read function, right?

That’s right:slight_smile:
Example code forthcoming

and change Ciao.read to Ciao.write

This is the code I used to test Ciao.write():

      /*
****************************************************************************
This is a modification of the Arduino.org RectClient example
for interaction with Blynk.
Ciao library is used to make Rest calls to the Blynk server on virtual pin V13,
the value obtained is then linked manually with D13 pin in the loop.


****************************************************************************
In the Blynk app:
Use a button on pin V13 in the app.
With your board build this circuit:
https://www.arduino.cc/en/Tutorial/Button

You will see app button following the hardware button.
****************************************************************************
*/
#include <Wire.h>
#include <Ciao.h>
#define CONNECTOR     "rest" // define connector type for the Ciao Library
#define SERVER_ADDR   "46.101.143.225" // blynk-clud.com IP address


const int buttonPin = 2;
const int ledPin = 13;
int buttonState = 0;         // variable for reading the pushbutton status

void setup() {
    pinMode(ledPin,OUTPUT);
    pinMode(buttonPin,INPUT);
    Ciao.begin();
}
void loop() {
  
      buttonState = digitalRead(buttonPin);
      if (buttonState == 1) {
      // turn LED 13 on:
      digitalWrite(ledPin, 1);
      } 
      else {
      // turn LED 13 off:
      digitalWrite(ledPin, 0);
      }
      String command1 = "/your_token/update/V13?value=";
      String command = command1 + buttonState;
      Ciao.println(command);
      Ciao.write(CONNECTOR, SERVER_ADDR, command);
    
  delay(50);
}


I get a lot of delay between the button and the hardware led and almost no delay between led and app button. I don’t know why.
@Costas Do you think that we are making too many requests to the blynk server with this scheme?
I’d rather avoid banning :stuck_out_tongue_closed_eyes:

20 times a second will probably not flood the server but you should look for a way to use the API outside of loop().

I have no idea on how to do that, but I’ll try in the next days.
@kagaya81 does this work also for you?

The code is using write pin value via GET

I think PUT doesn’t work because the hardware is not supported and the “arduino-blynk link” is made manually in the sketch.

This is a more complete and slightly optimized code based on ESP8266_http_API example:

/**************************************************************
 * Blynk is a platform with iOS and Android apps to control
 * Arduino, Raspberry Pi and the likes over the Internet.
 * You can easily build graphic interfaces for all your
 * projects by simply dragging and dropping widgets.
 *
 *   Downloads, docs, tutorials: http://www.blynk.cc
 *   Blynk community:            http://community.blynk.cc
 *   Social networks:            http://www.fb.com/blynkapp
 *                               http://twitter.com/blynk_app
 *
 * This example code is in public domain. This example is based
 * on ESP8266_http_API, it is only modified to run on UNO WiFi 
 * boards from arduino.org using the Ciao library.
 *
 **************************************************************
 * Project setup in the Blynk app:
 *  Two Value Display widget on V2 and V0
 *
 **************************************************************/

#include <Wire.h>
#include <Ciao.h>
#define CONNECTOR     "rest" // define connector type for the Ciao Library
#define SERVER_ADDR   "46.101.143.225" // blynk-clud.com IP address

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "YourAuthToken";

void setup() {
  Serial.begin(9600);
  delay(10);
  Ciao.begin();
  Ciao.println("WiFi connected");
}

void loop() {
  
  long value = millis();
  
  // Send value to the cloud with Ciao.write()
  // similar to Blynk.virtualWrite()
  
  Serial.print("Sending value: ");
  Serial.println(value);
  Ciao.print("Sending on V2: ");
  Ciao.println(value);
  String wcommand = String("/") + auth + "/update/V2?value=" + value;
  //Ciao.println(wcommand);
  Ciao.write(CONNECTOR, SERVER_ADDR, wcommand);
  
  // Read the value back
  // similar to Blynk.syncVirtual()

  Serial.print("Reading value: ");
  String rcommand = String("/") + auth + "/get/V2";
  CiaoData rdata = Ciao.read(CONNECTOR, SERVER_ADDR, rcommand);
  int rlenght = String(rdata.get(2)).length();
  String rvalue = String(rdata.get(2)).substring(2,rlenght-2);
  Serial.println(rvalue);
  Ciao.println("Reading V2: "+ rvalue);
  //delay(10);

  
  // Write the V2 value on pin D2 virtual and harware are now synced
  
  analogWrite(2,rvalue.toInt());
  //Serial.println(rvalue.toInt());
  
  // write again the value on pin V0 to experience the delay (more than 15 seconds)
  
  String command = String("/") + auth + "/update/V0?value=" + rvalue.toInt();
  //Ciao.println(command);
  Ciao.write(CONNECTOR, SERVER_ADDR, command);
  Ciao.print("Sent to V0: ");
  Ciao.println(rvalue.toInt());
  
  // For more HTTP API, see http://docs.blynkapi.apiary.io

  // Wait
  delay(50);
}

String parsing improved, the previous code was able to use only one digit.
Still using API in the loop()…

Here is the output:



@vshymanskyy do you think is enough for adding it on GitHub? Maybe other blynkers are interested.
Moreover, is there any possibility of getting fully support for the the UNO WiFi in the next future?

1 Like

reading virtual pin is fine…
but as soon as i used ciao function to write to virtual pin, i noticed a significant delay in the programme.

Wich example are you running? Post your code so I can check. I also noticed a delay of about 15 seconds for every loop in this one:

Hi there,

I was able to read and write to virtual pins with the examples posted above.

But I have a problem reading a time input widget from the app. I get back only 4 characters from the ciao read function. If i test the get command with the browser I get a lot more of data.

Has someone the same problem and has a solution?

Thanks in advance!

@ffutsi start a new thread in the “Help with my Project” category but provide all the information we need to be able to help you (hardware, software, iOS / Android, sketch etc).

Is there any indication yet IF/WHEN the Uno WiFi will be fully adopted by Blynk?

I too have had some success using the Ciao methods above, but I too am seeing substantial delays when writing values to Blynk, sometimes greater than 15 seconds. (I call my Blynk routine via SimpleTimer, and I’m only pushing two values every 500ms, so I know it’s not an issue with flooding.)

Any delays more than 1-2 seconds make this construct totally unusable for my applications. Would love to have full Blynk functionality for this board. Any info is appreciated!

Thanks.

1 Like

@Costas @Dmitriy

Any update to this? I have a system I’ve designed with the Uno Wifi, and will be commercializing it soon. Would love to be able to integrate Blynk into the product offering, but I don’t know if adding full Blynk compatibility for the Uno Wifi is even on your roadmap…?

Thanks.

@vshymanskyy would be correct person to tag here :slight_smile:.

@vshymanskyy

Thanks Dmitriy.

Vhymanskyy, any idea if native Blynk compatibility for the Uno WiFi will happen in the near future?

1 Like

No, we don’t support this board. Anyway we really welcome any community members willing to work on supporting this board.

Thanks. I realize there is no current support, I was asking if there are any plans to support it in the future? I guess the answer to that is no?

I suppose if you contact them on the business side, they might be able to work something out.

1 Like

Thanks Gunner, not a bad idea. Probably easier/cheaper to just switch to a different MCU though.

Anyone know of an Arduino-based board with onboard WiFi and multiple Analog inputs that is natively Blynk compatible?

We started with Arduino Uno with esp8266 attached, but that turns into a bulky solution with the external 3.3V power regulator, 3v->5v logic shifter, and mini breadboard.

Have also used the WemosD1 R2 with onboard WiFi, but our system requires multiple analog sensors that run on 5V logic, so an external 5V regulator and logic shifter is needed in this case too (plus the Wemos D1 only has one Analog pin).

That’s why Uno Wifi seemed like the perfect solution (Wifi on board, 5V, multiple Analog pins)…it just isn’t fully Blynk compatible.

Any suggestions?