What Java library should I use to control raspberry pi 4b, Pi4J does not support rpi4. Wiringpi is deprecated. I tried searching for others b ut cannot find anything, how to control gpio with java in 2020?
- Pi4J V1 with and upgraded version of WiringPi (v2.52), see my answer on Pi4 GPIO Control with Java
- Pi4J V2 which uses PiGpio instead of WiringPi, but is still a work-in-progress, see https://v2.pi4j.com/
- If you need limited GPIO functionality you can use terminal commands or even a Python script included in your project. All this is described in my book "Getting Started with Java on the Raspberry Pi" and all the examples are available on GitHub
- I haven't used this myself yet, but https://diozero.readthedocs.io/en/latest/ seems to provide similar functionality as Pi4J
I can confirm that diozero (now at https://github.diozero.com/) works with all flavours of Raspberry Pi, including Pi4 and Compute Module 4 (as well as many other SBCs), as well as both 32-bit and 64-bit operating systems (RaspiOS and Ubuntu).