Go to advanced search

by Asher Waldfogel
Tue Jul 30, 2013 3:52 am
Forum: Java
Topic: pi4j + glassfish
Replies: 1
Views: 1918

Re: pi4j + glassfish

Got the class loader to work by downgrading from PiDevice-1.0-SNAPSHOT to PiDevice-0.0.5. The pi4j.log files - activated by System.setProperty("pi4jdebug", "true"); // put this before the first constructor call into a pi4j class look the same, but 1.0-SNAPSHOT hangs silently in glassfish. 0.0.5 load...
by Asher Waldfogel
Mon Jul 29, 2013 4:18 am
Forum: Java
Topic: pi4j + glassfish
Replies: 1
Views: 1918

pi4j + glassfish

I'm building an RPI server that takes RESTful or Websocket/JSON requests and drives serial ports or GPIO. Websocket is about 10x faster than REST - 3 ms vs 30ms. I'm using Netbeans 7.3 + glassfish 4 + JDK 7 JAX-RS and websockets as the framework. Will be happy to share the code when it's working. I ...
by Asher Waldfogel
Sun Jul 28, 2013 7:58 pm
Forum: Java
Topic: Pi-Face + Java + Pi4J
Replies: 21
Views: 14096

Re: Pi-Face + Java + Pi4J

Little bit of a hack, but try adding these lines of code to PiFaceExample.java just before the first button listener: byte packet[] = {0x41, 0x13, 0x00}; int result = Spi.wiringPiSPIDataRW(0, packet, 3); This code reads the GPIOB control register. After you read it once, the original PiFaceExample.j...
by Asher Waldfogel
Mon Jul 22, 2013 8:41 pm
Forum: Java
Topic: Pi-Face + Java + Pi4J
Replies: 21
Views: 14096

Re: Pi-Face + Java + Pi4J

I found a workaround. Read the INTCAPB register (address 0x11) just once at initialization, then all the examples work correctly until the Pi is powered down and powered back on. I'm guessing the Python library reads the INTCAPB register for some reason and explains why pi4j works after running the ...
by Asher Waldfogel
Sun Jul 21, 2013 7:33 pm
Forum: Java
Topic: Pi-Face + Java + Pi4J
Replies: 21
Views: 14096

Re: Pi-Face + Java + Pi4J

Same issue. Inputs work in PiFaceExample.java after I run the Python example, but not before.

BTW, pi4j is the most professionally written library I've seen in this ecosystem. Nice work!

Go to advanced search