This JS file demonstrate how open a serial port to read it, and display read value over HTTP server.
Copy/Paste the script will display value at : http://localhost:3000 enjoy.
yarn add serialport
yarn add express
| # docker run -ti --rm -e DISPLAY=$DISPLAY -v /tmp/.X11-unix/:/tmp/.X11-unix --privileged --env="QT_X11_NO_MITSHM=1" --ipc=host --security-opt apparmor=unconfined --net=host -v /run/cups/cups.sock:/run/cups/cups.sock --env CUPS_SERVER=/run/cups/cups.sock epson | |
| FROM ubuntu:bionic | |
| RUN apt update && apt install -y wget qt4-default lsb libcups2 | |
| RUN wget 'https://download3.ebz.epson.net/dsc/f/03/00/14/28/59/566f892e1ca2e35685ff06dfd972b1c66fbed4d5/epson-printer-utility_1.1.1-1lsb3.2_amd64.deb' | |
| RUN dpkg -i epson-printer-utility_1.1.1-1lsb3.2_amd64.deb | |
| CMD service ecbd start && epson-printer-utility |
| #define PIN_INT 2 | |
| #define PIN_LED 13 | |
| void setup() { | |
| // put your setup code here, to run once: | |
| pinMode( PIN_LED, OUTPUT ); | |
| pinMode( PIN_INT, INPUT ); | |
| digitalWrite( PIN_LED, LOW ); | |
| } |
| #define PIN_BLINK_LED_BLUE 11 | |
| #define PIN_BLINK_LED_RED 9 | |
| #define PIN_BLINK_LED_GREEN 10 | |
| void setup() { | |
| // put your setup code here, to run once: | |
| pinMode( PIN_BLINK_LED_BLUE, OUTPUT ); | |
| pinMode( PIN_BLINK_LED_RED, OUTPUT ); | |
| pinMode( PIN_BLINK_LED_GREEN, OUTPUT ); | |
| digitalWrite( PIN_BLINK_LED_BLUE, LOW ); |
| version: "3" | |
| services: | |
| nginx: | |
| image: nginx | |
| networks: | |
| - frontend | |
| php: | |
| image: php:fpm | |
| networks: |
| version: '3' | |
| services: | |
| webapp: | |
| image: YOUR_PHP | |
| ports: | |
| - 12345:12345 | |
| deploy: | |
| replicas: 10 | |
| restart_policy: |
| version: '2' | |
| services: | |
| mysql: | |
| image: mysql | |
| environment: | |
| MYSQL_USER: dbuser | |
| MYSQL_PASSWORD: dbpassword | |
| MYSQL_ROOT_PASSWORD: dbrootpassword | |
| MYSQL_DATABASE: dbdatabase |
| version: '3' | |
| services: | |
| web: | |
| build: . | |
| ports: | |
| - "5000:5000" | |
| redis: | |
| image: "redis:alpine" | |
| # From : https://docs.docker.com/compose/gettingstarted/#step-3-define-services-in-a-compose-file |
| stages: | |
| - build | |
| variables: | |
| CONTAINER_TAG: IMAGE_NAME:$CI_BUILD_REF_NAME | |
| buildContainer: | |
| image: docker:latest | |
| stage: build | |
| script: |
| FROM debian:latest | |
| RUN apt-get update && apt-get upgrade -y && apt-get install -y php-cli && \ | |
| mkdir /monDossier && mkdir /monDossier/share | |
| COPY monScript.php /monDossier | |
| ADD http://proof.ovh.net/files/1Mb.dat /monDossier | |
| RUN mv /monDossier/monScript.php /monDossier/index.php |
This JS file demonstrate how open a serial port to read it, and display read value over HTTP server.
Copy/Paste the script will display value at : http://localhost:3000 enjoy.
yarn add serialport
yarn add express