nordic-dev-net / hydrophonitor-cli

Command line interface for hydrophonitor importing etc.
MIT License
2 stars 0 forks source link

Connect (proposal) #18

Closed juliuskoskela closed 7 months ago

juliuskoskela commented 11 months ago

I have been thinking about the user flow for figuring out what is the correct device path to give to the hp-cli command. For an advanced user this is of course easy to figure out, but for non -advanced users this part can be tricky. Let's review how the user flow would go now.

  1. User needs to enumerate devices. They could use a file explorer GUI in Gnome to see attached devices and figure out how to get the path from the GUI or they can run a command such as lsblk to see a listing.
  2. User needs to figure out which device is the correct one and get it path in /dev.
  3. User incorporates the path with each command:
hp-cli import -d /dev/sdb -o .

I think this could be cumbersome for the user and a hard user flow to follow correctly for someone not as familiar with the command line etc. I was thinking of the following alternative approach:

  1. User uses hp-cli connect wizard to connect to the device. This wizard will automatically enumerate attached USB storage devices, scan for /output folder and propose to connect to any attached hydrophonitor. Under the hood a folder is created such as ~/.hydrophonitor and the correct device mounted to the folder.
  2. User uses each command with the --device parameter assumed to be ~/.hyrdophonitor or prompts to connect if the device is not found.
  3. User uses hp-cli disconnect to unmount and delete the folder ~/.hydrophonitor.
satukoskinen commented 11 months ago

I think this is a good idea!

I would suggest that we would not mount the device to a different folder to avoid additional complexity. We could instead perhaps create a ~/.hydrophonitor file or a file under ~/.hydrophonitor folder in an appropriate format where the information about the connected device's path would be saved.

mxwt00 commented 10 months ago

I have two questions regarding the Connect wizard:

  1. Can we assume that all devices are automounted?
  2. How do we detect which device is the Hydrophonitor?
juliuskoskela commented 10 months ago

I have two questions regarding the Connect wizard:

1. Can we assume that all devices are automounted?

No. The way I see it we can offer the convenience of enumerating the possible (unmounted) drives and the user chooses. Then we mount the drive.

2. How do we detect which device is the Hydrophonitor?

We can't definitively detect that, but we should have checks (that can be expanded upon) to check that there's an /output folder for example.