A pairing code may only be scanned once. If you experience an error while scanning, generate a new pairing code by clicking onto another panel in the admin (such as Wallet) and back to the Pairing panel.
You may encounter these error messages upon scanning your admin's pairing code:
ECONNREFUSED - A connection issue exists between your machine and server. This could be due to the code pointing to the wrong IP (see 'Malformed QR Code' below'), or port 3000 being closed or filtered on your server or local router. Please check that it is opened.
TOKEN EXPIRED - Use a new QR code. Generate one by clicking off of the admin's Pairing panel onto another, and then back to Pairing.
ENETUNREACH - The server process has likely stopped and needs to be restarted. If this is a newly configured backend server, this may be due to not having configured your wallet before trying to pair. First, configure your chosen wallet. Then, stop/start the server process by running these two commands individually in your server's terminal:
stop lamassu-server start lamassu-server
Then generate a new pairing code by refreshing the admin, and scan the new pairing code.
'Machine with this fingerprint already exists' - The machine is already paired to another server. On that server, run the lamassu-unpair command.
QR code won't scan
When pairing your machine, if you find the QR code is not scanned, check for these two conditions:
1. White margin
To be read, all QR codes must have a sufficient white border. The easiest way to accomplish this is to use your phone to take a clear photo of the QR code in the admin, then hold the photo up to the scanning bay window.
2. Malformed QR code
If you installed the admin software on a non-Digital Ocean server, there's a possibility the QR code is malformed. To check for this, use a QR code scanning app on your phone to decode the text of the code. It should resemble:
<your server's IP address>$3000$<string 1>$<string 2>
If instead of your server's IP, you see the loopback address of 127.0.0.1, create a new code by clicking off of Pairing to another panel and back onto it. Then use a QR generator app on your phone to decode it, replace the loopback address with your server's IP, and re-encode using the app. Then scan the edited QR code into the machine.
To resolve this in future pairings, in your server terminal, run this command, replacing w, x, y, and z with the four octets of your server's IP address:
sed -i 's/127.0.0.1/w.x.y.z/;s/127\\.0\\.0\\.1/w\\.x\\.y\\.z/' /usr/local/lib/node_modules/lamassu-admin/node_modules/ip/lib/ip.js
Thus, an IP of 54.385.02.1 becomes :
sed -i 's/127.0.0.1/54.385.02.1/;s/127\\.0\\.0\\.1/54\\.385\\.02\\.1/' /usr/local/lib/node_modules/lamassu-admin/node_modules/ip/lib/ip.js
Then, close all open instances of the admin panel, and run:
var cert = '/root/lamassu-server.crt';