Updates over Blynk.Air

Hello,

I was updating my devices over Blynk.Air and it works perfectly fine, not problems there so far.

As i was updating suddenly something held me thinking:
(PRO PLAN)

Assume i have 10 people invited to my org. And now i want to update those devices(ex. DHT SENSOR) (all 10) to new firmware with new features or bug fixes.

The problem is each device has its own template id and device name.

Having to store all the code for all 10 devices and later updating/bug fix the code on each one and then converting them into .bin and uploading one by one seems very hectic. This is my understanding as of now.

Is there a easy way of updating all devices at once ?

Why do they have different Template IDs if it’s the same device?

Similiar discussion in the thread below:

In, my case, each device can have a customized template (depending on customer’s requirements). Of course, this will not happen if you are selling a smart lamp, however, my application is not a smart device, it is a machine.

Its 10 devices for 10 people.
May be i did not explain the scenario properly.

Each people will have their own device and only can see and control their own device.

But being the org head i will be able to see all the devices. In this case the id’s for the devices will be different right ? Or can it be same for all 10 devices ?

It’s difficult to answer without the details of your setup. If you created one template and all 10 devices inherit this template, then you can update firmware in one batch.

I am failing to put my question across !!

Let me try again. Do not mind please.

For example:

Say a company sells a product(ex: Temp monitoring system) to a customer and that customer will be a part of the org.

And the company sells another 10 devices(same as above) to ten different customers.

Now total its 11 devices.

Now if i want to update all the devices at the same time, is it possible?

What if the device is transferred to the customer? Will then the company be able to update the devices over OTA ?

I am not ready to try this transferring device feature.
And loose a device. So i am getting these doubts.
Or else I would have tried myself.

All of the scenarios you described are covered by Blynk.Air.
All devices you have access to as a developer, can be updated in one firmware shipment as long as all of these devices have same templateID. AuthTokens and wifi credentials will not be overwritten with FOTA update

Same template id works as all the devices are under the same org right ?

Correct.

However I would clarify:
TemplateID created in a higher org can be used in all sub-organizations under

1 Like

Is your question more about the effects on updates when passing the 10 device limit on the Plus plan than managing templates? (I don’t know the answer, just wondering myself)

-Mike

Hello @Pavel and @Madhukesh

I just tried the following under the same template ID:

1-) Create a new device
2-) Update firmware with new BLYNK_DEVICE_NAME and BLYNK_AUTH_TOKEN (from the new device I’ve created)
3-) Download the new firmware using OTA into an existing device that was already connected (Expecting that AuthTokens would not be overwritted with FOTA update)

After FOTA was completed, the new device I created went on-line, indicating that AuthTokens was overwritted.

I looked into the OTA documentation and I did not find any instructions on how to perform batch OTA without AuthTokens being overwritted… How can I actually perform as you described above?

I think the test that you’ve described is rather different from the functionality that @Pavel has discussed.

If you have a template (let’s call it Template_A) and five boards that have had the same Edgent sketch uploaded to them. The sketch includes the Template_A as it’s BLYNK_TEMPLATE_ID

You then provision the five devices individually via the “+ Add device” functionality in the app, and input the SSID and WiFi password. At this point, each device is also allocated a dynamic Auth token.
These credentials are saved to the configstore, which by default uses EEPROM on the board.

Blynk will now show 5 devices, each with a different name (which by default is based on the BLYNK_DEVICE_NAME from the template plus a unique identifier, but which can be manually edited in the app by the user - assuming they have permission).

If you now make some changes to the sketch, what @Pavel is saying is that Blynk.Air can be used to ship that updated sketch to all 5 devices at the same time, and when you do this the WiFi credentials and the dynamically defined Auth tokens for each device, stored in EEPROM, will not be overwritten by the Blynk.Air process.

Pete.

1 Like

No.

Pete.

Why don’t I understand?
I can’t follow what you were asking.

Well, Blynk.Air is part of the Edgent functionality, and with Edgent devices are created, and auth tokens dynamically allocated via the “+ Add Device” function in the app.

@Pavel’s reply almost certainly assumes that this is the process you are using.

Maybe you need to explain the approach you are using in more detail?

Pete.

1 Like

As far as i understand, our bin file must have only template id and device name. Auth token should be added when we use the add device functionality from our phone.

This way when we do an OTA the auth token stays the same because its stored on EEPROM.

But i will create few dummy devices and check if that is what happens.

Btw did you try the OTA for different product? HAVE you inserted auth token manually for all your devices?

1 Like

@Hugo-BR
If you have inserted the auth token manually then you will have to update each and every device one by one. And you will have to maintain all the files/code for each device. And maintain a excel sheet with customer name and the auth token associated with.

This is definitely a huge task. Right now i am not able to think of any walk-around. May be there is a way for this, but i am unable to think of any at the moment. May be anyone from blynk can throw some light on this.

@Madhukesh re-reading this and adding-in the info provided in the later posts, I think I now understand the solution that @Hugo-BR has tested and found to be working.

Basically, it seems that he has implemented a system similar to Edgent, where the auth token is stored in EEPROM, which allows the code to be updated without overwriting the auth token.

Exactly how the auth tokens are inserted into EEPROM initially, or updated if they need to be changed, or how WiFi credentials are stored and updated, I’m not sure.

Either way, I think that @Hugo-BR now has a working solution.

Pete.

1 Like

Hi @Hugo-BR ,

I think (and hope!) you’ve solved a problem we have been dreading about for some time…
We also have devices which have no WiFi but use GSM communication, so we cannot use the Edgent way of provisioning.

So BLYNK_AUTH_TOKEN has to be hardcoded for each device separately …
As we are expecting to deliver 100+ devices in the near future, the firmware updates are giving us headaches. Like you already questioned:

  • Do we need to build a binary with a hardcoded AUTH_TOKEN for each separate device we’ve sold?
  • Do we need to define an Blynk.Air OTA update delivering that binary for each device separately?

So we are very interested in how you have solved this problem…

  • How do you update the device token used in Blynk during setup()
  • How do you initially store the correct auth_token in EEprom when manufacturing the machines?
  • Is the dev_token you are mentioning in this post an actual token, or just simplified for this posting?

Thanks in advance, I really hope this will help us

Personally, I’d use LittleFS or at the very least SPIFFS rather than EEPROM. It’s a much better storage systems which is more like FAT system used to store data on hard drives etc.

There are upload tools available for ESP8266 and ESP32 boards, but they require a degree of work in this type of scenario.

Pete.