From d99f2cfbaa0ca1612f2ee59b6bfdef371f605a90 Mon Sep 17 00:00:00 2001 From: Mr Whiskers Date: Tue, 29 Nov 2022 13:19:23 -0700 Subject: [PATCH 1/4] pthreads was missing at least for aarch64 --- examples/olaclient/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/examples/olaclient/CMakeLists.txt b/examples/olaclient/CMakeLists.txt index 45a0e2f..3e43559 100644 --- a/examples/olaclient/CMakeLists.txt +++ b/examples/olaclient/CMakeLists.txt @@ -8,6 +8,10 @@ target_link_libraries(olaclient PCA9685) target_link_libraries(olaclient ola) target_link_libraries(olaclient olacommon) +set(THREADS_PREFER_PTHREAD_FLAG ON) +find_package(Threads REQUIRED) +target_link_libraries(olaclient Threads::Threads) + install(TARGETS olaclient DESTINATION bin) install(FILES olaclient.service DESTINATION /etc/systemd/system) From 8771f13e16f745d5b027358b17291dcea9fa7b65 Mon Sep 17 00:00:00 2001 From: Nathan Argetsinger Date: Mon, 19 Dec 2022 12:41:51 -0700 Subject: [PATCH 2/4] build only olaclient.. dockerfile and kubernetes deploy added --- .dockerignore | 4 ++++ Dockerfile | 31 +++++++++++++++++++++++++++++++ examples/CMakeLists.txt | 9 +++++---- 3 files changed, 40 insertions(+), 4 deletions(-) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..25b94cf --- /dev/null +++ b/.dockerignore @@ -0,0 +1,4 @@ +.dockerignore +.gitignore +Dockerfile +*.yml \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..fa57cb8 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,31 @@ +FROM balenalib/raspberrypi400-64-debian + +WORKDIR /PCA9685 + +COPY . . + +RUN apt update +RUN apt install cmake build-essential + +RUN mkdir build + +WORKDIR /PCA9685/build + +RUN cmake .. + +RUN make + +RUN make install + +# ola deps +RUN apt install ola libola-dev + +# audio deps +# RUN apt install libasound2 libasound2-dev libfftw3-3 libfftw3-dev + +# demo deps +# RUN apt install libncurses5-dev + +RUN make examples + +CMD ["sleep", "7200"] \ No newline at end of file diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index dff8b76..79cee5b 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -1,9 +1,10 @@ project(examples) # build the examples add_subdirectory(olaclient) -add_subdirectory(PCA9685demo) -add_subdirectory(quickstart) -add_subdirectory(audio) +#add_subdirectory(PCA9685demo) +#add_subdirectory(quickstart) +#add_subdirectory(audio) add_custom_target(examples) -add_dependencies(examples olaclient PCA9685demo quickstart audio) +add_dependencies(examples olaclient) +# PCA9685demo quickstart audio) From e8486789279556e28dd7a67d265f752285a1d2a4 Mon Sep 17 00:00:00 2001 From: Nathan Argetsinger Date: Mon, 19 Dec 2022 16:16:13 -0700 Subject: [PATCH 3/4] seems to work --- svc.yml | 20 ++++++++++++++ system-dependency-note/MicroOs.md | 8 ++++++ test-deploy.yml | 44 +++++++++++++++++++++++++++++++ 3 files changed, 72 insertions(+) create mode 100644 svc.yml create mode 100644 system-dependency-note/MicroOs.md create mode 100644 test-deploy.yml diff --git a/svc.yml b/svc.yml new file mode 100644 index 0000000..a293035 --- /dev/null +++ b/svc.yml @@ -0,0 +1,20 @@ +apiVersion: v1 +kind: Service +metadata: + name: my-service +spec: + selector: + app: pca9685 + type: NodePort + ports: + - + port: 9090 + nodePort: 30000 + name: my-port-9090 + + - + port: 7890 + nodePort: 30001 + name: my-port-9010 + + \ No newline at end of file diff --git a/system-dependency-note/MicroOs.md b/system-dependency-note/MicroOs.md new file mode 100644 index 0000000..998066e --- /dev/null +++ b/system-dependency-note/MicroOs.md @@ -0,0 +1,8 @@ +# Some changes are needed to the system + +i2c-dev must be loaded on boot + + + echo "i2c-dev" > /etc/modules-load.d/i2c-dev.conf + echo "i2c-bcm2708" > /etc/modules-load.d/i2c-bcm2708.conf + diff --git a/test-deploy.yml b/test-deploy.yml new file mode 100644 index 0000000..9d31a01 --- /dev/null +++ b/test-deploy.yml @@ -0,0 +1,44 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: pca9685 + labels: + app: pca9685 +spec: + replicas: 1 + selector: + matchLabels: + app: pca9685 + template: + metadata: + labels: + app: pca9685 + spec: + nodeName: tanis02 + containers: + - name: pca9685 + resources: + limits: + memory: "512Mi" + cpu: "400m" + image: nargetdev/pca9685:v0.0.0 + securityContext: + privileged: true + imagePullPolicy: Always + command: + - "/PCA9685/build/examples/olaclient/olaclient" + - name: ola + image: nargetdev/ola:v0.1.0 + imagePullPolicy: Always + securityContext: + privileged: true + resources: + limits: + memory: "512Mi" + cpu: 400m + # ports: + # - containerPort: 9090 + # - containerPort: 9010 + # - containerPort: 7890 + # - containerPort: 6454 + # - containerPort: 5568 From b2c9d725836b2b19b5fc70cd44764b4f5a3b190c Mon Sep 17 00:00:00 2001 From: Nathan Argetsinger Date: Tue, 20 Dec 2022 02:25:25 -0700 Subject: [PATCH 4/4] seems to work --- test-deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-deploy.yml b/test-deploy.yml index 9d31a01..1daa9c9 100644 --- a/test-deploy.yml +++ b/test-deploy.yml @@ -28,7 +28,7 @@ spec: command: - "/PCA9685/build/examples/olaclient/olaclient" - name: ola - image: nargetdev/ola:v0.1.0 + image: nargetdev/ola:v0.1.2 imagePullPolicy: Always securityContext: privileged: true