I was able to read data from the server perfectly when I used the jars alone (maven dependency download and build) instead of adding the souces to my project. However, since I included the sources I am having a couple of errors:
To cirumvent this compiler error I changed the line from
PKCS8EncodedKeySpec ecpks = new PKCS8EncodedKeySpec(data, tmp.get(0).toString());
to
PKCS8EncodedKeySpec ecpks = new PKCS8EncodedKeySpec(data);
which led a sucessfull compilation and then to error 2 listed below.
2. After compilation, my module could connect to the server successfully but could not read any attributes, as every read call would lead to the error https://github.com/Gurux/gurux.dlms.java/blob/aa4fd90704cdf87add5f14af8… (line 273)
"Failed to receive reply from the device in given time." in the client side (my module).
And the error on server side had many along the lines of
Invalid HDLC Frame: d6 Expected: b6
Invalid HDLC Frame: d6 Expected: b6
Invalid HDLC Frame: f8 Expected: b6
Invalid HDLC Frame: f8 Expected: b6
Invalid HDLC Frame: 1a Expected: b6
Am I doing something wrong here? Any help would be deeply appriciated!!
Should I post the complete rx tx logs?
gurux\dlms\asn\GXPkcs8.java:124: error: constructor PKCS8EncodedKeySpec in class PKCS8EncodedKeySpec cannot be applied to given types;
PKCS8EncodedKeySpec ecpks = new PKCS8EncodedKeySpec(data, tmp.get(0).toString());
^
required: byte[]
found: byte[],String
reason: actual and formal argument lists differ in length
I am actually using Intellij as an IDE and Gradle to build the jar, similar to Android, but different from Android as this is a regular Java SE JAR, not an APK, and runs in Tridium Niagara (a regular Java environment).
The compile error does not occur when I use the org.gurux *JARs* from Maven instead of the *sources*.
Nevertheless, on your suggestion, I will try the android package and comment how it goes!
The compiler error in more
The compiler error in more detail
gurux\dlms\asn\GXPkcs8.java:124: error: constructor PKCS8EncodedKeySpec in class PKCS8EncodedKeySpec cannot be applied to given types;
PKCS8EncodedKeySpec ecpks = new PKCS8EncodedKeySpec(data, tmp.get(0).toString());
^
required: byte[]
found: byte[],String
reason: actual and formal argument lists differ in length
Hi,
Hi,
You are using Java source code and because you seems to use Android Studio I believe that Android is better for you.
https://github.com/Gurux/Gurux.DLMS.Android
BR,
Mikko
Hi,
Hi,
I am actually using Intellij as an IDE and Gradle to build the jar, similar to Android, but different from Android as this is a regular Java SE JAR, not an APK, and runs in Tridium Niagara (a regular Java environment).
The compile error does not occur when I use the org.gurux *JARs* from Maven instead of the *sources*.
Nevertheless, on your suggestion, I will try the android package and comment how it goes!
Thanks,
Mithun,
Leanovate Solutions