Skip to content
This repository was archived by the owner on Apr 9, 2021. It is now read-only.

Installation guide

Martijn Schrage edited this page Mar 23, 2016 · 3 revisions

The guide is for Mac OS, but it should be straightforward to modify it for Linux (using crontab instead of launchd.)

Motorola reader settings

(Default login/password for readers is admin/change)

Initialize readers to factory settings, and set via Expert Configuration, set the following:

Setting Value
Setup / setup.region: etsi
Setup / setup.sub_regin: en302208_dense
Communication com.network.ntp_servers: server0.nl.pool.ntp.org server1.nl.pool.ntp.org server2.nl.pool.ntp.org server 3.nl.pool.ntp.org (for automatically synchronizing the reader clock)
Information / info.time_zone: CET
Communication / com.llrp.log_level: debug

NOTE: setting log_level is very hard, as it keeps going back to 'error'. What seems to have worked was to refresh the Communication page, set the value, Submit, wait until done and press back. (Reselect Communication page to check) It is also unclear if this works at all, since the llrp log makes no mention of a log level change, and the logs look exactly the same.

Go to Check Reader Status and make sure Services: ntpd is running.

Installation on Mac OS X server

User needs to be administrator. In the rest of this guide user name NHMR is assumed as that's the one used in Rotterdam, but it is better to use a lower case name.

Server sleep behavior

In System Preferences / Energy Saver set the following:

Setting Value
Computer sleep: Never
Display sleep: Never
Put hard disks to sleep when possible: No
Wake for network access: Yes (shouldn't be necessary, but just to be safe)
Start up automatically after a power failure: Yes

Install Java:

Download from http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html (select Mac OS X x64 dmg)

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

This will trigger an XCode installation dialogue. Click Install and after it finishes, press a key in terminal to continue Ruby.

brew doctor
brew install node
sudo npm install -g typescript

Generate ssh key

See https://help.github.com/articles/generating-ssh-keys:

ssh-keygen -t rsa -C "NHMR@Lucy Mac mini"
nano .ssh/authorized_keys

Add public keys from remote machines that will access Lucy Mac mini (~/.ssh/id_rsa.pub)

sudo nano /etc/sshd_config

Add the following lines to disable logging in with username & password (which is too unsafe)

ChallengeResponseAuthentication no
PasswordAuthentication no
UsePAM no

Add to github Cercando / Settings / Deploy keys

Checkout and compile reader server and Lucy server

mkdir git
cd git/
git clone git@github.com:Oblosys/Cercando.git


ln -s $HOME/git/Cercando/scripts/.profile ~/.profile
cd ~/git/Cercando/LucyServer/js
npm install
mkdir ~/git/Cercando/ReaderServer/bin

~/git/Cercando/scripts/compileReaderServer.sh
~/git/Cercando/scripts/compileLucyServer.sh

Copy background floorplan images from the Cercando dropbox to www directory

(These are not in git because of their size)

scp -r -P 16322 ~/Dropbox/Shared/Cercando/LucyServer\ images/floorplans  NHMR@lucy.oblomov.com:git/Cercando/LucyServer/www/img

Grant access to NHMR on Synology SQL server

On Synology NAS: in the PHP my admin "SQL" tab (With active VPN connection, go to 10.0.0.20 in browser, login: root, no password)

GRANT SELECT ON lucy_test.* TO NHMR@'10.0.0.%' IDENTIFIED BY "";
FLUSH PRIVILEGES;

(press Go)

Allow running sudo launchctl without password

sudo visudo

Add at the end: (make sure file ends with newline)

  NHMR ALL=NOPASSWD: /bin/launchctl

(in Rotterdam, this will give a warning "User_Alias `NHMR' referenced but not defined" because NHMR is all uppercase)

Automatically mount Synology NAS

sudo cp ~/git/Cercando/scripts/auto_lucy /etc/
sudo nano /etc/auto_master

Add these lines:

/Users/NHMR/mount/LucySynology       auto_lucy
# We use mount in user dir instead of /Volumes as OS X doesn't automatically
# create a directory for the mountpoint in /Volumes. In contrast,
# /Users/NHMR/mount/LucySynology is created when needed. The mount point
# needs to be in a user directory, since otherwise OS X sometimes only sets
# root-only acces permissions.)

And run automount:

sudo automount -vc

Link lucy directories to mounted NAS

mkdir ~/lucy
mkdir ~/lucy/config
mkdir ~/lucy/log

ln -s /Users/NHMR/mount/LucySynology/web/lucyData/archivedLogs/ /Users/NHMR/lucy/log/archivedLogs
ln -s /Users/NHMR/mount/LucySynology/web/lucyData/ /Users/NHMR/lucy/data
mkdir ~/lucy/data/configUpload

Setup launchd to always keep reader and Lucy servers running

sudo cp ~/git/Cercando/scripts/com.oblomov.readerServer.plist /Library/LaunchDaemons/
sudo cp ~/git/Cercando/scripts/com.oblomov.lucyServer.plist /Library/LaunchDaemons/
sudo launchctl load /Library/LaunchDaemons/com.oblomov.readerServer.plist
sudo launchctl load /Library/LaunchDaemons/com.oblomov.lucyServer.plist

Setup router NAT

DrayTek Vigor 2130 web interface 10.0.0.1: NAT / Open ports Name, Protocol, WAN IP, Start Port, End Port (optional), Local Host, Local Port (optional) 80_Mac_8080, TCP+UDP, ALL, 80, , 10.0.0.24, 8080 8193_8193_Mac, TCP+UDP, ALL, 8193, , 10.0.0.24, 8193

(Redirect external port 80 to 8080 on server, and allow easy access to reader server events on 8193)