-
Notifications
You must be signed in to change notification settings - Fork 25
Home
Follow the instructions in the README.
WARNING - Follow this walkthrough at your own risk - Backup your data beforehand - Only use in a test environment.
Normally, if you want to give a docker container access to a serial/usb device on a Synology Nas, you need to use SSH and run the container from the command line. The Synology Docker Gui does not include support for such access without setting 'priviledge' to true (which might be considered somewhat insecure, see docs.docker.com/#runtime-privilege).
The following method uses a workaround to overcome this restriction.
Open Control Panel and click on Info Center. Note the Model name. Go to http://www.jadahl.com/drivers_6.2/ and download the drivers for your model and unzip. Go to Synology Package Center and click on Manual Install and select the UsbSerialDrivers***.spk file.
Find Docker in the Package Center and install it.
If you can't see Docker in the Package Center, check here and look for a model which is similar to yours (e.g. for DS416Play this would be DS415+). Go to the Synology Download Center. From the device type, select 4-bay and for the model, select the ``one which is similar to yours . Find Docker in the package list and download the spk file. Now go to the Package Center on your DS416Play and click the Manual Install button.
Run Docker, select Registry and search for mozillaiot/gateway. Click Download and select latest.
Open File Station and Create New Shared Folder and make a shared folder where the gateway will store all it's files and logs, etc.
In Docker select Image and click on Launch.
Click on Advanced Settings. On the first tab do nothing.
On the Volume tab, select Add Folder, and select the shared folder that you created in the previous step. In the Mount path box type /home/node/.mozilla-iot.
In the Network tab select Use the same network as Docker Host. Click Apply, Next, Apply.
When the container is up and running (i.e. after a minute or two), click on Container, select mozillaiot-gateway1 and click on Settings, Export. Export to local computer, and save it somewhere.
Click on Action, Stop, and when it has stopped click on Action, Delete. Then wait for the container to disappear (usually takes several minutes). You may get an "Operation Failed" message. This can be ignored - just wait and the container will eventually disappear.
Open the exported Settings file with a text editor (e.g. Notepad) and replace the line:
"devices" : null,
with:
"devices" : [
{
"CgroupPermissions" : "rwm",
"PathInContainer" : "/dev/ttyACM0",
"PathOnHost" : "/dev/ttyACM0"
}
],
and change
"enable_restart_policy" : false,
to
"enable_restart_policy" : true,
Save the edited file (be careful not to change the file extension to .txt, it must remain as .json)
You may need to replace both occurences of ttyACM0 with ttyUSB0, depending on the type of USB dongle used. ttyACM0 should work with a Conbee II.
In File Station, Upload the edited settings file to your Nas.
In Docker, select Settings, Import, select the edited settings file, and click Ok. Select the newly created container and click on Action, Start.
That's it. You should now be able to log on to the Gateway via your favourite browser.
If you unplug and replug your zigbee dongle, you may need to restart the container in order for it to see the device. See Accessing-USB-Devices-In-Docker-without-using-privileged.html