├── README-DEVELOPER.md ├── README.md ├── docker-github-actions-runner.patch ├── docker-github-actions-runner.sh ├── images ├── arduino-ide.png ├── arduino-ide.svg ├── kofibutton.svg ├── screenshot.jpg ├── screenshot_small.jpg ├── ubuntu.jpg └── ubuntu_small.jpg └── self_hosted_runner.patch /README-DEVELOPER.md: -------------------------------------------------------------------------------- 1 | # arduino-ide 2.0.0 for Raspberry Pi 2 | 3 | [![arduino ide 2.0](images/screenshot_small.jpg)](https://github.com/koendv/arduino-ide-raspberrypi/raw/main/images/screenshot.jpg) 4 | 5 | ## compiling the IDE 6 | 7 | These are instructions on compiling [arduino-ide 2](https://github.com/arduino/arduino-ide) for arm64 processors. Compiling can be done on raspberry pi os 64-bit or ubuntu arm64. The compiled binaries run on raspberry pi os 64-bit and ubuntu arm64. 8 | 9 | Compiling is done using github actions, the same build process as on X86. 10 | 11 | Because github does not offer linux arm64 runners, compilation is done using a self-hosted runner on a raspberry pi. 12 | 13 | Because github does not recommend running self-hosted runners on public repositories, the arduino-ide repository is forked first, and public PR are switched off on the fork. 14 | 15 | For repeatability and security, compilation is done inside a docker. 16 | 17 | ## fork arduino-ide 18 | 19 | Set up a copy of the arduino-ide github. 20 | 21 | - in github, fork [arduino/arduino-ide](https://github.com/arduino/arduino-ide) 22 | - patch your fork with the file _self_hosted_runner.patch_. The patch adds a new build target "self-hosted" to arduino-ide, next to the existing Windows, Ubuntu and MacOS. 23 | - for cosmetics, set a tag to show the release name 24 | 25 | ``` 26 | git clone https://github.com/koendv/arduino-ide-raspberrypi 27 | git clone https://github.com/your_git_account/arduino-ide 28 | cd arduino-ide 29 | patch -p1 < ../arduino-ide-raspberrypi/self_hosted_runner.patch 30 | git add .github/workflows/build.yml 31 | git add arduino-ide-extension/src/test/node/boards-service-impl.slow-test.ts 32 | git add arduino-ide-extension/src/test/node/node-test-bindings.ts 33 | git add arduino-ide-extension/package.json 34 | git commit -m arm64 35 | git push 36 | git tag -a 2.2.0-arm64 -m self-hosted 37 | git push --tags 38 | ``` 39 | 40 | ## set up docker 41 | 42 | For repeatability and security, the self-hosted runner runs in a docker image. 43 | 44 | - in github, fork [myoung34/docker-github-actions-runner](https://github.com/myoung34/docker-github-actions-runner). This is a dockerfile for self-hosted runners. 45 | - patch your fork with the file _docker-github-actions-runner.patch_. The patch adds build dependencies - node, yarn, and libraries - to the docker image. 46 | 47 | ``` 48 | git clone https://github.com/koendv/docker-github-actions-runner 49 | cd docker-github-actions-runner 50 | patch -p1 < ../arduino-ide-raspberrypi/docker-github-actions-runner.patch 51 | git add Dockerfile 52 | git add entrypoint.sh 53 | git commit -m arduino-ide 54 | git push 55 | ``` 56 | 57 | ## configure self-hosted runner 58 | Configure a new self-hosted runner. 59 | On github.com, go to your fork of the arduino-ide. 60 | 61 | - In _Settings -> Moderation options -> Code review limits_, enable "Limit to users explicitly granted read or higher access" 62 | - In _Settings -> General -> Code and Automation -> Actions -> Runners_, click on _New Self-Hosted Runner_, Linux, ARM64. 63 | 64 | ## set up raspberry pi 65 | 66 | On the raspberry pi runner: 67 | 68 | - Install Raspberry Pi OS 64-bit or ubuntu arm64. 69 | - install docker using the [convenience script](https://docs.docker.com/engine/install/debian/#install-using-the-convenience-script). 70 | 71 | Copy the shell script to run the local runner to the raspberry pi: 72 | 73 | ``` 74 | wget https://raw.githubusercontent.com/koendv/arduino-ide-raspberrypi/main/docker-github-actions-runner.sh 75 | chmod +x docker-github-actions-runner.sh 76 | ``` 77 | 78 | Edit `docker-github-actions-runner.sh`: 79 | 80 | - ACCESS_TOKEN is your github personal access token. 81 | - REPO_URL is the url of your fork of the arduino-ide 82 | - RUNNER_URL is the url of your fork of docker-github-actions-runner 83 | - WORK_DIR is a directory where the script may create files 84 | 85 | This script will 86 | 87 | - clone RUNNER_URL in WORK_DIR 88 | - create a docker image _self-hosted-runner_, if the image does not exist already 89 | - run the docker image 90 | 91 | Run the script to start the self-hosted runner: 92 | ``` 93 | ./docker-github-actions-runner.sh 94 | ``` 95 | After installing some packages, a self-hosted runner starts up: 96 | 97 | ``` 98 | -------------------------------------------------------------------------------- 99 | | ____ _ _ _ _ _ _ _ _ | 100 | | / ___(_) |_| | | |_ _| |__ / \ ___| |_(_) ___ _ __ ___ | 101 | | | | _| | __| |_| | | | | '_ \ / _ \ / __| __| |/ _ \| '_ \/ __| | 102 | | | |_| | | |_| _ | |_| | |_) | / ___ \ (__| |_| | (_) | | | \__ \ | 103 | | \____|_|\__|_| |_|\__,_|_.__/ /_/ \_\___|\__|_|\___/|_| |_|___/ | 104 | | | 105 | | Self-hosted runner registration | 106 | | | 107 | -------------------------------------------------------------------------------- 108 | 109 | # Authentication 110 | ``` 111 | 112 | Output should end with `Listening for Jobs` 113 | 114 | ## start the build 115 | 116 | On github.com, go to your fork of the arduino-ide. 117 | 118 | - In "Actions", under "Workflows" choose "Arduino IDE", click "Enable Workflow". 119 | - Click "Run workflow". Use workflow from "Tags: 2.0.0-arm64" (the tag created above) 120 | - On the runner, output should be ``Running job: build (self-hosted)``. You can follow what happens in the build through the github web interface. 121 | 122 | Build time is less than one hour on a raspberry pi 4b, 8gb ram. 123 | ``` 124 | √ Connected to GitHub 125 | 126 | Current runner version: '2.294.0' 127 | 2022-06-23 13:07:35Z: Listening for Jobs 128 | 2022-06-23 13:09:38Z: Running job: build (self-hosted) 129 | 2022-06-23 13:54:14Z: Job build (self-hosted) completed with result: Succeeded 130 | ``` 131 | 132 | ## download binaries 133 | 134 | - After the run, arm64 binaries for raspberry pi are on github, in "Artifacts." 135 | - On github.com, go to your fork of the arduino-ide. Under "All workflows - Showing runs from all workflows" click on "Arduino IDE". The binaries are under "Artifacts - Produced during runtime 136 | ": 137 | ``Linux_ARM64_app_image`` and 138 | ``Linux_ARM64_zip``. Click to download. 139 | - When the build is completed and the binaries downloaded, stop the runner on the raspberry and delete your arduino-ide fork on github. It is no longer needed. 140 | 141 | ## note 142 | 143 | Once created, the docker image _self-hosted-runner_ is used until it is removed. 144 | 145 | If you modify one of the shell variables in `docker-github-actions-runner.sh`, remove the docker image to force a rebuild: 146 | `` 147 | docker rmi self-hosted-runner 148 | `` 149 | 150 | not truncated. 151 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # arduino-ide 2.0.0 for Raspberry Pi 2 | 3 | [![arduino ide 2.0](images/screenshot_small.jpg)](https://github.com/koendv/arduino-ide-raspberrypi/raw/main/images/screenshot.jpg) 4 | 5 | This is [arduino-ide 2](https://github.com/arduino/arduino-ide) compiled for raspberry pi os 64-bit and ubuntu bionic arm64. 6 | 7 | ## Installation on Raspberry Pi OS 64-bit 8 | 9 | arduino-ide 2.0 is available as appimage. 10 | 11 | Home directory on external usb disk recommended; home directory on internal sd card can be painfully slow. 12 | 13 | To install, download and run the latest appimage from [releases](https://github.com/koendv/arduino-ide-raspberrypi/releases/). 14 | 15 | On Raspberry PI OS 11, first install fuse: 16 | ```sh 17 | sudo apt-get install fuse libfuse-dev 18 | 19 | ``` 20 | 21 | ## Forum 22 | 23 | The official forum for discussion of arduino ide 2.x is [here](https://forum.arduino.cc/c/software/ide-2-x/). 24 | 25 | ## Installation on Ubuntu arm64 26 | 27 | [![arduino ide 2.0](images/ubuntu_small.jpg)](https://github.com/koendv/arduino-ide-raspberrypi/raw/main/images/ubuntu.jpg) 28 | 29 | This appimage runs not only on raspberry pi os 64-bit, but also on ubuntu arm64. 30 | To run the appimage on ubuntu-arm64 first install libz and fuse: 31 | ```sh 32 | sudo apt-get install zlib1g-dev fuse libfuse-dev 33 | 34 | ``` 35 | and reboot. Then download and install the appimage. 36 | 37 | ## Developers 38 | 39 | Compilation notes are in [README-DEVELOPER.md](README-DEVELOPER.md) 40 | 41 | If you like this, maybe you want to buy me a cup of tea: 42 | 43 | [![ko-fi](images/kofibutton.svg)](https://ko-fi.com/Q5Q03LPDQ) 44 | 45 | not truncated. 46 | -------------------------------------------------------------------------------- /docker-github-actions-runner.patch: -------------------------------------------------------------------------------- 1 | commit b387877134205ea0b21cea7fc5b1a894899c54eb 2 | Author: Koen De Vleeschauwer 3 | Date: Fri Jun 30 19:35:40 2023 +0200 4 | 5 | arduino-ide 6 | 7 | diff --git a/Dockerfile b/Dockerfile 8 | index 39adc19..c1f2f1a 100644 9 | --- a/Dockerfile 10 | +++ b/Dockerfile 11 | @@ -1,5 +1,5 @@ 12 | # hadolint ignore=DL3007 13 | -FROM myoung34/github-runner-base:latest 14 | +FROM myoung34/github-runner-base:ubuntu-bionic 15 | LABEL maintainer="myoung34@my.apsu.edu" 16 | 17 | ENV AGENT_TOOLSDIRECTORY=/opt/hostedtoolcache 18 | @@ -7,7 +7,7 @@ RUN mkdir -p /opt/hostedtoolcache 19 | 20 | ARG GH_RUNNER_VERSION="2.305.0" 21 | 22 | -ARG TARGETPLATFORM 23 | +ARG TARGETPLATFORM="linux/arm64" 24 | 25 | SHELL ["/bin/bash", "-o", "pipefail", "-c"] 26 | 27 | @@ -22,5 +22,11 @@ RUN chmod +x /actions-runner/install_actions.sh \ 28 | COPY token.sh entrypoint.sh app_token.sh / 29 | RUN chmod +x /token.sh /entrypoint.sh /app_token.sh 30 | 31 | +# install arduino ide build dependencies 32 | +RUN apt-get install -y libxkbfile-dev libsecret-1-dev 33 | + 34 | +# install nvm 35 | +RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash 36 | + 37 | ENTRYPOINT ["/entrypoint.sh"] 38 | CMD ["./bin/Runner.Listener", "run", "--startuptype", "service"] 39 | diff --git a/entrypoint.sh b/entrypoint.sh 40 | index 5ae7108..32e5755 100644 41 | --- a/entrypoint.sh 42 | +++ b/entrypoint.sh 43 | @@ -173,6 +173,10 @@ if [[ ${_START_DOCKER_SERVICE} == "true" ]]; then 44 | service docker start 45 | fi 46 | 47 | +. $HOME/.nvm/nvm.sh 48 | +nvm install 14.0.0 49 | +npm install --global yarn 50 | + 51 | # Container's command (CMD) execution as runner user 52 | 53 | 54 | -------------------------------------------------------------------------------- /docker-github-actions-runner.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -x 2 | 3 | # before use, modify: 4 | # ACCESS_TOKEN is your github access token 5 | # REPO_URL is the url of your fork of https://github.com/arduino/arduino-ide 6 | # RUNNER_URL is the url of your fork of https://github.com/myoung34/docker-github-actions-runner 7 | # WORK_DIR 8 | 9 | WORK_DIR=~/src 10 | ACCESS_TOKEN=ghp_YOUR_GITHUB_PERSONAL_ACCESS_TOKEN 11 | REPO_URL=https://github.com/koendv/arduino-ide 12 | RUNNER_URL=https://github.com/koendv/docker-github-actions-runner 13 | DISABLE_AUTO_UPDATE=1 14 | 15 | # check docker and git available 16 | 17 | if ! command -v docker 18 | then 19 | echo install docker 20 | exit 0 21 | fi 22 | 23 | if ! command -v git 24 | then 25 | echo install git 26 | exit 0 27 | fi 28 | 29 | # check if docker image exists 30 | 31 | if [ ! $(docker image inspect self-hosted-runner '--format=""') ] 32 | then 33 | # build docker image 34 | 35 | if [ ! -d ${WORK_DIR} ] 36 | then 37 | mkdir -p ${WORK_DIR} 38 | fi 39 | 40 | DOCKER_DIR=${WORK_DIR}/docker-github-actions-runner 41 | 42 | if [ -d ${DOCKER_DIR} ] 43 | then 44 | echo ${DOCKER_DIR} already exists 45 | exit 0 46 | fi 47 | 48 | git clone ${RUNNER_URL} ${DOCKER_DIR} 49 | 50 | if [ ! -f ${DOCKER_DIR}/Dockerfile ] 51 | then 52 | echo no Dockerfile 53 | exit 0 54 | fi 55 | 56 | docker build ${DOCKER_DIR} --tag self-hosted-runner 57 | 58 | if [ ! $(docker image inspect self-hosted-runner '--format=""') ] 59 | then 60 | echo no docker image 61 | exit 0 62 | fi 63 | 64 | fi 65 | 66 | docker run --env "ACCESS_TOKEN=${ACCESS_TOKEN}" --env RUNNER_SCOPE=repo --env "REPO_URL=${REPO_URL}" --env RUNNER_NAME=arduino-ide-runner self-hosted-runner 67 | 68 | #not truncated 69 | -------------------------------------------------------------------------------- /images/arduino-ide.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koendv/arduino-ide-raspberrypi/6319a7bfda93cf2916fb2072cc1a563ca799a0f8/images/arduino-ide.png -------------------------------------------------------------------------------- /images/arduino-ide.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 23 | 25 | 27 | 31 | 35 | 36 | 38 | 42 | 46 | 47 | 54 | 61 | 64 | 69 | 70 | 80 | 81 | 99 | 101 | 102 | 104 | image/svg+xml 105 | 107 | 108 | 109 | 110 | 111 | 125 | 131 | 140 | 141 | 147 | 152 | 153 | 159 | 164 | 169 | 174 | 179 | 184 | 189 | 194 | 199 | 204 | 209 | 214 | 219 | 225 | 230 | 231 | 237 | 246 | 247 | 253 | 259 | 264 | 269 | 274 | 275 | 276 | -------------------------------------------------------------------------------- /images/kofibutton.svg: -------------------------------------------------------------------------------- 1 | 2 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | Artboard 26 | 27 | 28 | 29 | 31 | 39 | 43 | 44 | 45 | 69 | 70 | Artboard 72 | Created with Sketch. 74 | 83 | 88 | 93 | 97 | 101 | 105 | 109 | 113 | 117 | 121 | 125 | 129 | 133 | 137 | 141 | 145 | 149 | 150 | 151 | -------------------------------------------------------------------------------- /images/screenshot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koendv/arduino-ide-raspberrypi/6319a7bfda93cf2916fb2072cc1a563ca799a0f8/images/screenshot.jpg -------------------------------------------------------------------------------- /images/screenshot_small.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koendv/arduino-ide-raspberrypi/6319a7bfda93cf2916fb2072cc1a563ca799a0f8/images/screenshot_small.jpg -------------------------------------------------------------------------------- /images/ubuntu.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koendv/arduino-ide-raspberrypi/6319a7bfda93cf2916fb2072cc1a563ca799a0f8/images/ubuntu.jpg -------------------------------------------------------------------------------- /images/ubuntu_small.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koendv/arduino-ide-raspberrypi/6319a7bfda93cf2916fb2072cc1a563ca799a0f8/images/ubuntu_small.jpg -------------------------------------------------------------------------------- /self_hosted_runner.patch: -------------------------------------------------------------------------------- 1 | diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml 2 | index 1c830648..ab6ac95a 100644 3 | --- a/.github/workflows/build.yml 4 | +++ b/.github/workflows/build.yml 5 | @@ -67,17 +67,18 @@ jobs: 6 | strategy: 7 | matrix: 8 | config: 9 | - - os: windows-2019 10 | - certificate-secret: WINDOWS_SIGNING_CERTIFICATE_PFX # Name of the secret that contains the certificate. 11 | - certificate-password-secret: WINDOWS_SIGNING_CERTIFICATE_PASSWORD # Name of the secret that contains the certificate password. 12 | - certificate-extension: pfx # File extension for the certificate. 13 | - - os: ubuntu-20.04 14 | - - os: macos-latest 15 | - # APPLE_SIGNING_CERTIFICATE_P12 secret was produced by following the procedure from: 16 | - # https://www.kencochrane.com/2020/08/01/build-and-sign-golang-binaries-for-macos-with-github-actions/#exporting-the-developer-certificate 17 | - certificate-secret: APPLE_SIGNING_CERTIFICATE_P12 18 | - certificate-password-secret: KEYCHAIN_PASSWORD 19 | - certificate-extension: p12 20 | +# - os: windows-2019 21 | +# certificate-secret: WINDOWS_SIGNING_CERTIFICATE_PFX # Name of the secret that contains the certificate. 22 | +# certificate-password-secret: WINDOWS_SIGNING_CERTIFICATE_PASSWORD # Name of the secret that contains the certificate password. 23 | +# certificate-extension: pfx # File extension for the certificate. 24 | +# - os: ubuntu-20.04 25 | +# - os: macos-latest 26 | +# # APPLE_SIGNING_CERTIFICATE_P12 secret was produced by following the procedure from: 27 | +# # https://www.kencochrane.com/2020/08/01/build-and-sign-golang-binaries-for-macos-with-github-actions/#exporting-the-developer-certificate 28 | +# certificate-secret: APPLE_SIGNING_CERTIFICATE_P12 29 | +# certificate-password-secret: KEYCHAIN_PASSWORD 30 | +# certificate-extension: p12 31 | + - os: self-hosted 32 | runs-on: ${{ matrix.config.os }} 33 | timeout-minutes: 90 34 | 35 | @@ -93,6 +94,7 @@ jobs: 36 | cache: 'yarn' 37 | 38 | - name: Install Python 3.x 39 | + if: matrix.config.os != 'self-hosted' 40 | uses: actions/setup-python@v4 41 | with: 42 | python-version: '3.x' 43 | @@ -166,6 +168,10 @@ jobs: 44 | name: Linux_X86-64_zip 45 | - path: '*Linux_64bit.AppImage' 46 | name: Linux_X86-64_app_image 47 | + - path: '*Linux_arm64.zip' 48 | + name: Linux_arm64_zip 49 | + - path: '*Linux_arm64.AppImage' 50 | + name: Linux_arm64_app_image 51 | - path: '*macOS_64bit.dmg' 52 | name: macOS_dmg 53 | - path: '*macOS_64bit.zip' 54 | diff --git a/arduino-ide-extension/src/test/node/boards-service-impl.slow-test.ts b/arduino-ide-extension/src/test/node/boards-service-impl.slow-test.ts 55 | index fbd5aeb4..a3b865bb 100644 56 | --- a/arduino-ide-extension/src/test/node/boards-service-impl.slow-test.ts 57 | +++ b/arduino-ide-extension/src/test/node/boards-service-impl.slow-test.ts 58 | @@ -20,6 +20,7 @@ describe('boards-service-impl', () => { 59 | 60 | describe('search', () => { 61 | it('should run search', async function () { 62 | + this.timeout(20_000); 63 | const result = await boardService.search({}); 64 | expect(result).is.not.empty; 65 | }); 66 | diff --git a/arduino-ide-extension/src/test/node/node-test-bindings.ts b/arduino-ide-extension/src/test/node/node-test-bindings.ts 67 | index 2b4c651f..c61b00f5 100644 68 | --- a/arduino-ide-extension/src/test/node/node-test-bindings.ts 69 | +++ b/arduino-ide-extension/src/test/node/node-test-bindings.ts 70 | @@ -318,7 +318,7 @@ export async function startDaemon( 71 | configService.onStart(); 72 | daemon.onStart(); 73 | await Promise.all([ 74 | - waitForEvent(daemon.onDaemonStarted, 10_000), 75 | + waitForEvent(daemon.onDaemonStarted, 20_000), 76 | coreClientProvider.client, 77 | ]); 78 | if (startCustomizations) { 79 | diff --git a/arduino-ide-extension/package.json b/arduino-ide-extension/package.json 80 | index eccac3c5..d30a39e3 100644 81 | --- a/arduino-ide-extension/package.json 82 | +++ b/arduino-ide-extension/package.json 83 | @@ -140,7 +140,7 @@ 84 | "reporter": "spec", 85 | "colors": true, 86 | "watch-extensions": "js", 87 | - "timeout": 10000 88 | + "timeout": 20000 89 | }, 90 | "files": [ 91 | "lib", 92 | --------------------------------------------------------------------------------