aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
blob: 1ff1707ca0b99c9b1cd3bdc72e2011e02ad5985a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# Why O-3000
O-3000 is our answer to rigid and inflexible vision solutions. Maybe you know that. The camera you'd like to use
does not support your (embedded) operating system. The interface specification is top secret and certainly you won't
get any driver source code. Due to such experiences we developed the O-3000 cameras. In the meantime, O-3000
has grown into a comprehensive vision system. Everything is open-source and all interface specifications are
freely available. These cameras are developed and produced in Switzerland.

## USB Host Driver
This USB driver is needed to communicate with the camera.

### Build and install for Linux
Make sure you've all tools for compiling and linking applications. Futher the tool *cmake*
is required. Run following commands in a shell:

```
git clone https://stettbacher.ch/gitlab/o-3000/driver.git
cd driver
mkdir build
cd build
cmake ..
sudo make install
```

### Build and install for Windows
This will install the free and open source software development
environment MinGW on your Windows system. MSYS2 contains a command line shell for development
usage and the MinGW compiler. Further informations are found here:

* [1] [MSYS2 Minimal SYStem 2 command-line shell](https://wiki.qt.io/MSYS2)
* [2] [Download MSYS2 installer](http://www.msys2.org/)

Download and execute newest MSYS2 installer version from [2]. Use the default
installation path *C:\msys64*. Otherwise MSYS might have a problem.

Run MSYS2-shell and update core components:

```
pacman -Sy
pacman --needed -S bash pacman pacman-mirrors msys2-runtime
```

You must exit out from MSYS2-shell, restart MSYS2-shell, then run below
command to complete rest of other component's update:

```
pacman -Su
```

Exit out of MSYS2-shell, restart MSYS2-shell, then you are ready to use MSYS2-shell. Double-check
whether MSYS is up-to-date:

```
pacman -Su
```

Install several tools for software development and building O-3000 libraries and applications.
This will install 32-bit and 64-bit toolchains:

```
pacman -S base-devel git 
pacman -S mingw-w64-i686-toolchain mingw-w64-x86_64-toolchain mingw-w64-i686-cmake mingw-w64-x86_64-cmake
pacman -S mingw64/mingw-w64-x86_64-libusb mingw32/mingw-w64-i686-libusb
```

Exit MSYS2-shell and run MSYS2-MinGW-shell located here:

```
C:\Users\<USER>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\MSYS2 64bit
```

You can choose between a 32-bit and 64-bit platform. Choose whatever you need.

Build O-3000 Driver:

```
mkdir o-3000-git
cd o-3000-git
git clone https://stettbacher.ch/gitlab/o-3000/driver.git
cd driver
mkdir build
cd build
cmake .. -G "MSYS Makefiles" -DCMAKE_INSTALL_PREFIX=$MSYSTEM_PREFIX
make
```

You'll find the DLL library at your building directory. If you want to install the library to the
MSYS2 system path, run following command:

```
make install
```

### Cross-Compile
A toolchain file is needed to specify the cross-compiler environment. As a starting point,
use the template 'cmake/toolchain_file_template.cmake'. Do specify the cross-compiler and path. 
Run the cmake command as follow:

```
cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchain_file_template.cmake ..
```