Note - this script has been updated - the new instructions and downloads can be found here.
This information is here to support users of the older script. We recommend the updated script.
This procedure currently supports clients on Mac OS/X and Linux on x86 processors
You can use this script to make direct SSH connections from a command line terminal on your Mac OS/X or Linux x86 computer to an SSH host (ex. Raspberry Pi). This eliminates the need to manually login at www.weaved.com to generate a hostname and port to use with your ssh client. No more copy/paste and copy/paste !
Download Weaved daemon
Get weavedConnectd.macosx for Mac OS/X (Intel) here:
Get weavedConnectd.linux for x86 Linux (tested with Ubuntu 14.04) here:
Copy this file from the download location to /usr/bin and name it weavedConnectd, e.g.
sudo cp weavedConnectd.macosx /usr/bin/weavedConnectd
Make it executable:
sudo chmod +x /usr/bin/weavedConnectd
If sudo asks for your password, give it your Mac or Linux account login password, not your Weaved password.
Download launcher scripts
Now go to this folder at Github:
and download the lib.sh and sshw_fast.sh scripts to your computer.
Make them executable using:
chmod +x lib.sh sshw_fast.sh
Example: Start a direct ssh connection from a client (Linux x86 or Mac OS/X)
You will need the following information to configure a script or command line:
- Your Weaved account username and password.
- The Weaved UID of the Device connection you wish to create a direct connection
- The ssh login name for the target device
The UID for a configured device can be found under “Settings” at the web portal:
Click the “Settings” link and in your device list for the ssh service you want to enable for direct command line access .
The UID is the “Device Identifier” shown for this connection. Here it is 80:00:00:05:46:00:46:0E
Edit the sshw_fast.sh script
Search for GLOBAL then edit the 4 lines below to add your account and device details.
- USERNAME="your Weaved account username (email)"
- PASSWD="your Weaved account password"
- DEVICE_ADDRESS="your UID"
- SSH_NAME="username on target device" (ex. default username on Raspberry Pi is “pi”)
or, you can put all of these parameters right on the command line, and it will override the settings in the script.
./sshw_fast.sh [USERNAME] [PASSWD] [DEVICE_ADDRESS] [SSH_NAME]
./sshw_fast.sh email@example.com passwd1234 80:00:00:05:46:00:46:0E pi
Debugging your connection
Verbose output (which can be useful for debugging any issues you may encounter) can be enabled by adding 1 or two "-v" right after the script name on the command line:
./sshw_fast.sh -v firstname.lastname@example.org passwd1234 80:00:00:05:46:00:46:0E pi
./sshw_fast.sh -v -v email@example.com passwd1234 80:00:00:05:46:00:46:0E pi
(better for debugging login issues).
To check the server connections status, try:
./sshw_fast.sh -v -v firstname.lastname@example.org passwd1234 80:00:00:05:46:00:46:0E pi | grep -i connection
This shows the first part of the output for a valid login:
Connection will be to 127.0.0.1:33000
Using connection log : /home/me/.weaved/log.5748.txt
log>>!!status - server connection changed to state 4 - time -1 <15254>
log>>!!status - server connection changed to state 5 - time -1 <15256>
- Getting to state 5 is the important point here.
Or, invalid login:
Connection will be to 127.0.0.1:33000
Using connection log : /home/me/.weaved/log.5639.txt
log>>!!status - server connection changed to state 4 - time -1 <12823>
log>>!!status - Server Connection Retry. <13005>
log>>!!status - server connection changed to state 1 - time 17 <13005>
1) Doesn't work properly if you have a $ in your password (and
probably username) unless you escape it with a backwards slash, e.g.
instead of pas$word you'll need to say pas\$word.
2) If you try to run more than one of these connection scripts at a
time (to two different devices), they stack on top of each other
regarding the port assignment on 127.0.0.1 (the local address through
which your connection actually takes place). This means your second
connection will not succeed. You may or may not get an error message.
You can resolve this by making a copy of the script for your second connection and changing the value of the variable startport to something other than 33000, for example: