Skip to content

Commit

Permalink
Merge pull request #137 from sensebox/docs/libraries
Browse files Browse the repository at this point in the history
docs: add /libraries to readme
  • Loading branch information
felixerdy authored Dec 20, 2024
2 parents 8bdca90 + 0adb1c8 commit c7884cb
Showing 1 changed file with 19 additions and 11 deletions.
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

0 comments on commit c7884cb

Please # to comment.