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 18 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

  • Handle multiple deletion of Users/Credentials
  • 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
satyanaag-silabs and others added 16 commits April 24, 2024 15:51
Bug-SiliconLabs: UIC-3214
Bug-GitHub: #43
Signed-off-by: Philippe Coval <philippe.coval@silabs.com>
Bug-SiliconLabs: UIC-2987
Bug-GitHub: #43
Signed-off-by: Philippe Coval <philippe.coval@silabs.com>

Signed-off-by: Philippe Coval <philippe.coval@silabs.com>
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 <philippe.coval@silabs.com>
…int node information on event callback

Bug-SiliconLabs: UIC-3234
Bug-GitHub: #43
Signed-off-by: Philippe Coval <philippe.coval@silabs.com>
- 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 <philippe.coval@silabs.com>
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 <philippe.coval@silabs.com>
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 <philippe.coval@silabs.com>
Bug-SiliconLabs: UIC-2725
Bug-GitHub: #43
Signed-off-by: Philippe Coval <philippe.coval@silabs.com>
Bug-SiliconLabs: UIC-3222
Bug-GitHub: #43
Signed-off-by: Philippe Coval <philippe.coval@silabs.com>
Bug-SiliconLabs: UIC-3222
Bug-GitHub: #43
Signed-off-by: Philippe Coval <philippe.coval@silabs.com>
Bug-SiliconLabs: UIC-3222
Bug-GitHub: #43
Signed-off-by: Philippe Coval <philippe.coval@silabs.com>
Bug-SiliconLabs: UIC-3222
Bug-GitHub: #43
Signed-off-by: Philippe Coval <philippe.coval@silabs.com>
Bug-SiliconLabs: UIC-3222
Bug-GitHub: #43
Signed-off-by: Philippe Coval <philippe.coval@silabs.com>
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 <philippe.coval@silabs.com>
Signed-off-by: Philippe Coval <philippe.coval@silabs.com>
@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
@rzr rzr changed the title z-wave: Support of user credential cc GH-43: z-wave: Support of user credential cc Apr 25, 2024
Bug-SiliconLabs: UIC-3222
Bug-GitHub: #43
Bug-SiliconLabs: UIC-3222
Bug-GitHub: #43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants