Closed johanneskropf closed 4 years ago
Hey Johannes,
could you please switch on the third option, then post the content of your /etc/defaults/openhab2
file? Thank you
My assumption: Parameters added to EXTRA_JAVA_OPTS
are conflicting with the 3B+. If you want to help it would be interesting to know which setting causes the problem.
I will switch on only the the third option and than send a copy of the EXTRA_JAVA_OPTS. The only thing that is in there now that I added is Symlink stuff.
Openhabian adds this:
EXTRA_JAVA_OPTS="-Xms250m -Xmx350m -Dgnu.io.rxtx.SerialPorts=/dev/ttyUSB0:/dev/ttyS0:/dev/ttyS2:/dev/ttyACM0:/dev/ttyAMA0" # serial ports added by openHABian EXTRA_JAVA_OPTS="-Xms250m -Xmx350m -Dgnu.io.rxtx.SerialPorts=/dev/ttyUSB0:/dev/ttyS0:/dev/ttyS2:/dev/ttyACM0:/dev/ttyAMA0" # serial ports added by openHABian
It over wrote my Symlinks π€¨ When I un check the option in the Openhabian configs it leaves the /default/ooenhab2 like this
EXTRA_JAVA_OPTS="-Xms250m -Xmx350m" EXTRA_JAVA_OPTS="-Xms250m -Xmx350m"
I think it added two lines because I put my Symlinks in a second line of extra Java opts in addition to the line EXTRA_JAVA_OPTS="-Xms250m -Xmx350m" but that line with the Symlinks wasn't there when I had the Problem.
First thing to note: We shouldn't blindly overwrite user-provided options like your Symlinks addition.
Secondly: The name EXTRA_JAVA_OPTS
is just a variable and is such will be overwritten by a second line. The first one in your case does hence not matter to the system. You'd need to do something like this (not tested):
EXTRA_JAVA_OPTS="my specific symlinks stuff" # user defined
EXTRA_JAVA_OPTS="-Xms250m -Xmx350m $EXTRA_JAVA_OPTS" # openHABian, do not edit
@EliasGabrielsson @mstormi wdyt? Something worth implementing?
My Symlinks were never working right, now that I put it in one line like this:
EXTRA_JAVA_OPTS="-Xms250m -Xmx350m -Dgnu.io.rxtx.SerialPorts=/dev/ttyEnocean:/dev/ttyZwave:/dev/ttyZigbee"
They are working just fine. So it doesn't seem to work to have two lines of EXTRA_JAVA_OPTS in the openhab2 file.
Hello, I have a similar problem but I don't use Symlinks. I have a fresh installed Openhabian with OpenHab. I did not configure OpenHab 2 yet. When I check the three serial Ports setting (especially the third one) OpenHab won't start.
When I type in
sudo systemctl status openhab2 <
I get following error message:
openhab2.service - openHAB 2 - empowering the smart home
Loaded: loaded (/usr/lib/systemd/system/openhab2.service; enabled)
Active: deactivating (stop) (Result: exit-code) since Sat 2019-01-19 19:16:44 CET; 643ms ago
Docs: https://www.openhab.org/docs/
https://community.openhab.org
Process: 3730 ExecStart=/usr/share/openhab2/runtime/bin/karaf $OPENHAB_STARTMODE (code=exited, status=1/FAILURE)
Main PID: 3730 (code=exited, status=1/FAILURE); : 3842 (karaf)
CGroup: /system.slice/openhab2.service
ββcontrol
ββ3842 /bin/sh /usr/share/openhab2/runtime/bin/karaf stop
ββ3918 /usr/bin/java -version
ββ3919 grep ^IBM
Jan 19 19:16:42 openHABianPi systemd[1]: Started openHAB 2 - empowering the smart home.
Jan 19 19:16:43 openHABianPi karaf[3730]: Error: Could not find or load main class serial
Jan 19 19:16:43 openHABianPi systemd[1]: openhab2.service: main process exited, code=exited, status=1/FAILURE
EXTRA_JAVA_OPTS="my specific symlinks stuff" # user defined
EXTRA_JAVA_OPTS="-Xms250m -Xmx350m $EXTRA_JAVA_OPTS" # openHABian, do not edit will be automatic overwritten.
@ThomDietrich Having one "line" for openhabian like your idea above is great. I think we should create a helper function handling this, eg.
## Add Java option to openhab used while starting the service
##
## addOpenhabOption(String option) {
##
addOpenhabOption() {
- Adds new option to openhab config file.
- Create specific openhabian line if not exist
}
This also ensures that we can write tests for it ;-)
@EliasGabrielsson π for thinking generalized AND test driven π
There are 2-3 spots that need to be replaced. The default option introduced by @mstormi would need to be part of the function?
I'd think there is no longer a need for this.
Hello, on a Raspberry 3B+ running openhabian and Openhab 2.4 I encounter an issue where if I check the three prepare serial port options in preparation of a razberry and than reboot I can't reach the openhab2 service anymore. I can connect to the Pi over SSH without an issue. But can't reach anything openhab related. This perceists if I reboot. Once I uncheck the options again and I reboot everything is back to working normally.