{"id":16525414,"url":"https://github.com/fdelporte/vaadin-examples","last_synced_at":"2025-10-28T08:31:37.600Z","repository":{"id":118551864,"uuid":"466424471","full_name":"FDelporte/Vaadin-examples","owner":"FDelporte","description":"Examples of Vaadin interacting with the GPIOs of the Raspberry Pi ","archived":false,"fork":false,"pushed_at":"2023-09-26T12:35:11.000Z","size":1861,"stargazers_count":4,"open_issues_count":1,"forks_count":6,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-01T12:51:13.195Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FDelporte.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2022-03-05T10:45:36.000Z","updated_at":"2024-12-20T07:43:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"8f06ebf4-0a1a-47d9-910d-87d71a3f5d6c","html_url":"https://github.com/FDelporte/Vaadin-examples","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FDelporte%2FVaadin-examples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FDelporte%2FVaadin-examples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FDelporte%2FVaadin-examples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FDelporte%2FVaadin-examples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FDelporte","download_url":"https://codeload.github.com/FDelporte/Vaadin-examples/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238623006,"owners_count":19502963,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-11T17:02:43.636Z","updated_at":"2025-10-28T08:31:37.582Z","avatar_url":"https://github.com/FDelporte.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pi4J Demo\n\nThis is a Spring-based demo project to show how a Vaadin User Interface (website) can interact with the GPIOs of a\nRaspberry Pi by using the [Pi4J library](https://www.pi4j.com).\n\nInitially, the code and included examples are created to interact with components of\nthe [CrowPi](https://www.elecrow.com/mcu/raspberry-pi/development-kit.html) and have been used in various demos with\nboth the CrowPi 1, 2, and 3. As they contain different components, not all of the examples work identically on the all\ndevices. Therefor, a config is added, which needs to be specified\nin [the enum DemoSetupConfig.java](src/main/java/be/webtechie/vaadin/pi4j/service/DemoSetupConfig.java) and [\n`DemoSetupConfig DEMO_SETUP_CONFIG` in Pi4JService.java](src/main/java/be/webtechie/vaadin/pi4j/service/Pi4JService.java)\n\nOfcourse, you don't need to use a CrowPi to use this code. You can use any other Raspberry Pi with a GPIO header and\nconnect the electronic components directly to the GPIO pins. Change the pin numbers as needed, and you are good to go.\n\nFollowing versions of this code are available in branches:\n\n* [main](https://github.com/FDelporte/Vaadin-examples/tree/main):\n    * Dependencies got upgraded to latest versions in September 2025 of Spring Boot, Vaadin\n    * Many code changes to be compatible with those new versions.\n    * Uses Pi4J V4.0.0-SNAPSHOT.\n    * Uses Pi4J Drivers V0.0.1-SNAPSHOT.\n    * Separate services per type of device to make it easier to understand and reuse in other applications.\n* [vaadin-23-spring-2.6](https://github.com/FDelporte/Vaadin-examples/tree/vaadin-23-spring-2.6): Initial example with\n  LED output and button input, based on Vaadin 23 and Spring Boot 2.6. It is described in detail\n  in [this Foojay.io blog post](https://foojay.io/today/blink-a-led-on-raspberry-pi-with-vaadin/).\n* [vaadin-24-spring-3.0](https://github.com/FDelporte/Vaadin-examples/tree/vaadin-24-spring-3.0): Example used during a\n  few conference talks,\n  e.g. [Controlling Electronics with Java and Pi4J through a web interface (J-Spring 2023)](https://www.youtube.com/watch?v=FXKsBKKB_Xg)\n  and [Unlocking the Potential of Bits and Bytes (Devoxx 2023)](https://www.youtube.com/watch?v=ex0t2uaL27I).\n\n## Vaadin UI\n\nThe base code with different Vaadin layouts, was generated on [start.vaadin.com/app](https://start.vaadin.com/app).\n\n![Vaadin UI](doc/screenshot-running-on-rpi.png)\n\n## Components\n\nThe application can interact with various components in the CrowPi1.\n\n![Demo content on CrowPi](doc/demo-content-on-crowpi.jpg)\n\n## Upload to Raspberry Pi\n\nIf you are developing on a PC, you can build the application with the following command\n\n* Windows: `mvnw clean package -Pproduction`\n* Mac \u0026 Linux: `./mvnw clean package -Pproduction`\n\nand upload to your Raspberry Pi with (replace login `pi` and the IP address with the one of your board)\n\n```shell\n$ scp target/pi4jdemo-1.0-SNAPSHOT.jar pi@192.168.0.222://home/pi/\n```\n\nBuild and upload in one command:\n\n```shell\n./mvnw clean package -Pproduction \u0026\u0026 scp target/pi4jdemo-1.0-SNAPSHOT.jar frank@crowpi3.local://home/frank/\n```\n\n## Run on Raspberry Pi\n\nPWM and DHT11 need to be enabled on the Raspberry Pi. For example, on a Raspberry Pi 5:\n\n```shell\n$ sudo nano /boot/firmware/config.txt \n# Add at the end of the file:\ndtoverlay=pwm-2chan,pin=18,func=2,pin2=12,func2=4\ndtoverlay=dht11,gpiopin=4\n```\n\nWe can now start the application on your Raspberry Pi to interact with the GPIOs. Make sure to specify the version of\nthe CrowPi you are using (1, 2, or 3).\n\n```shell\n$ java -jar /home/pi/pi4jdemo-1.0-SNAPSHOT.jar --crowpi.version=3\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffdelporte%2Fvaadin-examples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffdelporte%2Fvaadin-examples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffdelporte%2Fvaadin-examples/lists"}