You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
LabNet is a server to control hardware connected to RaspberryPi over Ethernet in behavioral experiment with animals. The protocol uses Google [Protobuf](https://github.com/protocolbuffers/protobuf) for the TCP/IP transport. The main goals are:
4
+
5
+
1. Simple communication protocol.
6
+
2. Easy to add support for new hardware.
7
+
3. Low latencies. Commands are mostly executed in 1ms, which includes also the communication over the network.
8
+
9
+
Build instructions can be found [here](doc/build_instructions.md).
The project uses CMake as build system. We will describe two compilation ways. Both ways need a running Raspberry Pi. But in case of Visual Studio only for debugging.
4
+
5
+
## Requirements
6
+
On Raspberry Pi we need some packages.
7
+
1. CMake
8
+
2. libsfml-dev
9
+
3. libasio-dev
10
+
4. libboost-system-dev
11
+
5. wiringpi
12
+
6. libprotoc-dev
13
+
7. gdbserver - only for debugging with Visual Studio 2019.
14
+
15
+
## On RaspberryPi
16
+
17
+
We recomend to use [VS Code](https://code.visualstudio.com) as IDE. You will need following extensions: C/C++ and CMake Tools from Microsoft. If you want to use VS Code remotelly you will also need Remove-SSH extension from Microsoft.
18
+
19
+
We also recomment to use Raspberry Pi 4 with at least 2GB RAM otherwise the compilation can take a long time.
With Visual Studio 2019 it is also possible to compile and remotely debug applications for Linux. We need the "C++-CMake-Tools for Linux" component for this.
32
+
33
+
### Docker
34
+
To speedup the compilation we will use a docker image which will contain the complete toolchain.
35
+
36
+
We need "Toolchain-rpi.cmake" and "Dockerfile" files from doc folder. The toolchain is based on [raspi-toolchain](https://github.com/Pro/raspi-toolchain).
37
+
38
+
1. Change in the terminal to the folder with both files.
39
+
2. build the docker image
40
+
```sh
41
+
docker build -t debian-vs -f .\Dockerfile .
42
+
```
43
+
3. start the new container
44
+
```sh
45
+
docker run -d -p 5000:22 debian-vs
46
+
```
47
+
4. connect with ssh to the container with:
48
+
```sh
49
+
ssh test@localhost -p 5000
50
+
```
51
+
the password is also "test".
52
+
5. to cross-compile we also need all current libraries and include files from your raspberry:
3. Configure both ssh connections to the docker container and the target Raspberry Pi under "Tools\Options\Cross Platform\Connection Manager". Select the Raspberry Pi connection as default one.
68
+
4. Open "CMakeSettings.json".
69
+
5. Choose under "Remote machine name" the docker container connection for Debug and Release configurations.
70
+
6. This step is only necessary if Raspberry Pi connection is not the default one. Right click on "CMakeList.txt" and select "Open Debug And Launch Settings". In the json file delete the value of the "remoteMachineName" parameter. Press "Ctr+Spacebar" and select the right connection.
71
+
7. Choose the build configuration "Linux-GCC-Release" or "Linux-GCC-Debug" and "gdbserver" as startup item.
72
+
8. If you press "Start Debugging" Visual Studio will compile LabNet on the docker container, transfer it to Raspberry Pi and start over gdbserver.
0 commit comments