Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not generate any files #1222

Closed
isj4 opened this issue Nov 30, 2023 · 11 comments
Closed

Does not generate any files #1222

isj4 opened this issue Nov 30, 2023 · 11 comments

Comments

@isj4
Copy link

isj4 commented Nov 30, 2023

I cannot get Zap to generate any files.

Ubuntu 20.04.6 LTS, zap version embedded in SSv5 (2023.9.22):
First try: [Generate] lets me select a directory to generate files in but it doesn't generate any files. No error or warning is shown.

When adding an endpoint what I select is:
endpoint 1, HA Home Gateway / energy management system 0x0050
network 0
profile id 260
version 1

On startup Zap shows a notification, and it's a warning:
/home/isj/SimplicityStudio_v5/developer/adapter_packs/zap/resources/app.asar/zcl-builtin/silabs/zcl.json
Warnings
Check type contradiction in XML metadata for ColorControlOptions with type BITMAP8
Check type contradiction in XML metadata for LevelControlOptions with type BITMAP8
Check type contradiction in XML metadata for BarrierControlBarrierPosition with type INT8U
Check type contradiction in XML metadata for GpPairingConfigurationAction with type BITMAP8
Check type contradiction in XML metadata for BillingPeriodDurationUnits with type INT24U

Is that what's preventing it from generating files?

On subsequent tries I sometimes get:
isj@ubuntu2004:~/SimplicityStudio_v5$ ./developer/adapter_packs/zap/zap
\U0001f527 Using state directory: /home/isj/.zap
[Error: SQLITE_ERROR: no such table: SETTING] {
errno: 1,
code: 'SQLITE_ERROR'
}

Deleting /home/isj/.zap seems to clear that error.

I also tried:
Windows 10, zap version embedded in SSv5: [Generate] lets me select a directory to generate files in but it doesn't generate any files.
Which results in the same warning and behaviour as in SSv5+ubuntu version.

So it seems it's a cross-platform bug, but I assume it does work for some people, which leaves me wondering what's special about my setups / selections.

I also tried:
OpenSuse 15.4, Zap v2023.11.13. [Generate] shows directory selection dialog, but selection cannot be made. Using default selection and [generate] does not produce any output files.

I'm not sure what else I can provide that will enable you to replicate this bug.

@paulr34
Copy link
Collaborator

paulr34 commented Dec 6, 2023

@isj4 can you try with the very latest? please

@paulr34
Copy link
Collaborator

paulr34 commented Dec 6, 2023

@isj4
Copy link
Author

isj4 commented Dec 7, 2023

I tested that version now.
Downloaded ZIP file and unpacked on Ubuntu 20.04.6 LTS in a VM.

I started "zap" directly on the command line, created a minimal zigbee project "Zigbee HA gateway...", saved, and then pushed [generate]. Result:

A popup-notification appears with:

zap
"" is ready

But a file location picker window popped up in the background.

No location/directory seems selectable in that picker, except the "recent/home/desktop/documents/downloads/..." shortcuts.
I selected "Downloads" and pressed the green [Generate button]. Window closes. A sort-of progress-bar line flashes in the main window, and nothing has been generated. No warnings, no errors.

I'm wondering if Zap relies on some shared library but doesn't detect its non-presence and simply fails silently.

@paulr34
Copy link
Collaborator

paulr34 commented Dec 7, 2023

@isj4 yeah, you need to select a gen-templates file

good point, whatever is happening, it should tell you

@isj4
Copy link
Author

isj4 commented Dec 7, 2023

Which "gen-templates" do you refer to? The .slcp files or something similar? It is not obvious to me what it might be.

@paulr34
Copy link
Collaborator

paulr34 commented Dec 7, 2023

look up "gen-templates.json" in the SDK

@SimpliPHYd
Copy link

Any luck with this issue? I am having the same problem

@isj4
Copy link
Author

isj4 commented Dec 13, 2023

I haven't had time to try yet. I did locate the mentioned file in the Gecko SDK: ./protocol/zigbee/app/framework/gen-template/gen-templates.json

@SimpliPHYd
Copy link

SimpliPHYd commented Dec 13, 2023

Ok I got it working!
run the zap tool with the following arguments:
./zap --logToStdout --gen <path_to_template>/gen-templates.json --zcl <path_to_zcl.json>/zcl.json

You should also be able to generate the files without specifying the zcl.json file and using the default one:
./zap --logToStdout --gen <path_to_template>/gen-templates.json

I'm not sure if this is documented anywhere but I could not find any documentation on how to run zap.
I had to look at the scripts from connectedhomeip repo that are using zap.

If anyone knows where this is documented, could you point me in the right direction.
Thanks!

@brdandu
Copy link
Collaborator

brdandu commented May 20, 2024

@isj4 @SimpliPHYd seems like you have figured this out. @SimpliPHYd you are correct you need to pass the --gen and --zcl targets to zap in order to pick the correct meta data from your SDK. ZAP documentation related to this can be found in https://github.com/project-chip/zap -> Usage Documentation -> ZAP User's Guide -> Launching ZAP for Matter or Zigbee Applications or Generating Code for Matter, Zigbee or a Custom SDK

@brdandu brdandu self-assigned this May 20, 2024
@brdandu brdandu added this to In Progress in Silicon Labs - internal work May 20, 2024
@brdandu
Copy link
Collaborator

brdandu commented May 20, 2024

If you see [Error: SQLITE_ERROR: no such table: SETTING] { errno: 1, code: 'SQLITE_ERROR' } error it is likely that your database got corrupted at some point and deleting your .zap repo from your root directory gets you around this issue.

Closing this issue hoping that this answers all your questions. Please feel free to re-open if there is anything left over with respect to this issue.

@brdandu brdandu closed this as completed May 20, 2024
Silicon Labs - internal work automation moved this from In Progress to Done May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants