blynkkk / blynk_Issues

6 stars 6 forks source link

Simple example #34

Closed Johnep101 closed 3 years ago

Johnep101 commented 3 years ago

I only have iOS devices (😒) so is there a really simple example somewhere that allows me to connect a device to the server without having an app to connect the device to the local WiFi router and cloud server?. I just want to get a device (esp32 dev board) up and running and get data onto the Blynk dashboard. Something like the standard Blynk.begin(auth,said,password) method? Thanks

Peterkn2001 commented 3 years ago

Install the 1.0.0beta3 library and use the ESP32 WiFi example.

In the Web portal, add a template that's based on an ESP32 board, then create a device based on that template. The Template screen will give you two lines of firmware configuration, copy these and add them at the very beginning of your sketch. In the Device > Device Info screen you'll find the Auth Token (left hand column, half way down) click on the green square to the right to copy this to the clipboard... image

and paste it into your sketch in the normal way.

Pete.

Johnep101 commented 3 years ago

Hi Pete, Many thanks I was over complicating things thinking I needed to add the BlynkEdgent.begin(); and BlynkEdgent.run(); with all the associated libraries. However :- having copied and modified the ESP32_wifi example and adding the lines you suggest the device hangs up at Blynk.begin(auth, ssid, pass); auth is from the device as you suggest and ssid and pass are my normal values. The sketch came from Arduino>Examples>Blynk>Boards WiFi>ESP32_WiFi I note that there is a Arduino>Examples>Blynk>Blynk.Edgent library with an ESP32 example which is the one I started with, but I just can't modify this over complex example.

Peterkn2001 commented 3 years ago

Hi John, what do you see in your serial monitor?

Pete.

Johnep101 commented 3 years ago

Hi Pete, this is what I get:- 13:31:14.879 -> +Fd⸮⸮ /⸮bA&P⸮2⸮L⸮⸮⸮starting 13:31:15.184 -> [42] Connecting to Sol2.4 and the section of code:-

Serial.begin(9600); Serial.println("starting"); Blynk.begin(auth, ssid, pass); Serial.println("Connected");

Peterkn2001 commented 3 years ago

Looks to me like your WiFi credentials are incorrect, as you'd expect to see some sort of connected message and a a local IP address before attempting to connect to the Blynk server.

Pete.

Johnep101 commented 3 years ago

Hi Pete, I checked to credentials and they looked fine so I tried another board, that didn't work either so I reverted back to an old auth code I had an app for, that didn't work either. SO I rechecked the credentials and sure enough the wifi SSID was incorrect! so much for men checking things. I then got the start up banner and the error invalid Auth Token, I remember your earlier comments on this, using the new server doesn't work. so went back to the original code and happiness around I have data on the server! (Just need the IOS app now Dmitriy!) So, Again, Pete my grateful thanks for your work!

doom369 commented 3 years ago

@Johnep101 iOs app is planned to be released on Friday.

Johnep101 commented 3 years ago

Brilliant thank you 👍

Johnep101 commented 3 years ago

On my device dashboard I can see data coming in but on the device info panel it says status offline. Is this because I do not have an associated app yet?

doom369 commented 3 years ago

@Johnep101 you need to refresh the page. That's a bug, it was fixed. Will deploy it soon.

Johnep101 commented 3 years ago

Ok it's just switched to online 👍

Johnep101 commented 3 years ago

Many thanks and thanks for the opportunity to trial this incredible project

doom369 commented 3 years ago

@Mark-Pan please add this answer to the docs for "static provisioning (old blynk way)" so we don't miss it.

Mark-Pan commented 3 years ago

Added to https://docs.blynk.io/en/tutorials/connecting-arduino-devices

Johnep101 commented 3 years ago

Hi Dmitriy, Sorry for contacting you directly but I think there will be a lot of confusion when you go public with this new Beta. Firstly you need a whole bunch of new examples, the current ones just will not work and the the two given ones, although complete, are way to complex for most builders. Secondly you need a new repository on GitHub - completely separate from the current Blynk. You also need to divorce, COMPLETELY the old library and the new Beta library. It is very difficult to maintain legacy projects and new projects. Just completely separate the two. Below is a simple device that works, demonstrates input / output and I’m sure will help newbie builders like myself.

I think you have a fabulous system and being a retired engineer I’m happy to help develop examples for you. I really want this system to work so I have copied a simple sketch below which might help newcomers.

Love the dashboard concept!

/*


Blynk library is licensed under MIT license


 Sketch Version 1.0 John Parsons
         April 2021
                 NOTES

    Compile with Blynk Beta library 
    for use on ESP32 Dev module 
    This is a test unit for the new Bynk Beta devices
    reads a moisture sensor value every 10 seconds and posts to the app and new Blynk dashboard

*****/

/* Digital Pins on:-

define BLYNK_TEMPLATE_ID "xxxxxxxxx" // from template in dashboard

define BLYNK_DEVICE_NAME "xxxxxxxxxx" // from template in dashboard

define BLYNK_PRINT Serial

include

include

include

char auth[] = "xxxxxxxxxxxxxxxxxxxxxxxxxxx"; // from device dashboard

char ssid[] = "xxxxxxx"; // ssid of wifi network char pass[] = "xxxxxxxxxxx"; // password of wifi network float Moisture = 0; String Version$ = "Ver 1.0";

define LEDpin 2

define ADC 34

BlynkTimer timer;

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

Serial.println("starting"); Blynk.begin(auth, ssid, pass); Serial.println("Connected"); Blynk.virtualWrite(V0, 0.0); Blynk.virtualWrite(V1, Version$); timer.setInterval(10000L, checkMoist); // update every 10 second }

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

void checkMoist() { Moisture = analogRead(ADC) ; Serial.println(Moisture); Blynk.virtualWrite(V0,Moisture ); digitalWrite(LEDpin,255); // turn on led delay(500); digitalWrite(LEDpin,0); // turn off led

}

On 30 Mar 2021, at 15:04, Dmitriy Dumanskiy @.***> wrote:

@Johnep101 https://github.com/Johnep101 iOs app is planned to be released on Friday.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/blynkkk/beta/issues/34#issuecomment-810283211, or unsubscribe https://github.com/notifications/unsubscribe-auth/AM4ADXL5OUK7QQAQGRW6V43TGHK7JANCNFSM42BUSECQ.

doom369 commented 3 years ago

You also need to divorce, COMPLETELY the old library and the new Beta library.

I think in the same way. However, I not the only person who makes the decisions. So many decisions are still not final and under the discussion. We'll see. But we have to release what we have, otherwise, we would delay the Beta more and more.

I think you have a fabulous system and being a retired engineer I’m happy to help develop examples for you.

That's really cool. Maybe @vshymanskyy could somehow guide you here. And thanks for the shared example

Peterkn2001 commented 3 years ago

I'd agree. The current Blynk community forum is plagued with issues caused by people downloading the beta libraries. Even the new Beta-3 library isn't the solution to anything other than the failure to connect issue.

These are two separate products and need to be treated as such.

Pete.

Peterkn2001 commented 3 years ago

@Johnep101 iOs app is planned to be released on Friday.

@doom369 Any updated timeline on this, using my old Android tablet is driving me nuts!

Pete.

Johnep101 commented 3 years ago

Given up on Android 😱😱😱

Happy Easter!

John

On 3 Apr 2021, at 00:07, Pete Knight @.***> wrote:

 @Johnep101 iOs app is planned to be released on Friday.

@doom369 Any updated timeline on this, using my old Android tablet is driving me nuts!

Pete.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

doom369 commented 3 years ago

@Peterkn2001 It has too many bugs :(. So we'll need few more days. @eepetrash FYI