Go to advanced search

by mattlewis
Wed Jun 29, 2016 7:10 pm
Forum: Automation, sensing and robotics
Topic: RPi 3 - Servo Control w/ PS4 Controller
Replies: 13
Views: 6649

Re: RPi 3 - Servo Control w/ PS4 Controller

I built this a few years ago using Python, the Adafruit PWM driver and a PS3 controller: http://mattandshirl.blogspot.co.uk/2013 ... d.html?m=1

Matt
by mattlewis
Tue Jun 28, 2016 10:18 pm
Forum: Java
Topic: IDE for raspberry pi 3
Replies: 5
Views: 3210

Re: IDE for raspberry pi 3

Or you could try my diozero library . It tries to make development easy by abstracting away all the complex bits. It can use my Java pigpio JNI wrapper library or indeed pi4j for doing the actual low level device communication. For messaging have you considered MQTT? I have an example where I use MQ...
by mattlewis
Mon Jun 20, 2016 6:01 pm
Forum: Java
Topic: Running a fast JVM on Raspbian Jessie
Replies: 1
Views: 4372

Re: Running a fast JVM on Raspbian Jessie

Install Oracle JDK 8. From memory:
sudo apt-get install oracle-java8-jdk
by mattlewis
Mon Jun 13, 2016 9:56 pm
Forum: Java
Topic: Java access to /dev/gpiomem via JNI NewDirectByteBuffer
Replies: 16
Views: 4148

Re: Java access to /dev/gpiomem via JNI NewDirectByteBuffer

I've updated my mmap test project with basic GPIO control via /dev/gpiomem. My test app turns a GPIO on then off @ 11MHz on a Pi3, not too shabby :) Hats off to JGPIO for the IntBuffer trick. As it uses /dev/gpiomem it can be run without sudo. Code is here: https://github.com/mattjlewis/diozero/tree...
by mattlewis
Sat Jun 11, 2016 2:03 pm
Forum: Java
Topic: Java access to /dev/gpiomem via JNI NewDirectByteBuffer
Replies: 16
Views: 4148

Re: Java access to /dev/gpiomem via JNI NewDirectByteBuffer

That's awesome. For my wrapper library diozero I'd like to provide both a maximum compatibility provider to support multiple devices as well as an ultra high performance Raspberry Pi specific one that has minimal dependencies. I was hoping JDK Device I/O would provide the former but seems that may n...
by mattlewis
Sat Jun 11, 2016 10:32 am
Forum: Java
Topic: Java access to /dev/gpiomem via JNI NewDirectByteBuffer
Replies: 16
Views: 4148

Re: Java access to /dev/gpiomem via JNI NewDirectByteBuffer

That would be great thanks
by mattlewis
Sat Jun 11, 2016 6:19 am
Forum: Java
Topic: Java access to /dev/gpiomem via JNI NewDirectByteBuffer
Replies: 16
Views: 4148

Re: Java access to /dev/gpiomem via JNI NewDirectByteBuffer

I'm impressed with your perseverance, nice work!

Do you have plans for a high performance native Java device library? I'd be happy to help if so.

Matt
by mattlewis
Mon Jun 06, 2016 11:56 am
Forum: Java
Topic: RFC522 RFID Reader
Replies: 5
Views: 5142

Re: RFC522 RFID Reader

I've just ordered one of these off ebay and will be adding support for it in my diozero Java library.
Matt
by mattlewis
Thu Jun 02, 2016 9:31 pm
Forum: Java
Topic: What technology should I use for communication Raspberry Pi
Replies: 1
Views: 946

Re: What technology should I use for communication Raspberry

Sounds like you should look at something like Apache Ignite. Doesn't look like you need GPIO access hence no need for libraries such as Pi4j.
Matt
by mattlewis
Wed Jun 01, 2016 9:24 pm
Forum: Java
Topic: Java access to /dev/gpiomem via JNI NewDirectByteBuffer
Replies: 16
Views: 4148

Re: Java access to /dev/gpiomem via JNI NewDirectByteBuffer

Yes, I was hoping that /dev/gpiomem would work with a 0 offset however it gives the same strange output as when passing the offset value and using /dev/mem. Annoying
by mattlewis
Wed Jun 01, 2016 7:55 pm
Forum: Java
Topic: Java access to /dev/gpiomem via JNI NewDirectByteBuffer
Replies: 16
Views: 4148

Re: Java access to /dev/gpiomem via JNI NewDirectByteBuffer

That is strange, it would indeed appear to work when accessing /dev/mem with zero offset. Next Java question - how do you then access the GPIO registers given the large offset...

Matt
by mattlewis
Tue May 31, 2016 10:02 pm
Forum: Java
Topic: Java access to /dev/gpiomem via JNI NewDirectByteBuffer
Replies: 16
Views: 4148

Java access to /dev/gpiomem via JNI NewDirectByteBuffer

I'm attempting to access /dev/gpiomem in Java via a thin JNI wrapper that returns a DirectByteBuffer to a mmap'ed address and simply cannot get it to work. I've uploaded my very rough source code here: https://github.com/mattjlewis/diozero/tree/master/mmap-tests . Rough outline of C code: fdMem = op...
by mattlewis
Tue May 31, 2016 9:07 pm
Forum: Java
Topic: Java GPIO Frequency Benchmarks
Replies: 35
Views: 20516

Re: Java GPIO Frequency Benchmarks

Very good spot. I forgot to mention that I'm explicitly setting the byte order to little endian. I'll start a new thread to continue this.
by mattlewis
Mon May 30, 2016 4:49 pm
Forum: Java
Topic: Java GPIO Frequency Benchmarks
Replies: 35
Views: 20516

Re: Java GPIO Frequency Benchmarks

My diozero library relies on other libraries to interface with low-level hardware, including Pi4j / wiringPi and pigpio. Just retried my mmap JNI test, still no joy. Copy and paste of relevant code: #define GPIO_BASE_OFFSET 0x00200000 int fdMem = open("/dev/mem", O_RDWR | O_SYNC | O_CLOEXEC); uint32...
by mattlewis
Mon May 30, 2016 4:38 pm
Forum: Java
Topic: PWM with servo hat (Pi4j)
Replies: 3
Views: 1798

Re: PWM with servo hat (Pi4j)

Pi4j 1.1 provides support for the PCA9685, look in the pi4j-gpio-extension module. I've also implemented support in my diozero library. Documentation here: http://rtd.diozero.com/en/latest/ExpansionBoards/#pwm-servo-driver . FYI, joan - I find my JNI wrapper around your pigpio C interface the most s...
by mattlewis
Mon May 30, 2016 1:37 pm
Forum: Java
Topic: Java GPIO Frequency Benchmarks
Replies: 35
Views: 20516

Re: Java GPIO Frequency Benchmarks

I've created the Java diozero library as an object orientated interface to device programming (it was originally based on the excellent Python GPIO Zero API) - documentation . It works with different low-level device interface libraries including Pi4j, wiringPi as well as my own Java JNI wrapper aro...
by mattlewis
Mon May 16, 2016 7:46 pm
Forum: Automation, sensing and robotics
Topic: WANTED: Three beta testers for low cost robot project
Replies: 13
Views: 2935

Re: WANTED: Three beta testers for low cost robot project

Also happy to help, I'm UK based. I can provide Java support if you are at all interested, also have Python, C and C++ knowledge.
Matt
by mattlewis
Mon May 16, 2016 4:17 pm
Forum: Java
Topic: OpenCV hardware acceleration
Replies: 4
Views: 2414

Re: OpenCV hardware acceleration

by mattlewis
Fri May 13, 2016 4:40 pm
Forum: Java
Topic: ws2801 Raspberry Pi 3 pi4j
Replies: 3
Views: 1784

Re: ws2801 Raspberry Pi 3 pi4j

Sounds like it could be an interesting addition to my library. Did you progress with this at all? BTW, any recommendation on which one to get so I can test?

Regards,
Matt
by mattlewis
Thu May 12, 2016 8:28 pm
Forum: Java
Topic: Sense Hat + Java
Replies: 9
Views: 7265

Re: Sense Hat + Java

Thanks for pointing that out, really useful. I wonder if I could help you guys out at all.
Matt
by mattlewis
Tue May 10, 2016 11:31 am
Forum: Java
Topic: ws2801 Raspberry Pi 3 pi4j
Replies: 3
Views: 1784

Re: ws2801 Raspberry Pi 3 pi4j

Not sure if this will work for the ws2801 5050 LEDs however I implemented this simple wrapper for the ws281x LEDs: https://github.com/mattjlewis/diozero/tree/master/diozero-ws281x-java https://github.com/mattjlewis/diozero/tree/master/diozero-ws281x-native The timing is very precise hence the need t...
by mattlewis
Fri May 06, 2016 7:29 am
Forum: Java
Topic: PCF8591 Java
Replies: 7
Views: 2014

Re: PCF8591 Java

FYI, I've just posted Java support for this device in my diozero Java library. Still in the sandpit package as it needs some more testing but was fairly straightforward to implement.

Matt
by mattlewis
Mon Apr 25, 2016 7:02 pm
Forum: Java
Topic: Sense Hat + Java
Replies: 9
Views: 7265

Re: Sense Hat + Java

FYI I've just committed to GitHub Java support for the LPS25H & HTS221 I2C devices into the latest diozero snapshot build (0.7). Next up - Sense HAT IMU support...

Matt
by mattlewis
Sat Apr 23, 2016 11:13 am
Forum: Java
Topic: PCF8591 Java
Replies: 7
Views: 2014

Re: PCF8591 Java

Agreed. I guess the reaction was to the statement that it was harder in Java than in Python. I personally don't see any difference, they're just languages. Comes down to the ability to review existing code and read data sheets.
by mattlewis
Fri Apr 22, 2016 6:32 pm
Forum: Java
Topic: PCF8591 Java
Replies: 7
Views: 2014

Re: PCF8591 Java

I'd disagree with the statement that it is any easier in Python. I've implemented the MCP30/32/33xx family of SPI ADCs in Java fairly quickly, source code: https://github.com/mattjlewis/diozero/blob/master/diozero-core/src/main/java/com/diozero/McpAdc.java . I'm happy to have a go at implementing th...

Go to advanced search