0.4.0 • Published 4 years ago

bespoken-virtual-user v0.4.0

Weekly downloads
-
License
ISC
Repository
-
Last release
4 years ago

CircleCI codecov

Bespoken Test Robot

Client

Bill Of Materials (BOM)

Core Kit:

DeviceURLDimensions (W x H x D inches)
CanaKit Raspberry PiLink2.25 x 4.00 x 1.25
Logitech C920S HD Pro WebcamLink1.00 x 3.70 x 1.20
Jabra 410Link4.50 x 4.50 x 1.00

Potential Soundproofing options:

The camera is approximately five inches from the device (closer definitely seems to work better).

The microphone and speaker are about the same distance (though farther would likely work fine).

Auxiliary Items

  • USB Keyboard and Mouse

Additional Necessary Items
Sound-proof casing?

Physical Setup

Follow the directions. Make sure to:

  • Install heatsinks
  • Install fan
  • Attach the USB keyboard and mouse
  • Attach to a TV via HDMI

Raspberry Pi

On first launch:

  • Launch raspi-config from a terminal - sudo raspi-config
  • Disable GUI
  • Enable Wifi
  • Enable SSH

You can always get back to the GUI by entering startx on the command-line.

Restart, and then:

  • Plugin the webcam and speaker to the USB ports.
    • The Jabra should be plugged into the top-left USB port
    • The Webcam should be plugged into the bottom-left USB port
    • NOTE from JPK - I'm not certain the position really matters, but it is best to be consistent
  • Run install.sh to finish setup
  • Run npm test speaker and npm test watcher to do sanity checks on the device

Configuration

The configuration is kept in the conf/client.json.

{
  "pollURL": "https://virtual-device-robot.bespoken.io/poll",
  "token": "robot-1"
}

The pollURL can also be set with the environment variable POLL_URL.

Deploy

Restart the raspberry pi to see it is running.

That's all there is to it!

Diagnostics

To verify things are running correctly, ssh to the raspi and run this:
tail /var/log/daemon.log

You can monitor the log continuously with:
tail -f /var/log/daemon.log

To see if the service is running, enter:
systemctl status

To restart the test-robot service, run:
sudo systemctl restart test-robot

To get info about the USB devices, run lsusb. You should see listed:

  • GN Netcom - that is the Jabra speaker
  • Logitech, Inc. Orbicam - that is the Logitech Webcam

If either is not listed, that is a problem!

Server

Setup

We create a fargate service like so:

fargate service \
  --command "node bin/robot-server.js" \
  --name test-robot \
  --containerPort 3000 \
  --image bespoken/test-robot:${CIRCLE_TAG} \
  --hostname virtual-device-robot.bespoken.io \
  --cpu 256 \
  --memory 512

This is all done via the Circle CI config.

New versions are deployed automatically whenever the repository is tagged.

Just run:

npm version patch

That will do the following:

  • Increment the version
  • Tag the repo
  • Push the changes to Github
  • Trigger Circle CI to deploy the new version to Fargate