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

Implement quick connect in device agent #226

Merged
merged 11 commits into from
Feb 2, 2024
Merged

Conversation

Steve-Mcl
Copy link
Contributor

@Steve-Mcl Steve-Mcl commented Jan 26, 2024

Description

  • Support new args for initialising setup from CLI using a one time code
    • -o/--otc - One Time Code
    • -u/--ff-url - URL of FlowFuse platform to connect and spend the OTC
  • Updates to README.md to document new args
  • Adds test "Agent Manager should request config from FlowFuse when started in Quick Connect mode"

Examples

flowfuse-device-agent -o free-pond-grouse -u https:app.my-ff.org

[AGENT] 29/01/2024 15:51:56 [info] Entering Device setup...
[AGENT] 29/01/2024 15:51:56 [info] Device setup was successful
[AGENT] 29/01/2024 15:51:56 [info] To start the Device Agent with the new configuration run the following command:
[AGENT] 29/01/2024 15:51:56 [info] flowfuse-device-agent

2nd run: flowfuse-device-agent -o free-pond-grouse -u https:app.my-ff.org

[AGENT] 30/01/2024 09:00:50 [info] Entering Device setup...
[AGENT] 30/01/2024 09:00:50 [warn] Problem encountered during provisioning: HTTPError: Response code 401 (Unauthorized)
[AGENT] 30/01/2024 09:00:50 [warn] Device setup was unsuccessful

flowfuse-device-agent -o red-horse-velvet -u https:app.my-ff.org -d c:/opt/dev1

[AGENT] 29/01/2024 15:51:56 [info] Entering Device setup...
[AGENT] 29/01/2024 15:51:56 [info] Device setup was successful
[AGENT] 29/01/2024 15:51:56 [info] To start the Device Agent with the new configuration run the following command:
[AGENT] 29/01/2024 15:51:56 [info] flowfuse-device-agent -d c:/opt/dev1

flowfuse-device-agent -u https:app.my-ff.org -d c:/opt/dev1

[AGENT] 30/01/2024 09:01:53 [warn] Device setup requires parameter --otc to be 8 or more characters

flowfuse-device-agent -o free-pond-grouse

[AGENT] 30/01/2024 09:02:54 [warn] Device setup requires parameter --ff-url to be set
Prior to redesign 29-001-2024
  • Support new args for Quick Connect
    • -q/--qc - boolean flag to init Quick Connect
    • -o/--otc - One Time Code
    • -u/--ff-url - URL of FlowFuse platform to connect and spend the OTC
  • Updates to README.md to document new args
  • Adds test "Agent Manager should request config from FlowFuse when started in Quick Connect mode"

Related Issue(s)

#3256

Checklist

  • I have read the contribution guidelines
  • Suitable unit/system level tests have been added and they pass
  • Documentation has been updated
    • Upgrade instructions
    • Configuration details
    • Concepts
  • Changes flowforge.yml?
    • Issue/PR raised on FlowFuse/helm to update ConfigMap Template
    • Issue/PR raised on FlowFuse/CloudProject to update values for Staging/Production

Labels

  • Backport needed? -> add the backport label
  • Includes a DB migration? -> add the area:migration label

@Steve-Mcl Steve-Mcl linked an issue Jan 26, 2024 that may be closed by this pull request
@Steve-Mcl Steve-Mcl marked this pull request as draft January 29, 2024 13:02
@Steve-Mcl
Copy link
Contributor Author

Converted to draft while requested redesign is carried out

@Steve-Mcl Steve-Mcl removed the request for review from knolleary January 29, 2024 13:03
@Steve-Mcl Steve-Mcl marked this pull request as ready for review January 29, 2024 16:03
lib/AgentManager.js Outdated Show resolved Hide resolved
lib/AgentManager.js Show resolved Hide resolved
README.md Show resolved Hide resolved
Co-authored-by: Nick O'Leary <nick.oleary@gmail.com>
@knolleary knolleary merged commit 975678b into main Feb 2, 2024
2 checks passed
@knolleary knolleary deleted the 3256-quick-connect-device branch February 2, 2024 17:25
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.

Device Onboarding - device.yml improvements
2 participants