zap icon indicating copy to clipboard operation
zap copied to clipboard

Does not generate any files

Open isj4 opened this issue 1 year ago • 9 comments

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.

isj4 avatar Nov 30 '23 15:11 isj4

@isj4 can you try with the very latest? please

paulr34 avatar Dec 06 '23 18:12 paulr34

this one https://github.com/project-chip/zap/releases/tag/v2023.12.06-nightly

paulr34 avatar Dec 06 '23 18:12 paulr34

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.

isj4 avatar Dec 07 '23 18:12 isj4

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

good point, whatever is happening, it should tell you

paulr34 avatar Dec 07 '23 18:12 paulr34

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

isj4 avatar Dec 07 '23 18:12 isj4

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

paulr34 avatar Dec 07 '23 18:12 paulr34

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

SimpliPHYd avatar Dec 13 '23 01:12 SimpliPHYd

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

isj4 avatar Dec 13 '23 13:12 isj4

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!

SimpliPHYd avatar Dec 13 '23 17:12 SimpliPHYd

@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 avatar May 20 '24 15:05 brdandu

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 avatar May 20 '24 15:05 brdandu