mirror of
https://github.com/zyphlar/LanternPowerMonitor.git
synced 2024-03-08 14:07:47 +00:00
Migrating from from wiringpi to pigpio. This increases the sample rate by a factor of 3 and will allow creation of a board that can monitor over 30 breakers with a single raspberry pi.
This is based on pi4j 2.0 which is in a beta status. I have fixed a few bugs in a local version of pi4j 2.0 to get it to work but I haven't submitted those changes to pi4j yet. This change requires a migration to Java 11 and will *NOT* be backwards compatible. Upgrading to this hub software will require that java 11 and pigpio be installed on the hub. This can be done from an ssh session with the following commands: apt-get update apt-get install openjdk-11-jre-headless apt-get install pigpio Alternatively, you can download a new sd image, reflash your sd card, and re-adopt your hub.
This commit is contained in:
@@ -19,7 +19,7 @@ public abstract class MessageEngine {
|
||||
for (Message m : ServiceLoader.load(Message.class)) {
|
||||
messages.put(m.getKey(), m);
|
||||
}
|
||||
for (IMessageSubscriber s : ServiceLoader.load(IMessageSubscriber.class)) {
|
||||
for (IMessageSubscriber<?> s : ServiceLoader.load(IMessageSubscriber.class)) {
|
||||
subscribe(s);
|
||||
}
|
||||
}
|
||||
@@ -50,7 +50,7 @@ public abstract class MessageEngine {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
Message ret = message.getClass().newInstance();
|
||||
Message ret = message.getClass().getDeclaredConstructor().newInstance();
|
||||
ret.fromPayload(_data);
|
||||
return ret;
|
||||
} catch (Exception _e) {
|
||||
|
||||
Reference in New Issue
Block a user