Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add /libraries to readme #137

Merged
merged 2 commits into from
Dec 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 19 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Downloads a compiled sketch.
Parameters:

- `id` is the returned `id` from `/compile`
- `board` specifies which compiled file should be downloaded. Posibile values `sensebox-mcu` or `sensebox`
- `board` specifies which compiled file should be downloaded. Possible values `sensebox-mcu` or `sensebox`
- `filename` name for the sketch. Default value is `sketch`

```
Expand All @@ -73,6 +73,24 @@ Responses have a `content-type: application/octet-stream` header and contain the

It also have a `Content-Disposition: attachment; filename:{filename}.bin|hex` header to force download.

#### `GET /libraries`

Shows a list of all installed Arduino libraries.

```
https://compiler.sensebox.de/libraries
```

Parameters:

- `format` specifies the output format. Possible value: `json`

```
https://compiler.sensebox.de/libraries?format=json
```

Will return a list of all installed libraries in JSON format.

## Scaling with docker-compose

Newer versions of docker allows to give the same alias to multiple containers in the same network. We exploit this to run multiple instances at the same time to balance load.
Expand All @@ -84,13 +102,3 @@ Just start multiple instances using
docker-compose up -d --scale compiler=4

Then reference the containers by its `compiler` alias and multiple requests will be served by different containers.

## In the container

### Compiling senseBox MCU Sketches Examples

arduino-builder -hardware /arduino-ide/hardware -hardware /root/.arduino15/packages -tools /arduino-ide/tools-builder -tools /root/.arduino15/packages -libraries /arduino-ide/libraries -fqbn=sensebox:samd:sb:power=on -build-cache /arduino-ide/build-cache -build-path /arduino-ide/builds /root/.arduino15/packages/sensebox/hardware/samd/1.0.4/libraries/senseBox/examples/Blink/Blink.ino

### Compiling for Arduino Uno

arduino-builder -hardware /arduino-ide/hardware -hardware /root/.arduino15/packages -tools /arduino-ide/tools-builder -tools /root/.arduino15/packages -libraries /arduino-ide/libraries -fqbn=arduino:avr:uno -build-cache /arduino-ide/build-cache -build-path /arduino-ide/builds /root/.arduino15/packages/sensebox/hardware/samd/1.0.4/libraries/senseBox/examples/Blink/Blink.ino
Loading