My devices are online but cannot communicate from the App or Web

Hello,
I have 3 devices ESP32 and everything was perfect untill I tried to send a command from Node-Red using Blynk Pallete “Write” to a Virtual Pin… I works and I can send the value and I see it changes on the APP. It look quit sure that I can communicate with the Server but the Server doesn’t communicate with any of the 3 devices… WHow can I fix…?
All devices appears Online but I cannot send or receive anything from the APP or even from the Web… How can I get back control of my devices…

I also tried to do Blynk Air OTA but the status stays on LIVE and when I download the report it shows this:
CSR1 1CH TTGO R64,108855,“2024-01-05 12:12:55”,“STARTED”
CSR1 1CH TTGO R64,108855,“2024-01-05 12:13:08”,“STARTED”
CSR1 1CH TTGO R64,108855,“2024-01-05 12:13:08”,“REQUEST_SENT”

Name: New Shipping Jan 05, 2024
Status: running
Shipment start/end date: 2024-01-05 12:13:08 - 1970-01-01 01:00:00
Number of devices: 1
Firmware info:
Version: 0.0.0
Firmware type: TMPL5Y2na6zpd
Board type: ESP32
Build date: Jan 5 2024 02:24:36
Md5Hash: 43CD90029B9C371CDD347DF3CCA7AB6E
Stats for devices:
2 started
1 request sent
0 firmware requested
0 firmware uploaded
0 success
0 upload failure
0 download limit reached
0 rollback

You can download it by clicking the button below

Please help it is very urgent since I cannot use any of my devices…
Thanks

I assume you mean that you’re using the Blynk IoT contrib that you’ve installed via Pallet Manager?

What Blynk IoT client connections have you set-up in Node-Red, and what Auth token(s) are you using in these connections?
How do these auth tokens compare to one that you are using on your ESP32 devices?

TBH, the best approach is not to run Blynk code on your ESP devices, and to have them communicating with Node-Red via MQTT.

Pete.

Thanks for your feedback,
I’m using AWS IO Core as MQTT broker to communicate with all the 3 devices in parallel to Blynk App on my mobile, I can send a command from the mobile App and the same command from AWS through Node-red and it works

In AWS I’ve configure the 3 device and it works.

In Node-Red I’ve installed Blynk Palettes but I don’t use them, I use Node-Red to commnicate with the 3 devices usign AWS MQTT.

One thing strange happen:
If I connect the Node-Red all the 3 device becomes on online, seen on the App and also API.
Once I disconnect Node-red all the 3 devices becomes Offline and stay there until I run again Node-Red.

Using the API I can read the status of devices and Virtual Pin when the are online but I cann’t write anything to the Vpins or Physical Pin.

I just tried to use also a swtich in Node-red with Blynk Write Pallete and it also worked…
image

Why Blynk is not able to receive the Commands from anywhere niether App nor API even the Console…

The devices can receive commands only from Node-Red usign AWS.

Plese help

Is this a known issue, if so you are completely right but how can I fix…the problem is that I’m not able even to send the OTA to remove MQTT because the devices are remote …

The main issue now is that the BLYNK_WRITE in my ESP32 is not triggered anymore :

Here is also the Node-Red Log from the Dos Command.


Node-Red but not from the APP or API

You’ve provided lots of info, but none that I can really make much sense of.

As I said earlier, you’d be better not running lynk on your devices, and having a single device configured in the Node-Red contrib.
The drawback to doing this is that you can’t use Blynk.Air to update the devices, because as far as Blynk is concerned there is just one device, which is your Node-Red connection.

Maybe this topic will help you understand my approach…

Pete.

I understand but for sorry too late to take in consideration your thoughts :smile:
This means that the only way to get my devices works is to have a phyiscal access using the USB cable and Arduino IDE …

Still not understanding why hte BLYNK_WRITE is not triggered in the Device .

It looks that when I write a Virtual Pin using API , I communicate only with the server but not the device…and this is very ODD… :thinking:

Now I removed the Blynk wrtire from Node-Red and all the 3 devices shows Offline, but when I communicate with MQTT the device responds to the Subscribed Topic and send the value to Blynk Terminal on the APP even it shows Offline… Very Wear isn’t?

I have no way to make sense of what you’ve just written without significantly more information.

Pete.

My devices was working until this morning using Blynk App and MQTT from Node Red in the same time.

This morning I installed Blynk Palette in Node Red , and sendmt one Write to one Virtual Pin successfully…

Suddenly Blynk_Write in my esp32 code is not triggered anymore. And the App shows Offline… but MQTT still working Nd Blynk Terminal in Esp32 also works.

I removed the Blynk Write from Node red to have same situation of yesterday…

But The Blynk App still not working because the Blynk_Write is not triggered anymore on the ESP32…

What else info you need to help me .
Thanks

Once again, I assume that you are referring to the Blynk IoT contrib, installed via Pallet Manager?
I asked you a question about Auth tokens, which you didn’t answer…

If you’ve added a Node-Red connection to Blynk using the same Auth token as one of your existing devices then the Blynk server won’t allow your ESP32 device running that Auth token and your Node-Red “device” using that connection to be active at the same time. The last device to connect with that Auth token will be online, and the other device will be disconnected.
Auth tokens need to be unique, and the server doesn’t allow tow concurrent connections with the same Auth token.

This is why I said that it’s better to have a single Node-Red device and not to run any Blynk code on your ESP32 devices.

Pete.

Thanks again, now it is clear for me…

Yes I have assigned Node-Red the same Auto Token of the device thinking that I could control the device from Node-Red as if I control it from Blynk and this was my mistake to understand the concept of Blynk Palette with Node-Red is that Blynk with Node-Red simulates the device … Node-Red becomes device …

Is there any way to disconnect the Node-Red device and reconnect the original esp32 device?..

Thanks

It’s a contrib, not a palette.

Removing the connection and re-deploying will end the Node-Red connection.

Whether your ESP32 device will re-connect without being power cycled depends on the sketch you’re running.

Pete.

I have it in my Sketch if Blynk is not connected for 5 minutes the ESP32 restarts but it didn’t…

I removed completely the Node-Red Contrib, disconnect from Node-Red… But the device still connected to Blynk server and send some data on the Blynk Terminal in my App… But not triggered in Blynk-write in the sketch and shows Offline while it is online…

I really don’t understand what you’re saying.

Pete.

In my Sketch I have the logic to restart the device in case of loss of communication with Blynk server and it works since years…

It doesn’t work now because the device still connected with the Blynk server.

The proof that is connected is that when I publish MQTT to the device it receives it and send some data to Blynk-Terminal on my phone… for me this means that device still connected…

But on the console it shows device offline and when I send any data to the device from Blynk app or API the device doesn’t react as I said because the Blynk -Write in my Sketch is not triggered even the device is connected…

I think I have to recycle the power physically in local but this is a BUG in Blynk for me…

I will try also to. Change the credentials of the device , template ID for ex, from the console hopping the device will not recognise it and will disconnect and activate the reboot logic in the sketch…

Hope this will clarify the issue…

Thanks

More likely a bug in your sketch, but impossible to say based on the info you’ve provided.

I don’t think that will work.

Mixing Blynk and MQTT code is a bad approach in my opinion. Stick to one or the other, and if you want to use Node-Red then that should be MQTT code on your ESP32 devices.

Pete.

I agree with your second sentence but not the first one since I use this sketch since more than 3 years…

Best regards
Bek

But this is the first time you’ve caused the device to be kicked-off the Blynk server by re-using it’s Auth token, so the fact that it’s worked fine for 3 years isn’t really relevant to understanding whether there is an issue with the logic of the sketch.

Pete.

Sorry Pete, No, I tested it many times on purpose believe me… If the Blynk_Terminal works it means that the device is connected to the server… the BUG is that as said the Blynk_Write in my sketech is not triggered . Thus, for me it is a BUG unless you can explain why Blynk_Terminal works and Blynk_Wrtie no also the device appears Offline while Blynk_Terminal works…

The device is connected this why the Reboot logic is not activated…Believe me… If you like I can post the code …

Regards

I’d suggest that when you have physical access to the device you try to recreate the situation. Once you are able to do this then try to simplify your code so that it is as stripped-down as possible and the issue is still able to be reproduced.

Once you’ve done this then provide as much information as possible to allow this issue to be replicated by others.

If your device hasn’t been updated for 3+ years then you’ll be running old versions of the Blynk library and ESP32 cores, so updating these may make tge issue impossible to replicate, but if you are able to replicate the issue then make sure that yo take care to document your library and core versions, along with versions of any other libraries (PubSub client for example) that can’t be removed when stripping-down your code, and include this information in your bug report.

Pete.

1 Like