Author Topic: Blynk USERS ? (IOS or Android app to control Arduino, RasbPi, ESP8266 over eth)  (Read 4181 times)

0 Members and 1 Guest are viewing this topic.

Offline JacquesBBBTopic starter

  • Frequent Contributor
  • **
  • Posts: 829
  • Country: fr
The blynk project http://www.blynk.cc was funded on Kickstarter,  but I had since not the time to experiment with it.
https://www.eevblog.com/forum/crowd-funded-projects/blynk-build-an-ios-or-android-app-to-control-arduino-rasbpi-esp8266-over-eth/msg600201/#msg600201

I just started today and I am really impressed  by the facility
with which you get a decent interface  for a sensor
(DHT22 in my experiment ) and actuator (a led)  in a very little time.
This was done on a NodeMCU  (ESP8266) with the arduino  interface.

And it works as well on Android and IOS.

Below is a dirty quick  code, just to show how little is needed.

I will be interested to  get feedback from some blynk  users  on eevblog
and will appreciate if they share here their applications.




Quote
#define BLYNK_PRINT Serial    // Comment this out to disable prints and save space
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include "DHT.h"

#define DHTTYPE DHT22   // DHT 22  (AM2302)

float humidity, temp;  // Values read from sensor
unsigned long previousMillis = 0;        // will store last temp was read
const long interval = 2000;              // interval at which to read sensor
DHT dht(D0,DHTTYPE,11);


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

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

WidgetLED led1(V1);

void setup()
{
  Serial.begin(9600);
  Blynk.begin(auth, ssid, pass);

  pinMode(D2,INPUT);
  dht.begin();
}

void loop()
{
  if (digitalRead(D2)==HIGH){ led1.on(); Serial.println("ON");}else{ led1.off();Serial.println("OFF");}
  Blynk.run();
  gettemperature();
  Serial.print(temp);
  Serial.print("  H: ");
  Serial.println(humidity);
  Blynk.virtualWrite(V2,humidity);
  Blynk.virtualWrite(V4,humidity);
  Blynk.virtualWrite(V3,temp);
  Blynk.virtualWrite(V5,temp);
 // delay(1000);
}


void gettemperature() {
  // Wait at least 2 seconds seconds between measurements.
  unsigned long currentMillis = millis();
 
  if(currentMillis - previousMillis >= interval) {
    previousMillis = currentMillis;   
 
    // Reading temperature for humidity takes about 250 milliseconds!
    // Sensor readings may also be up to 2 seconds 'old' (it's a very slow sensor)
    humidity = dht.readHumidity();          // Read humidity (percent)
    temp= dht.readTemperature();     // Read temperature as
    // Check if any reads failed and exit early (to try again).
    if (isnan(humidity) || isnan(temp)) {
      Serial.println("Failed to read from DHT sensor!");
      return;
    }
  }
}
 

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1989
  • Country: dk
Neat demo.

A few questions though:
1:
Is Blynk (server) using the "Cloud" , or can it be installed as standalone on a ie. RasPI / linux host ?
I mean can it run wo. connection to the internet, ie. behind a firewall denying connection to the internet.
I'll never base my IoT on a "foreign cloud service"

2:
How do you define the graphs (layout) on the phone ?
Are they made on the phone via some drag/drop, after installing the Blynk App  ?

3:
The included code seems to be for the ESP' , is it compiled via/on the ESP' arduino ide , on a win/linux devel system ?

/Bingo

« Last Edit: August 07, 2016, 07:10:56 am by bingo600 »
 

Offline JacquesBBBTopic starter

  • Frequent Contributor
  • **
  • Posts: 829
  • Country: fr
Neat demo.
Thanks .

Quote
1:
Is Blynk (server) using the "Cloud" , or can it be installed as standalone on a ie. RasPI / linux host ?
I mean can it run wo. connection to the internet, ie. behind a firewall denying connection to the internet.
I'll never base my IoT on a "foreign cloud service"

You can do both. You can use the free service that is provided by blynk, but they also released
in open source their server

http://docs.blynk.cc/#blynk-server
Do you can have your private server for running your blynk devices.
It can be implemented on a rasPi  or on a synology, or on other linux machine.
I have not done it yet.

Quote
2:
How do you define the graphs (layout) on the phone ?
Are they made on the phone via some drag/drop, after installing the Blynk App  ?
They are made very easily by drag/drop some widgets that you can then configure.
All this is sone on your phone/tablet. What is nice is that you do it once on one device, and it is
configured on all, android or ios (I have one android phone and two ipads and run the blynk app on all).


Quote
3:
The included code seems to be for the ESP' , is it compiled via/on the ESP' arduino ide , on a win/linux devel system ?

Yes, it was compiled on the arduino IDE on a Mac, but many other possibilities exist.
They have libraries for
-Arduino, raspPi, ESP8266
See the full docs http://docs.blynk.cc/
« Last Edit: August 07, 2016, 08:15:23 am by JacquesBBB »
 

Offline Kilrah

  • Supporter
  • ****
  • Posts: 1852
  • Country: ch
Nice, actually looks pretty much like what I was looking for, so I've just had a quick try.

Yep you can run it on your own server (installed and ran it on my C.H.I.P), and it does work fully locally even with no internet connectivity nor any tie to Blynk services.
Layout "projects" are made on the phone, but stored on the server so when you connect a new phone to the same server with the same account you'll be able to see existing projects. Works with multiple phones connected and using the same project at the same time too.

They do have a system of "energy points" that allows you a limited number of simulatneous widget instances on your account and requires payment for more on their service, BUT when you run your own server it's just a value in the user's config file that is trivial to set to whatever you want to i.e. no limitation.

I like  :-+
 

Offline TJ232

  • Frequent Contributor
  • **
  • Posts: 331
  • Country: 00
  • www.esp8266-projects.org
    • ESP8266 Projects
I have also give it a try few months ago and must say that I was impressed about how smooth & easy was the entire process!

My Project: Blynk MPDMv4 AC MAINS Dimmer - ESP8266

What do you need:
   - Blynk
   - Arduino IDE
   - MPDMv4 AC MAINS Dimmer
   - a ESP8266 Board


Code:

Code: [Select]
#define BLYNK_PRINT Serial    // Comment this out to disable prints and save space
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>

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

void setup()
{
  Serial.begin(9600);
  Blynk.begin(auth, "WIFI_SSID", "WIFI_PASSWD");
}

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

Video:


PS: sorry for the bad sound, something went wrong to encoding phase :(
« Last Edit: August 08, 2016, 04:10:15 am by TJ232 »
ESP8266 Projects - www.esp8266-projects.org
MPDMv4 Dimmer Board available on Tindie: https://www.tindie.com/stores/next_evo1/
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf