Go to advanced search

by mattlewis
Sun Feb 18, 2018 5:29 pm
Forum: Java
Topic: RFC522 RFID Reader
Replies: 5
Views: 2900

Re: RFC522 RFID Reader

Nice. I should have updated this thread, I ported the Arduino library to Java last year, code here: https://github.com/mattjlewis/diozero/b ... RC522.java

Matt
by mattlewis
Mon Jan 08, 2018 9:22 pm
Forum: Java
Topic: Which Java server is the best for raspberry Pi 3
Replies: 4
Views: 1514

Re: Which Java server is the best for raspberry Pi 3

There’s a huge amount of choice, I wrote a simple web app in diozero as an experiment: https://github.com/mattjlewis/diozero/tree/master/diozero-webapp . All depends on what technologies you are comfortable with & what you are actually trying to achieve. Other options include: MQTT. There are JavaSc...
by mattlewis
Fri Jan 05, 2018 7:19 pm
Forum: Java
Topic: Java App to Remote Control RPI.
Replies: 3
Views: 653

Re: Java App to Remote Control RPI.

I’ve been working on adding native remote control to my diozero library (http://www.diozero.com/) & have been investigating various protocols including MQTT as well as HTTP WebSockets.
Remote control via pigpio sockets is also supported.
See: http://www.diozero.com/en/latest/RemoteControl/

Matt
by mattlewis
Sun Oct 29, 2017 1:22 pm
Forum: Java
Topic: Code sample: rolling rainbow on APA102 LEDs from Java
Replies: 3
Views: 1366

Re: Code sample: rolling rainbow on APA102 LEDs from Java

Very nice. I wrote a Java wrapper for the rpi_ws281x library, here: https://github.com/mattjlewis/diozero/tree/master/diozero-ws281x-java I’ve been thinking for sometime that I should see if I could implement a pure Java solution given I’d read you can control them via SPI. Thanks for sharing your c...
by mattlewis
Thu Oct 26, 2017 6:17 pm
Forum: Java
Topic: Java and I2C Display
Replies: 27
Views: 7160

Re: Java and I2C Display

What is your setup? Is this with an LCD with i2c backpack? Are you using diozero?

Matt
by mattlewis
Tue Oct 24, 2017 7:32 pm
Forum: Java
Topic: Update on diozero - Java Device I/O library
Replies: 5
Views: 2595

Re: Update on diozero - Java Device I/O library

Can you confirm what version of diozero you are using please. I'd recommend the latest 0.11-SNAPSHOT version. From your post it looks like you are using an old version of the MFRC classes. They are now in the diozero-sampleapps project in the package com.diozero.sampleapps.mfrc522. You should first ...
by mattlewis
Fri Sep 22, 2017 7:26 am
Forum: Java
Topic: LCD I2C 16x2
Replies: 1
Views: 1108

Re: LCD I2C 16x2

There is support for this in my diozero library, see the HD44780Lcd class for my implementation.

For example code have a look at the following sample applications: Matt
by mattlewis
Sun Jul 16, 2017 6:24 pm
Forum: Advanced users
Topic: Use sensor data from Serial communication to pi3 in java app
Replies: 5
Views: 980

Re: Use sensor data from Serial communication to pi3 in java

What sensors / devices are you controlling? My diozero library hides the complexity of device access. To run the simple LED for example, you just reference the firmata4j provider JAR file at runtime, e.g.: To run the LED sample app with the in-built provider: java -cp tinylog-1.2.jar:diozero-core-$D...
by mattlewis
Sun Jul 16, 2017 6:12 pm
Forum: Java
Topic: Background task, Async?
Replies: 3
Views: 1694

Re: Background task, Async?

This is what I would do with diozero : import java.util.concurrent.TimeUnit; import com.diozero.devices.Button; import com.diozero.devices.LED; import com.diozero.util.DioZeroScheduler; public class Listener { public static void main(String[] args) { try (Button button = new Button(16); LED led = ne...
by mattlewis
Thu Jul 13, 2017 9:19 pm
Forum: Advanced users
Topic: Use sensor data from Serial communication to pi3 in java app
Replies: 5
Views: 980

Re: Use sensor data from Serial communication to pi3 in java

You could try use Firmata4j to control the sensors directly from Java on the Pi (connected to the Arduino via USB). Parsing serial output sounds messy.
Matt
by mattlewis
Tue Jul 11, 2017 2:02 pm
Forum: Advanced users
Topic: Sending data from Uno to Pi to a Java application on Pi
Replies: 6
Views: 965

Re: Sending data from Uno to Pi to a Java application on Pi

That's the great thing abut this approach - the Arduino is simply a proxy to the sensors; all of the actual control logic runs on the Pi (or any other controller). If you look at the Standard Firmata library it is simply an application that you run on the Arduino that allows you to connect remotely ...
by mattlewis
Thu Jul 06, 2017 12:01 pm
Forum: Advanced users
Topic: Sending data from Uno to Pi to a Java application on Pi
Replies: 6
Views: 965

Re: Sending data from Uno to Pi to a Java application on Pi

jssc is a good Java serial library. Have you written the Arduino code for interacting with the moisture sensor? If you haven't written than code yet then I strongly recommend you investigate firmata4j . It requires the StandardFirmata firmware to be installed on the Arduino; once that is running al...
by mattlewis
Thu Jul 06, 2017 7:35 am
Forum: Java
Topic: Java Pi4J LED Strip Strobing/Flashing
Replies: 8
Views: 1885

Re: Java Pi4J LED Strip Strobing/Flashing

I've just noticed my own examples are out of date; updating them too now.

Matt
by mattlewis
Thu Jul 06, 2017 7:25 am
Forum: Java
Topic: Java Pi4J LED Strip Strobing/Flashing
Replies: 8
Views: 1885

Re: Java Pi4J LED Strip Strobing/Flashing

Are you calling

Code: Select all

uk.pigpioj.PigpioJ.getImplementation()
? You need to call this method to ensure that the shared library is loaded. I'm just writing up some usage notes on the GitHub project now.

Matt
by mattlewis
Wed Jul 05, 2017 9:01 pm
Forum: Advanced users
Topic: Sending data from Uno to Pi to a Java application on Pi
Replies: 6
Views: 965

Re: Sending data from Uno to Pi to a Java application on Pi

Alternatively you could use Firmata4j and control the Arduino directly from Java. I have integrated this as a provider for my diozero library.

Matt
by mattlewis
Wed Jul 05, 2017 8:56 pm
Forum: Java
Topic: Java Pi4J LED Strip Strobing/Flashing
Replies: 8
Views: 1885

Re: Java Pi4J LED Strip Strobing/Flashing

If you want to Staci with Java you can try use my pigpio wrapper library: https://GitHub.com/mattjlewis/pigpioj.
pigpio supports optimised PWM output on all GPIOs.
For a user friendly interface you could use diozero (http://www.diozero.com/) which supports pigpio as a backend.

Matt
by mattlewis
Wed Jul 05, 2017 8:50 pm
Forum: Java
Topic: RFID reader RC522 SPI usage
Replies: 15
Views: 7330

Re: RFID reader RC522 SPI usage

by mattlewis
Thu Jun 08, 2017 10:13 pm
Forum: Java
Topic: Access mySQL via Servlet and Tomcat
Replies: 5
Views: 1560

Re: Access mySQL via Servlet and Tomcat

Have you enabled remote access to the MySQL database? Java MySQL JDBC connects via a socket, that requires different configuration to local console access.
by mattlewis
Wed Jun 07, 2017 7:42 pm
Forum: Java
Topic: Update on diozero - Java Device I/O library
Replies: 5
Views: 2595

Re: Update on diozero - Java Device I/O library

If anyone is interest this library continues to be actively developed; it now works on all flavours of Pi, Beaglebone Black, Asus Tinker Board, CHIP and CHIP Pro, Odroid C2 as well as Arduino's connected via USB using the Firmata protocol. All device control is handled by dynamically loaded provider...
by mattlewis
Wed Jun 07, 2017 7:29 pm
Forum: Java
Topic: RFID reader RC522 SPI usage
Replies: 15
Views: 7330

Re: RFID reader RC522 SPI usage

FYI I've got this fully working now, ported the Arduino library to Java in my diozero library.
by mattlewis
Wed May 24, 2017 8:22 pm
Forum: Java
Topic: Read a PWM with Java using Pi4j
Replies: 9
Views: 2203

Re: Read a PWM with Java using Pi4j

Ive just committed a work in progress port of joan's Python code. Available here: https://github.com/mattjlewis/diozero/blob/master/diozero-core/src/main/java/com/diozero/sandpit/TCS3200.java . This code won't work right now, I need to review which time periods are fractions of a second and what are...
by mattlewis
Wed May 24, 2017 5:34 pm
Forum: Java
Topic: Read a PWM with Java using Pi4j
Replies: 9
Views: 2203

Re: Read a PWM with Java using Pi4j

I'll have a look at porting Joan's Python code to Java tonight.
by mattlewis
Tue May 23, 2017 9:33 pm
Forum: Java
Topic: Read a PWM with Java using Pi4j
Replies: 9
Views: 2203

Re: Read a PWM with Java using Pi4j

Thanks Joan. I don't have one of those devices - have just ordered one off eBay but will take forever to get here from China. I'll have a quick look at your code tomorrow and see if I can easily convert to Java. Always happy to add a new device to diozero.
Matt

Go to advanced search