-
-
Notifications
You must be signed in to change notification settings - Fork 149
How to compile on Raspberry Pi
per1234 edited this page Mar 13, 2024
·
12 revisions
- In order to compile the Agent yourself, first you have to install golang.
You must use the version specified by thego
directive in the project'sgo.mod
file:
https://github.com/arduino/arduino-create-agent/blob/main/go.mod
ⓘ gvm is recommended if you need to work with multiple versions of Go on your machine. - Install Task:
https://taskfile.dev/installation/ - Then clone the repository with the following command:
git clone https://github.com/arduino/arduino-create-agent.git
- Use the following command to change directory to the newly created one:
cd arduino-create-agent/
- Use the following command to build:
ⓘ The
go:build-cli
go:build-cli
task is used to generate a binary that can be run headless without GUI or trayicon support. - Start the binary with the following command:
./arduino-create-agent_cli
If all went well you should see something like this in the terminal window:
Click to expand
INFO[0000] Version:x.x.x-dev
INFO[0000] Hostname: raspberrypi
INFO[0000] Garbage collection is on using Standard mode, meaning we just let Golang determine when to garbage collect.
INFO[0000] You specified a serial port regular expression filter: usb|acm|com
INFO[0000] Your serial ports:
INFO[0000] There are no serial ports to list.
[GIN-debug] [WARNING] Running in "debug" mode. Switch to "release" mode in production.
- using env: export GIN_MODE=release
- using code: gin.SetMode(gin.ReleaseMode)
[GIN-debug] GET / --> main.homeHandler (2 handlers)
[GIN-debug] GET /certificate.crt --> main.certHandler (2 handlers)
[GIN-debug] DELETE /certificate.crt --> main.deleteCertHandler (2 handlers)
[GIN-debug] POST /upload --> main.uploadHandler (2 handlers)
[GIN-debug] GET /socket.io/ --> main.(*WsServer).ServeHTTP-fm (2 handlers)
[GIN-debug] POST /socket.io/ --> main.(*WsServer).ServeHTTP-fm (2 handlers)
[GIN-debug] WS /socket.io/ --> main.(*WsServer).ServeHTTP-fm (2 handlers)
[GIN-debug] WSS /socket.io/ --> main.(*WsServer).ServeHTTP-fm (2 handlers)
[GIN-debug] GET /info --> main.infoHandler (2 handlers)
[GIN-debug] POST /killbrowser --> main.killBrowserHandler (2 handlers)
[GIN-debug] POST /pause --> main.pauseHandler (2 handlers)
[GIN-debug] POST /update --> main.updateHandler (2 handlers)
[GIN-debug] GET /v2/*path --> github.com/gin-gonic/gin.WrapH.func1 (2 handlers)
[GIN-debug] POST /v2/*path --> github.com/gin-gonic/gin.WrapH.func1 (2 handlers)
[GIN-debug] PUT /v2/*path --> github.com/gin-gonic/gin.WrapH.func1 (2 handlers)
[GIN-debug] PATCH /v2/*path --> github.com/gin-gonic/gin.WrapH.func1 (2 handlers)
[GIN-debug] HEAD /v2/*path --> github.com/gin-gonic/gin.WrapH.func1 (2 handlers)
[GIN-debug] OPTIONS /v2/*path --> github.com/gin-gonic/gin.WrapH.func1 (2 handlers)
[GIN-debug] DELETE /v2/*path --> github.com/gin-gonic/gin.WrapH.func1 (2 handlers)
[GIN-debug] CONNECT /v2/*path --> github.com/gin-gonic/gin.WrapH.func1 (2 handlers)
[GIN-debug] TRACE /v2/*path --> github.com/gin-gonic/gin.WrapH.func1 (2 handlers)
[GIN-debug] Listening and serving HTTP on 127.0.0.1:8991
Is possible to build also with tray icon support. In order to do so, use the following command to build instead of step 5 in the previous section:
task go:build
Start the binary with the following command:
./arduino-create-agent
To start the binary without having to allocate a full terminal window to it you can run it with the following command:
nohup ./arduino-create-agent &
-
&
starts the program in the background -
nohup
catches the hangup signal and when the parent process is killed (the shell) it changes the parent to 1 (the init process)