Why don't you use mos tool for building and flashing?
Thanks @wasabi !
You're describing the exact use case we already handle with our configuration subsystem. Our customers asked for that - and we provided a so called "vendor layer". Please take a look at:
If you read it until the section that describes layers, you'll get the idea. Our customers use that to do one-time, after-factory device configuration, to set unique device parameters. They configure the ACL to make it impossible to change, unless a full reflash is done.
Could you review the mechanism and see whether it suits you, please?
if need be, we could add this way of customizing devices, but it's kind of ad-hoc and requires reserving a sector on the device. mos put conf_vendor.json should not take much more time (basically, just waiting a couple seconds for device to boot up) and already works today.
mos put conf_vendor.json
you can upload with post, but you don't have to. mos put --port=/dev/ttyUSB0 conf_vendor.json will do it. it will use the same serial connection that has just been used for flashing, so it will not need to wait for wifi or anything. it will only add a couple seconds to your programming time.
mos put --port=/dev/ttyUSB0 conf_vendor.json
you can also slipstream the file into the filesystem image before programming using SPIFFS tools here: you'll need to unspiffs files into directory and then mkspiffs again. but really, in the scheme of things, flashing will take about 10 seconds anyway, so 2-3 for mos put will not make a difference.
i just tested: with mos flash and mos put back to back, the latter takes 1.7-1.9 seconds to establish a connection and upload a small file.
OK, thank you.
Soon We will talk with the pcb printer to understand how they can perform mass programming.
I will try.
Hi , please, let me understand.
When you say:
it's kind of ad-hoc and requires reserving a sector on the device.
I immagine that the mkid.py generate an id and psk but I can't use it.
In older version was easy to use this id, but now I dont't find any reference.
Why you write about this possibility and now is not possible? Older version have had the reserved sector?
In that file ('flashing.md') there's a clear reference to esptool, bin file, MFT.
Maybe you will change soon, but this programming mode is still valid.
Another question please: the vendor file isn't present by default, I have to write it from zero, right?
Yes, vendor file should be written from scratch.
Here's an example:
Could you describe your product in detail, in order to get a clear idea about this ID/PSK use case you're talking about?
the fact that you're working with old code complicates the situation a bit, as there have been a lot of changes.
nevertheless, if you tell us exactly at what point you made the copy, we should be able to better suggest the best approach. assuming you used Git to clone the repo, you just need to tell us the latest commit id (at the top of git log output).
I always use the mos tool, for debug, flash new compiled fw, upload file, ecc. I don't know how a big factory could flash a lot of esp, maybe esptool is not the better way, but if I could give them the zip with the bin file and also a possibility to put the univocal id in another bin file ready to flash, I think this should be a simple solution.