Setting up the Linux Machine

In this tutorial I’m going to assume you already have some device running Linux. As I stated, I am using my RPi3 running Raspbian. If you haven’t done this yet, here’s a tutorial for setting up an RPi, and here’s a tutorial for installing Debian on any other type of PC, use them as you wish.

1. Install and Setup TriggerCMD

If you’re on RPi, use the following commands:



apt-get -y update

apt-get -y upgrade

apt-get -y install npm nodejs

wget

dpkg -i triggercmdagent_1.0.1_all.deb sudo su -apt-get -y updateapt-get -y upgradeapt-get -y install npm nodejswget https://s3.amazonaws.com/triggercmdagents/triggercmdagent_1.0.1_all.deb dpkg -i triggercmdagent_1.0.1_all.deb

If you’re on Debian, use these:

sudo apt-get -y update

sudo apt-get -y upgrade

wget https://s3.amazonaws.com/triggercmdagents/triggercmdagent_1.0.1_amd64.deb

sudo apt install ./triggercmdagent_1.0.1_amd64.deb

Any other Linux flavors, modify commands as necessary. The different Linux packages can be found here.

Next, you’re going to start the TriggerCMD foreground service and set up your token:

triggercmdagent

It may look slightly different for you but just look for the prompt at the bottom

You’re now going to go back to the TriggerCMD site and look here for your token.

Yes, I photoshopped a fake token.

Copy this token and paste it into the prompt on your device. It will do a bunch of stuff and then stop printing out more text. At that point you can use CTRL+C to stop the process.

Prime Your Computer

Next you will need to hop onto the PC you want to start and activate WOL. (Mac people refer to the first part of this tutorial)

Windows people can continue by pressing WIN+X and select Device Manager:

WIN+X accesses the Windows “Command Center” Menu

Next, find your Ethernet adapter in the device list:

It should look similar to this

Then right-click on it and click “Properties.” Move to the “Advanced” tab and find “Wake on Magic Packet” in the list. Set this to “Enabled”.

This will allow the device to talk to your PC.

Then find the “Power Management” tab and check “Allow this device to wake the computer” and “Only allow a magic packet to wake the computer”.

Those two are what you wanna worry about

These next few steps discuss finding your Physical Address, otherwise known as MAC address, on Windows, if you use a Mac, follow the portion of this tutorial labelled “How to find a wired MAC address”.

Now press WIN+X again and select “Command Prompt (Admin)”

Type in the following command:

ipconfig /all

It will give you a list of your network devices. Find the one with the same name that we found earlier in the Device Manager and take note of the Physical Address.

It will be a series of number/letter combos (such as 00, 3A, or DE) separated by dashes.

Finish setting up TriggerCMD

Moving back to the RPi, enter the following command:

nano /root/.TRIGGERcmdData/commands.json

This will allow you to enter custom commands. You can delete everything in this file and enter the following command:

(Note: Replace AA:BB:CC:DD:EE:FF with the Physical Address we noted down earlier, except with colon separators instead of dashes.)

{

{"trigger":"startpc","command":"etherwake -i eth0 AA:BB:CC:DD:EE:FF","ground":"background","voice":"startpc","allowParams":"false"}

}

This is how it should look on your screen, without the dumb Medium formatting

Then run this command* to make it run in the background at boot:

/usr/share/triggercmdagent/app/src/installdaemon.sh

*If you’re not on RPi, dig around for exactly where this script was installed. It will usually be somewhere in the subdirectories of /usr/share/triggercmdagent.

Next, we’ll restart the device and ensure that TriggerCMD starts at boot and connects to your account properly. Once it restarts, log back in and run:

sudo su -

service triggercmdagent status

The white box should show an ID number for your account

Great! A few more things before we set up the Assistant:

apt-get -y install etherwake

nano /etc/dhcpcd.conf

Scroll to the bottom of this .conf file and look for this section:

interface wlan0

static ip_address=<ip address of the device>

static routers=<router ip>

static domain_name_servers=<name server>

You’re going to add this immediately under that:

metric 200 interface eth0

static ip_address=192.168.1.100/24

static routers=192.168.1.200

static domain_name_servers=192.168.1.200

metric 300

This will make it utilize the Wi-Fi connection for triggers and the Ethernet for waking your computer. You can now plug the device directly into your PC with an Ethernet cable, and restart it. At this point, you can exit your SSH client if you’re using one, or just leave the device alone. It’s finally finished! Now for the Assistant side of things…