Go to advanced search

by mattlewis
Tue May 23, 2017 9:33 pm
Forum: Java
Topic: Read a PWM with Java using Pi4j
Replies: 9
Views: 3118

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
by mattlewis
Mon May 22, 2017 7:04 pm
Forum: Java
Topic: HowTo TTS?
Replies: 3
Views: 1268

Re: HowTo TTS?

From the GitHub page for Pico TTS: I have left the JNI code in the repository untouched in case anyone fancies getting the Java integration working.
Have you done Java / JNI development before?
Looks possible but would require a bit of effort.
Matt
by mattlewis
Mon May 22, 2017 7:00 pm
Forum: Java
Topic: Java library for AdaFruit PWM Board?
Replies: 2
Views: 1163

Re: Java library for AdaFruit PWM Board?

That's based on the PCA9685 chip. It's fully supported in my diozero library, source: https://github.com/mattjlewis/diozero/b ... A9685.java.
by mattlewis
Sat May 20, 2017 4:13 pm
Forum: General discussion
Topic: Free ISS Tracking
Replies: 2
Views: 729

Re: Free ISS Tracking

I wrote a little command line app that downloads all visual space objects from celestrak then prints out details of when they will be overhead along with local weather forecast information for that period. Code is on github and is written in Java. Weather forecast is from the UK's Met Office and req...
by mattlewis
Thu Apr 27, 2017 10:09 pm
Forum: Java
Topic: Java Web App on raspberry pi
Replies: 3
Views: 16364

Re: Java Web App on raspberry pi

For web containers try one of Tomcat, Jetty or Undertow. For web frameworks Spark seems quite popular and lightweight.
by mattlewis
Fri Feb 17, 2017 9:42 pm
Forum: Java
Topic: RFID reader RC522 SPI usage
Replies: 15
Views: 9938

Re: RFID reader RC522 SPI usage

That's excellent, really appreciated. Looks like we're at a similar point but you've done a heck of a lot more research hence have a much cleaner implementation.
Are you ok if I refactor my code a bit to match yours? I'll be sure to give you credit.

Matt
by mattlewis
Fri Feb 17, 2017 9:20 pm
Forum: Java
Topic: RFID reader RC522 SPI usage
Replies: 15
Views: 9938

Re: RFID reader RC522 SPI usage

That would be great - I've yet to find a decent RC522 implementation. I normally try to develop from datasheets plus use a Python implementation for reference, but am really struggling with this one. I believe authenticate is working now (a port of the Read.py from this implementation https://github...
by mattlewis
Fri Feb 17, 2017 8:52 pm
Forum: Java
Topic: RFID reader RC522 SPI usage
Replies: 15
Views: 9938

Re: RFID reader RC522 SPI usage

I've almost got this wokring in Java in my diozero library . See https://github.com/mattjlewis/diozero/blob/master/diozero-core/src/main/java/com/diozero/sandpit/MFRC522.java . Just ironing out some authentication issues. The MFRC522 Python code this is based on has some very strange logic in places...
by mattlewis
Sat Jan 07, 2017 10:21 pm
Forum: Java
Topic: sigHandler : unhandled signal 11, terminating
Replies: 48
Views: 13837

Re: sigHandler : unhandled signal 11, terminating

Ok I've managed to trigger this error, possibly an extreme case. Code: import com.diozero.pigpioj.PigpioGpio; public class PigpioThreadTest { private static final int THREAD_COUNT = 10; private static final int ITERATIONS = 10_000_000; public static void main(String[] args) { int version = PigpioGpi...
by mattlewis
Sat Jan 07, 2017 1:59 pm
Forum: Java
Topic: sigHandler : unhandled signal 11, terminating
Replies: 48
Views: 13837

Re: sigHandler : unhandled signal 11, terminating

No, I don't call that method. The error was very intermittent - about 10% of the time, apologies I can't be more specific regarding whether it was while doing PWM, GPIO, I2C or SPI or indeed if it was threading related. I recall encountering the error more frequently on the Pi Zero (compared to Pi2 ...
by mattlewis
Fri Jan 06, 2017 10:03 pm
Forum: Java
Topic: sigHandler : unhandled signal 11, terminating
Replies: 48
Views: 13837

Re: sigHandler : unhandled signal 11, terminating

FYI I was seeing this occasionally in my Java pigpio wrapper (part of diozero). It was very random and assumed it was my code. The issue seems to have gone away, however, I can easily validate if there is a concurrency issue.
by mattlewis
Mon Jan 02, 2017 1:00 pm
Forum: Java
Topic: Java and I2C Display
Replies: 27
Views: 9939

Re: Java and I2C Display

The latest version of the I2CLcdSampleApp20x4 allows you to specify the I2C address as well as the I2C bus number. The I2C address parameter is parsed using Integer.decode so can accept decimal, hexadecimal, and octal numbers.

Matt
by mattlewis
Wed Nov 30, 2016 10:24 pm
Forum: Java
Topic: [Pi4J] Monitoring pins
Replies: 4
Views: 1193

Re: [Pi4J] Monitoring pins

Easiest thing I can think of would be to monitor the sysfs file system (/sys/gpio). See https://www.kernel.org/doc/Documentation/gpio/sysfs.txt for reference.
by mattlewis
Sat Sep 24, 2016 8:05 am
Forum: General discussion
Topic: Have experience with Raspberry Pi? Interested in IoT?
Replies: 23
Views: 4969

Re: Have experience with Raspberry Pi? Interested in IoT?

The Pi is a great platform for IoT. I've set a few of them up inside & outside sending simple data items like temperature, pressure & light levels. All sent via MQTT to a central server that logged the data to a time series database (influxdb). Once the data is in influx it was then easy to visualis...
by mattlewis
Fri Sep 09, 2016 6:18 am
Forum: Java
Topic: Java access to /dev/gpiomem via JNI NewDirectByteBuffer
Replies: 16
Views: 4153

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

Are you able to share the code?
I have a cheap USB scope, happy to check what that detects.
Matt
by mattlewis
Tue Jul 19, 2016 12:17 pm
Forum: Java
Topic: Using Pi4J to control an ESC and brushless motor
Replies: 18
Views: 4728

Re: Using Pi4J to control an ESC and brushless motor

@VTolpegin any joy with diozero?

Matt
by mattlewis
Mon Jul 18, 2016 1:55 pm
Forum: Java
Topic: Using Pi4J to control an ESC and brushless motor
Replies: 18
Views: 4728

Re: Using Pi4J to control an ESC and brushless motor

Apologies - that was due to a bug in the 0.8 release, fixed now in 0.9-SNAPSHOT.

Matt
by mattlewis
Sat Jul 16, 2016 3:49 pm
Forum: Java
Topic: Using Pi4J to control an ESC and brushless motor
Replies: 18
Views: 4728

Re: Using Pi4J to control an ESC and brushless motor

There a two examples depending on what you are trying to achieve, a simple PWM test and a Servo test . The PWM Test class uses the default frequency (100Hz I think) and allows you to set % PWM output, useful for LED brightness for example. The Servo Test class allows you to control the frequency and...
by mattlewis
Fri Jul 15, 2016 10:17 pm
Forum: Java
Topic: Using Pi4J to control an ESC and brushless motor
Replies: 18
Views: 4728

Re: Using Pi4J to control an ESC and brushless motor

Joan, I've developed a Java wrapper around your excellent pigpio library. I've also created a (hopefully) user friendly library (diozero) that includes PWM (and servo) support as well as many other features. Hardware PWM is used if you select the correct GPIO. This library has an abstraction layer t...
by mattlewis
Thu Jul 07, 2016 12:01 pm
Forum: Java
Topic: How to reading text file?
Replies: 3
Views: 1443

Re: How to reading text file?

Out of curiosity - why Java ME?

Matt
by mattlewis
Fri Jul 01, 2016 9:14 pm
Forum: Automation, sensing and robotics
Topic: Determine GPIO switching frequency
Replies: 7
Views: 1282

Re: Determine GPIO switching frequency

No worries, all very useful responses - I had looked at joan's piscope but had assumed it wouldn't work at these frequencies. joan, thank you very much for taking the time to answer my questions - I got a cheapo Hobby Components USB 8 channel / 24MHz one. Still getting to grips with the software. Ve...
by mattlewis
Thu Jun 30, 2016 4:01 pm
Forum: Automation, sensing and robotics
Topic: Determine GPIO switching frequency
Replies: 7
Views: 1282

Re: Determine GPIO switching frequency

Thanks Joan. Something like this http://www.ebay.co.uk/itm/Logic-Analyser-8CH-24MHz-Test-leads-Male-and-Female-USB-cable-Clips-Hooks-/262498092277?var=&hash=item3d1e1b04f5:m:mKXPV1Lp46AI7ZnKsvxFvzQ ? Apologies, I've no experience in this - does this plug into a PC via USB port? What software do I ne...
by mattlewis
Thu Jun 30, 2016 3:42 pm
Forum: Automation, sensing and robotics
Topic: Determine GPIO switching frequency
Replies: 7
Views: 1282

Re: Determine GPIO switching frequency

What is the max frequency that piscope can measure?

Matt
by mattlewis
Thu Jun 30, 2016 1:38 pm
Forum: Automation, sensing and robotics
Topic: Determine GPIO switching frequency
Replies: 7
Views: 1282

Determine GPIO switching frequency

Is there an "easy and cheap" way to determine GPIO switching frequency without attaching to a (potentially) expensive scope? I want to verify GPIO switching frequencies approximately in the range of up to 20MHz (possibly higher). I have a number of Pis, would it be possible to use a separate Pi one ...

Go to advanced search