Hello folks,
Am building a Raspberry Pi solution and am implementing with your Modbus driver. Ran into a couple of things I thought I would mention. After referencing your project using Maven in Intellij
<dependency>
<groupId>com.ghgande</groupId>
<artifactId>j2mod</artifactId>
<version>2.3.0</version>
</dependency>
and deploying it on the Pi, I got some a library could not be loaded error .
This problem seemed to correlate with this reference... http://stackoverflow.com/questions/7421612/slf4j-failed-to-load-class-org-slf4j-impl-staticloggerbinder
After including the 1.7.5 versions of the org.slf4j my problems changed.
Then when starting I got...
log4j:WARN No appenders could be found for logger (com.ghgande.j2mod.modbus.io.ModbusSerialTransport).
This may be related to the fact that I am also using Log4j in the host project....
Hopefully this is useful, and it would be great if you can give me some feedback on this.
Thanks
Eti
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
To fellow users of this driver, there is a non-intuitive "gotcha" with respect to the stop bits. If you set the integer value for the stopbits on the SerialParameters object, it will be mapped to a an enumeration with:
1 = 1 stopbit
2 = 1.5 stopbits
3 = 2 stopbits
Thus, if you think you are getting 2 stop bits, you will actually be getting 1.5.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello folks,
Am building a Raspberry Pi solution and am implementing with your Modbus driver. Ran into a couple of things I thought I would mention. After referencing your project using Maven in Intellij
<dependency>
<groupId>com.ghgande</groupId>
<artifactId>j2mod</artifactId>
<version>2.3.0</version>
</dependency>
and deploying it on the Pi, I got some a library could not be loaded error .
This problem seemed to correlate with this reference...
http://stackoverflow.com/questions/7421612/slf4j-failed-to-load-class-org-slf4j-impl-staticloggerbinder
After including the 1.7.5 versions of the org.slf4j my problems changed.
Then when starting I got...
log4j:WARN No appenders could be found for logger (com.ghgande.j2mod.modbus.io.ModbusSerialTransport).
This may be related to the fact that I am also using Log4j in the host project....
Hopefully this is useful, and it would be great if you can give me some feedback on this.
Thanks
Eti
Also... Log4j version one has been "end of lifed", suggest Version 2.
Found some more info on this - for those interested there is a version 2 implementation:
https://logging.apache.org/log4j/2.0/log4j-slf4j-impl/index.html
https://mvnrepository.com/artifact/org.apache.logging.log4j.adapters/slf4j-impl
Although I have not yet tried this - I am unsure if it will use my Log4j config or give the same error mentioned in my previous post?
Last edit: Eti 2016-09-29
To fellow users of this driver, there is a non-intuitive "gotcha" with respect to the stop bits. If you set the integer value for the stopbits on the SerialParameters object, it will be mapped to a an enumeration with:
1 = 1 stopbit
2 = 1.5 stopbits
3 = 2 stopbits
Thus, if you think you are getting 2 stop bits, you will actually be getting 1.5.