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

GH-43: z-wave: Support of user credential cc #43

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

rzr
Copy link
Collaborator

@rzr rzr commented Apr 24, 2024

Change

Ongoing parallel implementation of CC

zwave-unify-u3c-20240501

Supported features

  • Add, Edit, Remove an User (ZPC and MQTT)
  • Add, Edit, Remove an Credential (ZPC and MQTT)
  • End device interview of capabilities (ZPC and MQTT)
  • Support Set User/Credential Report Error

Incoming (not in PR yet, but implemented)

  • Handle multiple deletion of Users/Credentials
  • Credential Learn
  • User Unique Identifier Credential Association
  • User Checksum
  • Credential Checksum

WIP

  • Log errors in MQTT (and DevUI)

How to test it

End device

You can use the simulated environment to have an end device that support User Credential : https://github.com/Z-Wave-Alliance/z-wave-stack/wiki/ZPC

Controller

Compile (tested on Ubuntu 22.04 WSL)

In the git repository :

# We need mosquitto in the system
uic> sudo apt install mosquitto

# Build docker container
uic> docker/build_docker.sh amd64 uic_amd64;
# Start docker container 
uic> docker run -it -v $PWD:$PWD -w $PWD uic_amd64;

# Now we are in the docker container, create build folder
docker> mkdir build && cd build

# Create Makefile with only ZPC and DevUI
docker> cmake .. -GNinja -DBUILD_AOXPC=OFF -DBUILD_CPCD=OFF -DBUILD_EMD=OFF -DBUILD_EPC=OFF -DBUILD_GMS=OFF -DBUILD_IMAGE_PROVIDER=OFF -DBUILD_MATTER_BRIDGE=OFF -DBUILD_NAL=OFF -DBUILD_OTBR=OFF -DBUILD_POSITIONING=OFF -DBUILD_TESTING=OFF -DBUILD_UIC_DEMO=OFF -DBUILD_UPTI_CAP=OFF -DBUILD_UPTI_WRITER=OFF -DBUILD_UPVL=OFF -DBUILD_ZIGBEED=OFF -DBUILD_ZIGPC=OFF

# Compile 
docker> ninja

# Create .deb packages if you want to install them on your machine
docker> ninja package

Once compiled, you can either install the dev packages or start the manually :

# ZPC start 
#⚠️--zpc.serial might change based on your socat implementation)
uic> sudo build_amd64/applications/zpc/zpc  --zpc.serial=/tmp/socat-localhost+4901 --zpc.datastore_file /tmp/simulated.db --mapdir ./applications/zpc/components/dotdot_mapper/rules/ --log.tag_level zwave_command_class_user_credential:d,dotdot_mqtt:d,user_credential_cluster_server:d,zwave_command_class_notification:d; 

# Dev UI API
#⚠️ You'll need node 18+ (use nvm https://github.com/nvm-sh/nvm) 
uic> cd applications/dev_ui/dev_gui
uic> npm run start-api

# Dev UI (https://localhost:3000)
#⚠️ You'll need node 18+ (use nvm https://github.com/nvm-sh/nvm) 
#⚠️ Security issues may happen with firefox, you'll have to test it on Chronium or use the .deb package
uic> cd applications/dev_ui/dev_gui
uic> npm run start

Run

We recommend to start zpc in command line : https://siliconlabs.github.io/UnifySDK/applications/zpc/readme_user.html#running-zpc-from-the-command-line

With the following arguments to help us debug an issue :
--log.tag_level zwave_command_class_user_credential:d,user_credential_cluster_server:d,zwave_command_class_notification:d;

⚠️ Make sure that this file 924445b#diff-69a45f32ef895eeb999e643981807b60127f9a119499c6c83729312d66824544 is in your --mapdir directory (default path : /usr/share/uic/rules)

Once the end device is included you can see the User Credential class in : https://localhost:3080/usercredential

⚠️Default credential data should not display properly, this is a known issue in the end device and will be fixed soon.

Screenshots

image
image

Related-to: https://github.com/Z-Wave-Alliance/OSWG/issues/21#issuecomment-2074462819

Checklist

@rzr rzr changed the title Protocol/z wave/feature/user credential cc z-wave: Support of user credential cc Apr 24, 2024
@rzr rzr marked this pull request as draft April 24, 2024 09:03
silabs-borisl pushed a commit that referenced this pull request Apr 24, 2024
Bug-SiliconLabs: UIC-3214
Bug-GitHub: #43
Signed-off-by: Philippe Coval <[email protected]>
silabs-borisl pushed a commit that referenced this pull request Apr 24, 2024
Bug-SiliconLabs: UIC-2987
Bug-GitHub: #43
Signed-off-by: Philippe Coval <[email protected]>

Signed-off-by: Philippe Coval <[email protected]>
silabs-borisl added a commit that referenced this pull request Apr 24, 2024
This is a merge between e3d5b1838531a916132034fb943eb01db19cfdec that is latest stable version of the file and the latest one from u3c branch

Bug-SiliconLabs: UIC-3222
Bug-GitHub: #43
Signed-off-by: Philippe Coval <[email protected]>
silabs-borisl added a commit that referenced this pull request Apr 24, 2024
…int node information on event callback

Bug-SiliconLabs: UIC-3234
Bug-GitHub: #43
Signed-off-by: Philippe Coval <[email protected]>
silabs-borisl added a commit that referenced this pull request Apr 24, 2024
- User Capabilities
- Credential Capabilities
- All User Checksum
- User Get/Report
- Credential Get/Report

Merged :
UIC-3222: Fix Supported Credential Types
UIC-3222: Ignore User ID 0 & don't create duplicates
UIC-3222: Delayed interview
UIC-3222: User Credential User Name Encoding under UUID (No real advantage to put this under USER_NAME)
UIC-3222: Fix user discovery
UIC-3222: Credential get log
UIC-3222: Discovery fix (credential and user get)
UIC-3222: Discovery interview remove all users before user interview
UIC-3222: Fix credential report if credential data is missing
UIC-3222: Remove user if User modifier type is DNE
UIC-3222: Correctly remove all user credential before discovery
UIC-3222: set_reported_attribute return correct status and undefined desired
UIC-3222: Add get_desired user id node function
UIC-3222: get_credential_type can now be searched as desired value

Bug-SiliconLabs: UIC-3222
Bug-GitHub: #43
Signed-off-by: Philippe Coval <[email protected]>
silabs-borisl added a commit that referenced this pull request Apr 24, 2024
UIC-3222: Credential Set on Credential Operation Type
UIC-3222: Set Credential (delete) improvement
UIC-3222: Credential SET also look in desired values
UIC-3222: Fix delete operation on Credential SET
UIC-3222: Allow extra bytes when testing set/get commands

Bug-SiliconLabs: UIC-3222
Bug-GitHub: #43
Signed-off-by: Philippe Coval <[email protected]>
silabs-borisl added a commit that referenced this pull request Apr 24, 2024
UIC-3222: User set on User Operation Type
UIC-3222: More user types
UIC-3222: User SET fix
UIC-3222: Set User (delete) improvement
UIC-3222: Fix expiring minutes to Desired Or Reported to allow add
UIC-3222: User SET can look into desired attributes

Bug-SiliconLabs: UIC-3222
Bug-GitHub: #43
Signed-off-by: Philippe Coval <[email protected]>
silabs-borisl pushed a commit that referenced this pull request Apr 24, 2024
Bug-SiliconLabs: UIC-2725
Bug-GitHub: #43
Signed-off-by: Philippe Coval <[email protected]>
silabs-borisl added a commit that referenced this pull request Apr 24, 2024
Bug-SiliconLabs: UIC-3222
Bug-GitHub: #43
Signed-off-by: Philippe Coval <[email protected]>
@silabs-borisl silabs-borisl force-pushed the protocol/z-wave/feature/user-credential-cc branch from 77f94f7 to a6f8e44 Compare April 24, 2024 13:51
silabs-borisl added a commit that referenced this pull request Apr 24, 2024
Bug-SiliconLabs: UIC-3222
Bug-GitHub: #43
Signed-off-by: Philippe Coval <[email protected]>
silabs-borisl added a commit that referenced this pull request Apr 24, 2024
Bug-SiliconLabs: UIC-3222
Bug-GitHub: #43
Signed-off-by: Philippe Coval <[email protected]>
silabs-borisl added a commit that referenced this pull request Apr 24, 2024
Bug-SiliconLabs: UIC-3222
Bug-GitHub: #43
Signed-off-by: Philippe Coval <[email protected]>
silabs-borisl added a commit that referenced this pull request Apr 24, 2024
Bug-SiliconLabs: UIC-3222
Bug-GitHub: #43
Signed-off-by: Philippe Coval <[email protected]>
silabs-borisl added a commit that referenced this pull request Apr 24, 2024
This patch will :
- Not delete all user database en Unify startup
- Allow the user to re-initiate an interview with the device and discover again all users

Bug-SiliconLabs: UIC-3222
Bug-GitHub: #43
Signed-off-by: Philippe Coval <[email protected]>
@rzr rzr changed the title z-wave: Support of user credential cc GH-43: z-wave: Support of user credential cc Apr 25, 2024
silabs-borisl added a commit that referenced this pull request Apr 25, 2024
Bug-SiliconLabs: UIC-3222
Bug-GitHub: #43
silabs-borisl added a commit that referenced this pull request Apr 25, 2024
Bug-SiliconLabs: UIC-3222
Bug-GitHub: #43
silabs-borisl added a commit to silabs-borisl/UnifySDK that referenced this pull request Sep 24, 2024
Forwarded: SiliconLabs#43
Bug-SiliconLabs: UIC-3222
Bug-Github: SiliconLabs#43
silabs-borisl added a commit to silabs-borisl/UnifySDK that referenced this pull request Sep 24, 2024
Forwarded: SiliconLabs#43
Bug-SiliconLabs: UIC-3222
Bug-Github: SiliconLabs#43
silabs-borisl added a commit to silabs-borisl/UnifySDK that referenced this pull request Sep 24, 2024
silabs-borisl added a commit to silabs-borisl/UnifySDK that referenced this pull request Sep 24, 2024
silabs-borisl added a commit to silabs-borisl/UnifySDK that referenced this pull request Sep 24, 2024
Forwarded: SiliconLabs#43
Bug-SiliconLabs: UIC-3222
Bug-Github: SiliconLabs#43
silabs-borisl added a commit to silabs-borisl/UnifySDK that referenced this pull request Sep 24, 2024
Forwarded: SiliconLabs#43
Bug-SiliconLabs: UIC-3222
Bug-Github: SiliconLabs#43
silabs-borisl added a commit to silabs-borisl/UnifySDK that referenced this pull request Sep 24, 2024
silabs-borisl added a commit to silabs-borisl/UnifySDK that referenced this pull request Sep 24, 2024
Forwarded: SiliconLabs#43
Bug-SiliconLabs: UIC-3222
Bug-Github: SiliconLabs#43
silabs-borisl added a commit to silabs-borisl/UnifySDK that referenced this pull request Oct 14, 2024
Forwarded: SiliconLabs#43
Bug-SiliconLabs: UIC-3222
Bug-Github: SiliconLabs#43

Integration of commits until : 
5664a2147a2c94bdf223ea89076e4ea036d92cca


Add following commits : 4a515ed86efd401d1212ab7974327ed82e973321
e0ea8149a0bf3ef5c69bf9dd2aa9206352d7eea5
d0049b2c28c0b98050ea0201e800a904a9c66df6
silabs-borisl added a commit to silabs-borisl/UnifySDK that referenced this pull request Oct 14, 2024
Forwarded: SiliconLabs#43
Bug-SiliconLabs: UIC-3222
Bug-Github: SiliconLabs#43
rzr added 3 commits October 24, 2024 17:51
Also align to distro stable version:  1.22.19+~cs24.27.18-2+deb12u1

Currently there is no backport of recent version, so let´s align to debian

https://tracker.debian.org/pkg/node-yarnpkg

Bug-SiliconLabs: UIC-2987
Origin: #48
Signed-off-by: Philippe Coval <[email protected]>
Bug-SiliconLabs: UIC-2987
Relate-to: https://github.com/Z-Wave-Alliance/z-wave-stack/wiki/ZPC
Origin: #48
Signed-off-by: Philippe Coval <[email protected]>
Bug-SiliconLabs: UIC-2987
Origin: #48
Signed-off-by: Philippe Coval <[email protected]>
Forwarded: #43
Bug-SiliconLabs: UIC-3222
Bug-Github: #43
Forwarded: #43
Bug-SiliconLabs: UIC-3222
Bug-Github: #43
Forwarded: #43
Bug-SiliconLabs: UIC-3222
Bug-Github: #43
Forwarded: #43
Bug-SiliconLabs: UIC-3222
Bug-Github: #43
Forwarded: #43
Bug-SiliconLabs: UIC-3222
Bug-Github: #43
Forwarded: #43
Bug-SiliconLabs: UIC-3222
Bug-Github: #43
Forwarded: #43
Bug-SiliconLabs: UIC-3222
Bug-Github: #43

Integration of commits until : 
5664a2147a2c94bdf223ea89076e4ea036d92cca


Add following commits : 4a515ed86efd401d1212ab7974327ed82e973321
e0ea8149a0bf3ef5c69bf9dd2aa9206352d7eea5
d0049b2c28c0b98050ea0201e800a904a9c66df6
Forwarded: #43
Bug-SiliconLabs: UIC-3222
Bug-Github: #43
@rzr rzr force-pushed the protocol/z-wave/feature/user-credential-cc branch from 37d4238 to 32cf568 Compare October 28, 2024 15:04
@rzr
Copy link
Collaborator Author

rzr commented Oct 28, 2024

For the record branch has been updated from ver_1.5.0-20-g37d4238f8 to ver_1.6.0-11-g32cf5689e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants