Send command to serial port and receive a answer

So I have version 17? Must make a downgrade ?

1 Like

As far as I understand this Add support for running openHAB with Java 17 · Issue #1316 · openhab/openhab-distro · GitHub - yes.
In case you would like to stay with Java 17 installing JSScripting binding should provide an alternative.

It unfortunately doesn‘t for now.
I am not sure whether UI rules work, but file based rules do not work as they are not loaded or reloaded.

so what’s a easiest way to solve a issue ? I’m not so experienced, so help is welcome

I would recommend downgrading to Java 11, as this is officially supported by openHAB.
AFAIK, Java 17 is not supported yet.

If you need help downgrading to Java 11, feel free to ask for help.

Any guide for newby would by very helpful.
I’m running OH 3 on the DietPi.

In case you are going to go for zulu you can find detailed description here: Install Azul Zulu on Debian-based Linux

I‘m not sure if that works, the Azul Zulu APT repos only support x86 and arm64, but it‘s likely that the OS of the Pi is armhf.
You can manually download the armhf builds as .tar.gz, but I would give OpenJDK 11 a try (for me it works without any problems and openHABian switched to OpenJDK for new installs as well).

@alda1 You can install OpenJDK 11 with sudo apt install openjdk-11-jdk.
It might be possible that you have to configure the default Java version/JDK, this can be done using sudo update-alternatives --config java, select something with openjdk 11.

1 Like

Screenshot in this post ( 59 ) above shows it is aarch64 ( which is arm64 ) architecture.

So only to be sure :
first : sudo apt install openjdk-11-jdk
second : sudo update-alternatives --config java
That’s all to get working ? Once more - not sure if there is any influence, I have DietPi system.

On a different SD card install openHABian and see if that works.

2 Likes

Alex
you are attempting a technical feat with an undocumented operating system. You were warned of the pitfalls in your original thread and yet you persisted, good on you. Do yourself a favor and follow James’ advise and eliminate the unknowns, get it working and then experiment

Andrew,
Specialy I asked how to install on odroid n2+ here :

https://community.openhab.org/t/openhab-on-odroid-n2-install/

I received this recomendations :

  1. DietPI or Armbian then use my install script
  2. Armbian Image and then sudo armbian-config
  3. Armbian with openHABian installed on top
  4. MDAR’s method with dietPI

I used step4, because it was very well described by MDAR.
But I will try switch as James adviced.

edit: maybe ambian is better for me, because there is release directly for odroid n2+

in case you do a

sudo apt-get -s install openjdk-11-jdk

before you can check the impact of in case the package would be installed.
It is a dry run; this will not install anything but show if and what will be installed, updated or removed.
In case it shows that there are conflicts between installed and to be installed package you need to be careful.

this will make changes to links pointing to the installed java version on your system.
In case you use the current used java version for any other service than OH then it could have influence on your DietPi system. In case there is not any other service then the risk for negative influence is relative low.

In case you can’t predict what might happen and you would like to be prepared for the worst case scenario: take a full backup of your system
Don’t forget to test the backup and do a restore.

I did it:

second instruction answered nothing to configure.
I restarted openhab, but no improvement. Java still not as option for rule

so now I think to swit OS to openhabian or armbian. I think armbia is better, because there is release exactly for odroid (only I’m not sure which version. There is a lot of releases)

Openhab backup I can do via ? :

sudo openhab-cli backup Dateiname.zip

I missed that you were using an odroid.

I would recommend calculating the value of your time to fix all the little issues you are having because of a peace of hardware. If you can live with the cost of your time bash away. If not buy a RPi and stand on the shoulders of the openHABian team that have done all the work for the community.

1 Like

I can live with time cost. At the moment I have only one issue and it’s a java version.
Not sure if armbian is “ready” for openhab with correct java version or I must search how to downgrade under dietpi (or armbian). I tried a sugested instructions but no luck till now.

Nobody seems to have mentioned actually removing Java 17

problem solved :

java 11 installed, downgrade not necessary

Instruction:
install java 11:

sudo apt-get -s install openjdk-11-jdk

then install the default Java Development Kit:

sudo apt install default-jdk

and set default java :

sudo update-alternatives --config java
sudo update-alternatives --config javac

and

reboot

after reboot must

java -version
javac -version

show java 11

1 Like

Let’s go back to my next step. Decode a answer to get relevant data from the answer.
I created rule which will work with received data. Idea is following, take a received string, split char to char and then convert to hex.

var logger = Java.type('org.slf4j.LoggerFactory').getLogger('org.openhab.rule.' + ctx.ruleUID);
var item = itemRegistry.getItem('Received');
var text = item.getState();
val string1 = item.state.split("");

in the terminal I’m looking online on logger information. Problem is to get working a split function. I tried a several instructions, but always a split error.

tested:

val string1 = itemName.state.toString.split("");
String[] arrOfStr = str.split("");