questions about manufacturing utility

User avatar
mzimmers
Posts: 309
Joined: Wed Mar 07, 2018 11:54 pm
Location: USA

Re: questions about manufacturing utility

Postby mzimmers » Fri May 17, 2019 10:01 pm

Hi Roland -

Thanks for the reply. I'm not sure whether it's not working, or if I'm doing something wrong. I'm trying to use the "REPEAT" tag, like so:

config.csv:

Code: Select all

CD_FACTORY,namespace,  
SERIAL_NBR,data,string
MAC_ADDR,data,string
NVS_LABEL,data,string,REPEAT
DEVICE_NAME,data,string,REPEAT
VERSION,data,string,REPEAT
values.csv:

Code: Select all

SERIAL_NBR,MAC_ADDR,NVS_LABEL,DEVICE_NAME,VERSION,SSID,PSK,IPSOURCE,IPADDR,IPGATEWAY,IPSUBNET,NTP_SERVER,TIMEZONE,LED_DUTY_BATT,LED_DUTY_LINE,BUZZER_DUTY,AES_IV,AES_KEY
123456789,00:11:22:33:44:55,"Cyberdata, Inc.","Wifi 
Button",1.0.0.0,mz_eng,xxx,DHCP,10.10.10.10,10.0.0.1,255.0.0.0,pool.ntp.org,"PST8PDT,M3.2.0/2,M11.1.0",xxx,xxx
987654321,55:44:33:22:11:00
And I get this error message:
$ mfg_gen.py --size 0x4000 --conf mfg/config.csv --values mfg/values.csv --prefix nvs

Oops...Number of values is not equal to number of keys in file: mfg/values.csv at line No:3
Looks to me like I'm setting it up properly; can you see anything wrong?

Thanks...

ESP_Shivani
Posts: 4
Joined: Mon May 20, 2019 8:45 am

Re: questions about manufacturing utility

Postby ESP_Shivani » Mon May 20, 2019 9:13 am

Hi mzimmers,

I believe your input in the values line is a mismatch.
I believe you wanted to match values: "PST8PDT,M3.2.0/2,M11.1.0" with with keys: TIMEZONE,LED_DUTY_BATT,LED_DUTY_LINE,
is that right ?
Could you please remove the double quotes from the values. Because of the double quotes it is being considered as one value.

Also, this -> (last line) 987654321,55:44:33:22:11:00 is being considered as a new line (hence it is showing the error at line no. 3).
There is no comma between the xxx value and this line: 987654321,55:44:33:22:11:00.
Could you please recheck the keys and values mapping ?

User avatar
mzimmers
Posts: 309
Joined: Wed Mar 07, 2018 11:54 pm
Location: USA

Re: questions about manufacturing utility

Postby mzimmers » Mon May 20, 2019 1:49 pm

Hi shivanit -

The term "PST8PDT,M3.2.0/2,M11.1.0" is indeed supposed to be one item; that's the reason for the double quotes.

I want the last line to be considered a new line. If I understand the docs, by using the REPEAT tag in my config file, I should only need two fields in my values file. But this is what I wanted Jerome or someone to confirm for me.

ESP_Shivani
Posts: 4
Joined: Mon May 20, 2019 8:45 am

Re: questions about manufacturing utility

Postby ESP_Shivani » Tue May 21, 2019 5:05 am

Hi mzimmers,

The REPEAT tag is only applicable for the keys for which it is specified in the config file.
If you have other keys in the values file (which are not present in the config file), a value (a blank value or specific value) is expected for it for each line. (This is the current functioning of the utility).
You would have to keep the entries empty separated by comma (if you don't wish to add a specific value) in the values file.
You can refer to REPEAT tag section here in the docs: https://docs.espressif.com/projects/esp ... alues-file

User avatar
mzimmers
Posts: 309
Joined: Wed Mar 07, 2018 11:54 pm
Location: USA

Re: questions about manufacturing utility

Postby mzimmers » Tue May 21, 2019 2:27 pm

Hi Shivani -

If I understand you, the 2nd entry in my values file was missing a bunch of commas. So, I added them. Here are my two files now (this time I'm posting the complete files to avoid confusion):

config.csv:

Code: Select all

CD_FACTORY,namespace,  
SERIAL_NBR,data,string
MAC_ADDR,data,string
NVS_LABEL,data,string,REPEAT
DEVICE_NAME,data,string,REPEAT
VERSION,data,string,REPEAT
SSID,data,string,REPEAT
PSK,data,string,REPEAT
IPSOURCE,data,string,REPEAT
IPADDR,data,string,REPEAT
IPGATEWAY,data,string,REPEAT
IPSUBNET,data,string,REPEAT
NTP_SERVER,data,string,REPEAT
TIMEZONE,data,string,REPEAT
LED_DUTY_BATT,data,string,REPEAT
LED_DUTY_LINE,data,string,REPEAT
BUZZER_DUTY,data,string,REPEAT
AES_IV,data,string,REPEAT
AES_KEY,data,string,REPEAT
And values.csv:

Code: Select all

SERIAL_NBR,MAC_ADDR,NVS_LABEL,DEVICE_NAME,VERSION,SSID,PSK,IPSOURCE,IPADDR,IPGATEWAY,IPSUBNET,NTP_SERVER,TIMEZONE,LED_DUTY_BATT,LED_DUTY_LINE,BUZZER_DUTY,AES_IV,AES_KEY
123456789,00:11:22:33:44:55,"Cyberdata, Inc.","Wifi Button",1.0.0.0,mz_eng,C2y5B5e5R3,DHCP,10.10.10.10,10.0.0.1,255.0.0.0,pool.ntp.org,"PST8PDT,M3.2.0/2,M11.1.0",9,2,50,000102030405060708090a0b0c0d0e0f,603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4
987654321,55:44:33:22:11:00,,,,,,,,,,,,,,,,
Now, when I run mfg_gen.py, it runs without error, but:

1. It produces 17 sets of files, not 2 as I'd have expected.
2. The first file contains correct information (for the first entry in the values file).
3. Files 2-17 are progressively filled out for the second entry in the values file. That is:
file 2 has field 1 filled out
file 3 has fields 1 and 2 filled out
file 4 has fields 1, 2 and 3 filled out
...
file 17 has all 16 device-specific fields filled out

What am I doing wrong to elicit this behavior?

ESP_Shivani
Posts: 4
Joined: Mon May 20, 2019 8:45 am

Re: questions about manufacturing utility

Postby ESP_Shivani » Wed May 22, 2019 5:42 am

Hi mzimmers,

Yes comma separation in values file was required.
However, the output you are getting is not correct behaviour. It is a bug.
I have added the fix. Will let you know once it is merged into the branch.
Thanks for sending in the detailed file.

ESP_Shivani
Posts: 4
Joined: Mon May 20, 2019 8:45 am

Re: questions about manufacturing utility

Postby ESP_Shivani » Wed May 22, 2019 9:11 am

Hi mzimmers,

I am sharing the fix so you can apply the patch from here. Please let me know if anything.

User avatar
mzimmers
Posts: 309
Joined: Wed Mar 07, 2018 11:54 pm
Location: USA

Re: questions about manufacturing utility

Postby mzimmers » Wed May 22, 2019 2:03 pm

Hi Shivani -

Thanks for the patch; it looks like it's working properly now. Which release will this patch appear in?

I'd like to propose an enhancement to this tool. We're planning on using it to create nvs files that contain factory defaults for the units we manufacture. It would be very helpful if the name of the generated csv/bin files matched a unique field from the master values file. In our case, we'd like to name the file after the serial number, so from the above example, it would be something like:

123456789.bin
987654321.bin

This would make the tool a lot easier to use. I'm sure we're not the only ones who would find this useful.

Thanks again for the assistance on getting this working.

Who is online

Users browsing this forum: No registered users and 20 guests