-
-
Notifications
You must be signed in to change notification settings - Fork 151
How to compile on Raspberry Pi
Umberto Baldi edited this page Oct 20, 2021
·
12 revisions
- In order to compile the Agent yourself, first you have to install golang. Please use version 1.14.15
- Then clone the repository with
git clone https://github.com/arduino/arduino-create-agent.git
- Change directory to the newly created one# :
cd arduino-create-agent/
- And finally to build use
go build -v -tags cli
. The-tags cli
flag is used to generate a binary that can be run headless without GUI or trayicon support. - start the binary with
./arduino-create-agent
. If all went well you should see something like this in the terminal window:
output
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, you have to install first the libraries required for the tray icon with sudo apt install libappindicator3-dev gir1.2-appindicator3-0.1 libgtk-3-dev
and then use sudo go build -v
to build instead of step 4 in the previous section
To start the binary without having to allocate a full terminal window to it you can run with the &
operator and nohup
: nohup ./arduino-create-agent &
:
-
&
starts the program in the background -
nohup
cashes the hangup signal and when the parent process is killed (the shell) it changes the parent to 1 (the init process)