Skip to content

Container build that bundles csDAQ and DropfreezingDetection

License

Notifications You must be signed in to change notification settings

CIF-Cold-Stage/deploy-cif

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

deploy-cif

This document contains the software build instructions for the Cold Stage. The software is in principle platform independent and can run on MacOS or Windows. The build instructions here are for Linux on x86 hardware only. Instructions for other platforms may be added at a later date.

1. Prerequisites

2. Build Container

Clone deploy-cif

[user@host ~]$ git clone https://github.com/CIF-Cold-Stage/deploy-cif.git

Change to build directory

[user@host ~]$ cd deploy-cif/build

Build container image

[user@host ~]$ podman build . -t deploy-cif:latest

This should finish with the statement

COMMIT deploy-cif:latest
--> 3e4e03c0a8c
Successfully tagged localhost/deploy-cif:latest

Note: It is of course possible to run the software without the container environment. In this case you will need to use Ubuntu 22.04 as distribution. If you stay with the container skip this. However, if you go that route:

  1. Use the steps in the Containerfile to install the required dependencies.
  2. You will need install the Julia language https://julialang.org/downloads/.
  3. You will need to install the camera device driver from IDS https://en.ids-imaging.com/ids-peak.html.
  4. You probably want to install VS Code https://code.visualstudio.com/
  5. You will need to clone the two software repos:
    1. https://github.com/CIF-Cold-Stage/csDAQ
    2. https://github.com/CIF-Cold-Stage/DropFreezingDetection.jl.git
  6. Adapt the steps below as needed.

3. Initialize Distrobox

  1. Login as the user that will use the instrument
  2. Create the box
[user@host ~]$ distrobox create --image localhost/deploy-cif:latest --name cif
Creating 'cif' using image localhost/deploy-cif:latest	[ OK ]
Distrobox 'cif' successfully created.
To enter, run:

distrobox enter cif
  1. Enter distrobox
[user@host ~]$ distrobox enter cif
Container cif is not running.
Starting container cif
run this command to follow along:

 podman logs -f cif

 Starting container...                  	[ OK ]
 Installing basic packages...           	[ OK ]
 Setting up read-only mounts...         	[ OK ]
 Setting up read-write mounts...        	[ OK ]
 Setting up host's sockets integration...	[ OK ]
 Integrating host's themes, icons, fonts...	[ OK ]
 Setting up package manager exceptions...	[ OK ]
 Setting up dpkg exceptions...          	[ OK ]
 Setting up apt hooks...                	[ OK ]
 Setting up sudo...                     	[ OK ]
 Setting up groups...                   	[ OK ]
 Setting up users...                    	[ OK ]
 Integrating host's themes, icons, fonts...	[ OK ]
 Setting up package manager exceptions...	[ OK ]
 Setting up dpkg exceptions...          	[ OK ]
 Setting up apt hooks...                	[ OK ]
 Setting up sudo...                     	[ OK ]
 Setting up groups...                   	[ OK ]
 Setting up users...                    	[ OK ]
 Executing init hooks...                	[ OK ]

Container Setup Complete!
petters@cif:~$ 
  1. Run postinstall script. This will download the julia package dependencies and precompile them. This may take a while...
[user@cif ~]$ bash /opt/csDAQ/build/build.sh 
  1. After finishing, the postinstall script creates two files 50-usb-serial.rules and 99-ids-usb-access.rules. Exit the distrobox by pressing CTRL-D so you are back on the host system. Note the change in the hostname.
[user@cif:~]$     
logout
[user@host ~]$
  1. On thee host copy these files to the /etc/udev/rules.d/ directory and reload the rules. This will ensure that the user has access to the serial and camera devices.
[user@host ~]$ sudo -s
[root@host ~]$ mv *.rules /etc/udev/rules.d/
[root@host ~]$ udevadm control --reload-rules && udevadm trigger
  1. Reboot the machine.

4. Test Camera

  1. Plug in the camera. Make sure it is plugged into a USB-3 port. The camera should show a green light.

  2. Enter distrobox

[user@host ~]$ distrobox enter cif
  1. Start ids_cockpit software. Check that you are able to open the camera and display an image stream.
[user@cif:~]$ ids_peak_cockpit

5. Test Serial Port

  1. Plug in the controller via USB cable. The controller has a USB-to-serial converter inside.

  2. Run the following commands to see if the serial port shows as /dev/ttyUSB0.

petters@cif:~$ cd /opt/csDAQ/src/
petters@cif:.../csDAQ/src$ julia --project
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.8.5 (2023-01-08)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> using LibSerialPort

julia> list_ports()
/dev/ttyUSB0
	Description:	FT232R USB UART - AD0K0TCI
	Transport type:	SP_TRANSPORT_USB
    
julia> 

6. Run the DAQ software

cd /opt/csDAQ/src/ && julia --project main.jl && cd .

About

Container build that bundles csDAQ and DropfreezingDetection

Resources

License

Stars

Watchers

Forks

Packages

No packages published