X-Git-Url: http://47.100.26.94:8080/?a=blobdiff_plain;f=README.md;h=54a45ab2b9280a1eb29344e7e83f0d0a3fadbec1;hb=f1b399b817ca4cadf792c5fa65e7ccfc48a07a35;hp=c13cddef32fe8c72d71b9e326c10261aaadf7a85;hpb=2e0f2852d177cbed7ab450ff45ac6db8ad074b57;p=remote-debug.git diff --git a/README.md b/README.md index c13cdde..54a45ab 100644 --- a/README.md +++ b/README.md @@ -4,31 +4,65 @@ ## Install - On embedded device + - run `./add-user.sh` to create a user, used for remote ssh, named debug, and its password is suanzikeji - run `./install.sh` to install the daemon and service file - - run `./add-user.sh` to create a user, used for remote ssh, named debug, and its password is hard2guess + +- On local machine + - Linux, run `apt-get install sshpass` + - Mac OSX, sshpass is not in brew. To install this, + - `brew create https://sourceforge.net/projects/sshpass/files/sshpass/1.05/sshpass-1.05.tar.gz --force` + - `brew install sshpass` + - run `pip install paho-mqtt` ## Usage -To connect to remote embedded device, your should know the device's MAC address. -1. run `./sztool -i 2acdeb93b285` +### list all connected device + +`./sztool list` + +The output, + +``` +debian@[~/project/remote-ssh]>> ./sztool list +Mac: 080027a6f8dc +Connected with result code 0 +Receive topic:080027a6f8dc payload: {'type': 'response', 'from': '2acdeb93b285', 'command': 'list', 'data': 'OK'} +list +2acdeb93b285 OK +timeout +``` + +### Connect to the device + +1. Run `./sztool connect 2acdeb93b285` -where `2acdeb93b285` is the MAC address of rpdzkj board, which you want to -connect. +The output -2. If it succeed, it will return the forwarding port on `autossh.suanzi.ai` -here is a sample ``` -debian@[~/project/remote-ssh]>> ./sztool -i 2acdeb93b285 +debian@[~/project/remote-ssh]>> ./sztool list +Mac: 080027a6f8dc + +Found 3 connected devices: Connected with result code 0 -2acdeb93b285-response 32171 -port is 32171 -run ssh debug@autossh.suanzi.ai -p 32171 to connect to 2acdeb93b285 device + + Device ID Data +------------------------------ +00044b8d6310 OK +502b73d42c31 OK +b0f1ec7a62ce OK ``` -3. run `ssh debug@autossh.suanzi.ai -p 32171`, then you can ssh to remote - device. The password is 'hard2guess', create in file `add-user.sh` +``` +debian@[~/project/remote-ssh]>> ./sztool connect 2acdeb93b285 +Mac: 080027a6f8dc +Connected with result code 0 +Receive topic:080027a6f8dc payload: {'type': 'response', 'from': '2acdeb93b285', 'command': 'ssh', 'data': 32176} +ssh +run "ssh debug@autossh.suanzi.ai -p 32176" to connect to device (2acdeb93b285) +``` +2. Run `ssh debug@autossh.suanzi.ai -p 32176`, to ssh to remote device, password is 'suanzikeji', create in file `add-user.sh` ## Note - After the port is generated, the ssh session alive time is 5 min (defined by ALIVE_TIME in suanzi-support).