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

startLink provisioner material not persisted for jsonRpc #1712

Closed
sei-jmattson opened this issue Feb 17, 2025 · 1 comment
Closed

startLink provisioner material not persisted for jsonRpc #1712

sei-jmattson opened this issue Feb 17, 2025 · 1 comment

Comments

@sei-jmattson
Copy link

sei-jmattson commented Feb 17, 2025

Do I understand correctly that we cannot link a device with signal-cli jsonRpc and need to use signal-cli daemon?

The output indicates at FinishLinkCommand.java:L50 that the provisioner manager is no longer accessible. And that makes sense as provision material hasn't been stored anywhere; it must just exist in memory until timeout or process completion.

echo '{"jsonrpc": "2.0", "id": "t1", "method": "startLink"}' | signal-cli jsonRpc

# ... extract deviceLinkUri ...

echo '{"jsonrpc": "2.0", "id": "t2", "method": "finishLink", "params": {"deviceLinkUri": "sgnl://...", "deviceName": "test_cli"}}' | signal-cli jsonRpc

# output
{"jsonrpc":"2.0","error":{"code":-1,"message":"Unknown device link uri.","data":null},"id":"6"}
@AsamK
Copy link
Owner

AsamK commented Feb 27, 2025

The provisioning data is indeed not persisted anywhere. Might be a future improvement, but will require a new storage file.

However jsonRpc can still be used to link a device, you just need to keep the signal-cli instance running.

Example:

  FIFO_FILE="/tmp/fifo"
  
  rm -f "$FIFO_FILE"
  mkfifo "$FIFO_FILE"
  
  signal-cli jsonRpc < "$FIFO_FILE" &
  
  exec 3> "$FIFO_FILE"
    echo '{"jsonrpc": "2.0", "id": "t1", "method": "startLink"}' >&3
  
    # ... extract deviceLinkUri ...
  
    echo '{"jsonrpc": "2.0", "id": "t2", "method": "finishLink", "params": {"deviceLinkUri": "sgnl://...", "deviceName": "test_cli"}}' >&3
  
  exec 3>&-
  
  wait

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

No branches or pull requests

2 participants