Go to advanced search

by mattlewis
Wed Apr 20, 2016 6:57 pm
Forum: Java
Topic: Java and I2C Display
Replies: 27
Views: 9914

Re: Java and I2C Display

Is your code on GitHub? Happy to take a quick look...

Regards,
Matt
by mattlewis
Wed Apr 20, 2016 6:26 pm
Forum: Java
Topic: Porting Python code base to Java.
Replies: 8
Views: 1649

Re: Porting Python code base to Java.

No problem, I'd like to see a lot more Java on the Raspberry Pi :-) I've learnt Python but like you the dynamic typing scares me (!), my personal preference is to be able to clearly see variables, scope and type. Pi Camera: https://www.raspberrypi.org/forums/viewtopic.php?f=81&t=130644&p=878972&hili...
by mattlewis
Wed Apr 20, 2016 6:04 pm
Forum: Java
Topic: Porting Python code base to Java.
Replies: 8
Views: 1649

Re: Porting Python code base to Java.

A quick pass at your list (apologies for the formatting): sys JDK Adafruit_BME280 Shouldn't be too hard to clean up and port this to diozero: https://github.com/ControlEverythingCommunity/BME280 Firebase https://www.firebase.com/docs/android/api/ time JDK json JDK JSR 353 urllib2 JDK / Apache HTTP C...
by mattlewis
Wed Apr 20, 2016 5:54 pm
Forum: Java
Topic: Porting Python code base to Java.
Replies: 8
Views: 1649

Re: Porting Python code base to Java.

Fundamentally there's nothing stopping you doing this in Java. Very good point about careful scrutiny of libraries and onwards dependencies.

Regards,
Matt
by mattlewis
Mon Apr 18, 2016 9:10 pm
Forum: Java
Topic: Java and I2C Display
Replies: 27
Views: 9914

Re: Java and I2C Display

Excellent news, glad you've got it working. I'm using the 1.1-SNAPSHOT version of Pi4j, I'm not at my computer now but it looks like you may be using an older version of Pi4j that doesn't have the method that I'm using. For info I do most testing using my pigpio provider. Nice looking project by the...
by mattlewis
Mon Apr 18, 2016 11:33 am
Forum: Java
Topic: Sense Hat + Java
Replies: 9
Views: 7251

Re: Sense Hat + Java

Addding support for the SenseHat I2C peripherals is on my todo-list for diozero . Annoyingly I seem to have broken the LCD display on mine somehow, however all of the I2C devices show up when I do i2cdetect (I think). Controlling the LCD matrix should be interesting - you could use JNI to create a m...
by mattlewis
Mon Apr 18, 2016 11:26 am
Forum: Java
Topic: Java and I2C Display
Replies: 27
Views: 9914

Re: Java and I2C Display

Apologies for the delay, busy with work and a birthday weekend :-) Just had a quick test and it is working with my setup (lost a lot of time thinking it wasn't working until I tweaked the display contrast!). I've pushed a new snapshot build to Google drive plus commited modified code to GitHub. Stil...
by mattlewis
Mon Apr 11, 2016 1:57 pm
Forum: Java
Topic: Java and I2C Display
Replies: 27
Views: 9914

Re: Java and I2C Display

I updated the existing 0.7-SNAPSHOT ZIP file.

Display arrives tomorrow.

Regards,
Matt
by mattlewis
Sun Apr 10, 2016 9:09 am
Forum: Java
Topic: Java and I2C Display
Replies: 27
Views: 9914

Re: Java and I2C Display

As promised uploaded a new distribution ZIP file to Google drive.

Hope this works, I've ordered one of these so will be able to test and improve when it arrives.

Regards,
Matt
by mattlewis
Sat Apr 09, 2016 10:12 pm
Forum: Java
Topic: Java and I2C Display
Replies: 27
Views: 9914

Re: Java and I2C Display

Getting closer :-). Does the Python code linked to at the start work? I tried to replicate it exactly in Java... I might look in to buying one of these, in the meantime you could try pull the diozero code from GitHub and try get it working - I can commit any changes you make. Happy to answer any que...
by mattlewis
Sat Apr 09, 2016 3:50 pm
Forum: Java
Topic: Java and I2C Display
Replies: 27
Views: 9914

Re: Java and I2C Display

Strange - that's an error loading the Pi4j shared library. What Pi are you running this on? I've just tried running this on a Pi 2 and a Pi Zero and got the same error as you on the Pi Zero but only when using the Pi4j provider. Can you try with the pigpio provider please using this command: sudo ja...
by mattlewis
Fri Apr 08, 2016 9:37 pm
Forum: Java
Topic: Java and I2C Display
Replies: 27
Views: 9914

Re: Java and I2C Display

Does this link work? https://drive.google.com/folderview?id= ... kd4OXhYd3c.
There's also a link from the docs at http://rtd.diozero.com/.
by mattlewis
Fri Apr 08, 2016 8:46 pm
Forum: Java
Topic: Java and I2C Display
Replies: 27
Views: 9914

Re: Java and I2C Display

Apologies for the confusion - I pushed a new snapshot build to sonatype but not google drive. I've just uploaded 0.7-SNAPSHOT Zip file to google drive. If you extract that zip file you should be able to run the following: sudo java -cp tinylog-1.0.3.jar:diozero-core-0.7-SNAPSHOT.jar:diozero-provider...
by mattlewis
Fri Apr 08, 2016 10:58 am
Forum: Java
Topic: Java and I2C Display
Replies: 27
Views: 9914

Re: Java and I2C Display

Depends which Java library you were to use. You could of course use the diozero library which adds an abstractoin layer across the various options (Pi4j, pigpio, wiringPi, JDK Device I/O) :-). I've just pushed up a snapshot build (0.7-SNAPSHOT) with a port of the Python code to Java as an example. I...
by mattlewis
Thu Mar 24, 2016 11:36 am
Forum: General discussion
Topic: CM160 Owl Energy Monitor Driver Issues
Replies: 14
Views: 7209

Re: CM160 Owl Energy Monitor Driver Issues

I used an Ubuntu Virtual Machine running in Oracle VirtualBox to do cross compiling. There is a good page in the Raspberry Pi Documentation on how to cross compile the Linux Kernel and associated modules on Ubuntu. It's been a while since I've done this, looking at my command history I do the follow...
by mattlewis
Mon Mar 14, 2016 11:03 am
Forum: Java
Topic: Java ME Embedded Runtime For Raspberry Pi 2 Model B
Replies: 9
Views: 4777

Re: Java ME Embedded Runtime For Raspberry Pi 2 Model B

You can also give diozero a try. It's goal is to provide a user-friendly and intuitive API to interacting with low-level devices using Java 8.
Docs: http://rtd.diozero.com/
GitHub: https://github.com/mattjlewis/diozero/

Regards,
Matt
by mattlewis
Tue Mar 01, 2016 1:59 pm
Forum: Java
Topic: Java GPIO Frequency Benchmarks
Replies: 35
Views: 20513

Re: Java GPIO Frequency Benchmarks

Did anyone get to the bottom of this? The JDK MappedByteBuffer fails as the underlying implementation thinks the file length is 0 bytes. I started to have a quick look as to whether it was possible to provide access to /dev/gpiomem via a native DirectByteBuffer but simply cannot understand why it is...
by mattlewis
Thu Feb 25, 2016 4:11 pm
Forum: Java
Topic: onewire in java
Replies: 1
Views: 795

Re: onewire in java

I just added support for 1-wire devices in my diozero Java library, class: https://github.com/mattjlewis/diozero/blob/master/diozero-core/src/main/java/com/diozero/sandpit/W1ThermSensor.java . Health warning - I've not yet tested this class. Relies on w1-gpio and w1-therm kernel modules. Documentati...
by mattlewis
Sat Feb 20, 2016 10:42 pm
Forum: Java
Topic: Update on diozero - Java Device I/O library
Replies: 5
Views: 3303

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

Uploaded another snapshot build to the Maven repository - newest addition is support for all MCP30/32/34 ADCs as well as WS281x / NeoPixel LEDs (via a JNI wrapper around the rpi_ws281x library).
Slowly working on the documentation at http://rtd.diozero.com.

Matt
by mattlewis
Fri Feb 12, 2016 12:33 pm
Forum: Java
Topic: Update on diozero - Java Device I/O library
Replies: 5
Views: 3303

Update on diozero - Java Device I/O library

Almost ready for a 1.0 release, see https://github.com/mattjlewis/diozero for details. I was getting some odd behaviour with wiringPi, Pi4j and JDK Device I/O so I knocked together a pigpio JNI wrapper library (there was one already but was only partially implemented). This is currently my preferred...
by mattlewis
Fri Feb 12, 2016 12:22 pm
Forum: Java
Topic: Which JDK 8 binary should I install on Raspbian?
Replies: 3
Views: 20099

Re: Which JDK 8 binary should I install on Raspbian?

Personally I just use the Oracle JDK provided by raspbian (currently JDK 8u65):

Code: Select all

sudo apt-get update && sudo apt-get install oracle-java8-jdk
java -version
java version "1.8.0_65"
Java(TM) SE Runtime Environment (build 1.8.0_65-b17)
Java HotSpot(TM) Client VM (build 25.65-b01, mixed mode)

Matt
by mattlewis
Mon Feb 01, 2016 11:54 am
Forum: Java
Topic: Java Device I/O code
Replies: 9
Views: 3177

Re: Java Device I/O code

Hope you find it useful. I've just done a commit of my recent updates (removed frequency from PWM output pin provisioning, debugging when devices get closed and support for various motors). As mentioned previously I'd appreciate any feedback and let me know if anything doesn't work. There was someth...
by mattlewis
Fri Jan 15, 2016 4:43 pm
Forum: General discussion
Topic: Java version of GPIO Zero
Replies: 0
Views: 801

Java version of GPIO Zero

All, as per a previous post in the Java discussion forum I've been developing a Java library to replicate the excellent GPIO Zero Python library. Originally this library was based exclusively on the JDK Device I/O library, however, I have subsequently introduced a Service Provider layer that allows ...
by mattlewis
Fri Jan 08, 2016 11:55 am
Forum: Java
Topic: Java Device I/O code
Replies: 9
Views: 3177

Re: Java Device I/O code

Ok, I've refactored to support different provider implementations (i.e. both Pi4j and JDK Device I/O). Still need to work on the documentation, do further testing plus implement more of the input device functionality (in particular smoothed input device) and support I2C and SPI I/O abstraction in th...
by mattlewis
Wed Dec 30, 2015 9:07 pm
Forum: Java
Topic: Java Device I/O code
Replies: 9
Views: 3177

Re: Java Device I/O code

The pin numbering scheme was a key factor plus the fact that Device I/O should be the Java standard. However, as you say it doesn't seem to be particularly active right now (v1.1 is still in development) plus it would be nice if the PWM classes worked. Regarding Pi4j, I guess it would be quite easy ...

Go to advanced search