A collaboration with platform workers.
Go to file
Ruben van de Ven ed9ebdf79e add task xml 2019-10-31 15:06:33 +01:00
realones Have plotter follow MT mouse - a bit hacky still 2019-10-15 12:42:59 +02:00
sorteerhoed Backend 2019-10-31 14:35:24 +01:00
www Backend 2019-10-31 14:35:24 +01:00
.gitignore Merge to master 2019-10-31 13:57:37 +01:00
.project Have plotter follow MT mouse - a bit hacky still 2019-10-15 12:42:59 +02:00
.pydevproject Have plotter follow MT mouse - a bit hacky still 2019-10-15 12:42:59 +02:00
Pipfile Status page test 2019-10-30 15:19:32 +01:00
Pipfile.lock Status page test 2019-10-30 15:19:32 +01:00
README.md Change light when turker becomes active 2019-10-30 13:31:21 +01:00
config.yml Mturk Drawing with padding 2019-10-31 13:55:22 +01:00
disable_motors.py Have plotter follow MT mouse - a bit hacky still 2019-10-15 12:42:59 +02:00
mt_task.xml add task xml 2019-10-31 15:06:33 +01:00
requirements.txt Send drawing to server - WIP 2019-09-11 18:16:33 +02:00
server_test.py server 2019-10-23 10:56:28 +02:00
sorteerhoed.py server 2019-10-23 10:56:28 +02:00

README.md

Webserver

Webserver is published to the web trough ssh remote forward. In /etc/ssh/sshd_config set GatewayPorts yes.

Then start autossh to maintain the connection:

autossh -M 0 -o "ServerAliveInterval 30" -o "ServerAliveCountMax 3" -R 8888:localhost:8888 here.rubenvandeven.com

To resolve the country the (imprecise) GeoLite2 Free Country dataset is used. Download it from MaxMind and store it in the project root folder.

Scanning

For scanning run visudo and add to the sudoers file:

mt	ALL=(ALL) NOPASSWD: /usr/bin/scanimage

Installation

Software dependencies:

  • python3
  • pipenv
  • usbrelay
  • autossh

Python deps:

pipenv install

Usbrelay

When installing usbrelay

apt install usbrelay

And set udev rules to access the device by anyone, according to usbrelay docs:

SUBSYSTEM=="usb", ATTR{idVendor}=="16c0",ATTR{idProduct}=="05df", MODE="0666"
KERNEL=="hidraw*", ATTRS{busnum}=="1", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="05df", MODE="0666"

into /etc/udev/rules.d/50-dct-tech-usb-relay-2.rules and then reload rules:

sudo udevadm control --reload-rules && sudo udevadm trigger