Blynk connection

I need to indicate with an LED in my Blynk App that there is connection between Blynk and the Arduino device. If there is communication, the LED will turn green; otherwise red.

If there is communication I can turn it on without problem in green; but if there is no communication how I can change it to red.

there’s probably a way to do it by coding? have you tried that?

This is the issue. I can send the command to change the LED color from the sketch to the Blynk App, but if it is no communication, how does the instruction get to the Blynk server? I think the solution must be on the server.

What’s wrong with the built-in offline notification within the app, and if necessary an additional notification widget with the ‘notify when hardware goes offline’ option turned on?

Pete.

You could try logical control

if(blynk.connected())

void blynkCheck() { if(Blynk.connected()) { Serial.println("Your connected"); } else { Serial.println("Connection Error to blynk server"); } }

this works so instead of printing you change your LED

image

That feature is very good. Unfortunately only last a few seconds. The users need to know in every moment if the device is online. They need permanent information visual of the device status.

The problem is not in the device side. The user sees the Blynk App and seeing it needs to know if the device is online or not.

@LMario The blynk app informs you if your online or not so you lost me there.
The sketch I showed you can be ran with interval of your choice .

Yes, your code works very well in the device side, so I can display console messages without problem.

But how I can make the Blynk App user (changing a LED color) know that situation if there is no connection at that time and the user does not have access to the Arduino console, but only to the Blynk App.

The button with the RED icon tells me the hardware and the application have not connected and thus it is offline

Is this what u mean pal ?

Notice when I press it I’m notified the lats time this hardware connected

The status is available within the app at all times. The notification alert will tell you (if needed) that the device is offline without you going into the app to check.

The key, which I think is the bit that you’ve failed to notice, is the icon on the title bar of the app that looks like an MCU. It has a red dot with a number in it if one ore more devices in the project are offline. Tapping the icon will show you which devices, and how long they have been offline for.
If you tap it when all the devices are online (no red dot) then it will tell you how long the devices have been online for.

Do you really need something different to this???

I’m off to charge my iPhone…

Pete.

You are right, I had not noticed it. Thank you.

What I need is the green LED like the one in the black row below to indicate the device is online. I suppose it changes to red (or something similar) when the device is disconnected.

Previously there was a LED with a heartbeat (something it can be managed from the sketch when the device is online) but the user needs something that does not blink.

Is this a project for a customer?

Pete.

Yes, it is.

In that case you should be discussing your requirements with the guys over at Blynk.io
If Blynk is being use for commercial purposes, or being re-sold by you as part of a packaged solution, then you need to sign-up to a commercial subscription.

Pete.

1 Like

Do not worry. I am working under the Blynk regulations.

All I need to know is if I can implement that functionality, or it is definitely not possible.

Luis

I’d suggest that you elaborate on this statement:

before we go any further.

Pete.

I am sorry, but I can not give information of that kind here. It is a technical consultation forum.

I will explain to the user that it is not possible to implement this feature since all the control of the Blynk App is done from the device and if there is no communication, the GUI can not be updated. No problem. Do not worry.

Best Regards.

Luis

@Pavel, you may want to take a look at this one, as I think there’s a possibility that forum user @LMario may be using the Developer version of Blynk for commercial/business purposes.

Pete.

@Pavel I think @PeteKnight fell into a rare state of psychosis. LOL.

He wants I tell him what is the Blynk client (a very good client) who I work for.