Error when trying to install Sinope Binding

I just installed my new GT130 gateway, and trying to add it to my openHAB 2.5 that is installed on my Pi 3B+.

From my woking computer (not the PI), I downloaded the core-0.0.4-SinopeProtocol.zip
from github (https://github.com/chaton78/sinope-core/releases), extracted the .exe on my windows computer, opened a CMD windows, changed directory for where the .exe is located, and typed the following command

SinopeProtocol.exe -addr 192.168.2.XXX  -gateway XXXX-XXXX-XXXX-XXXX  -login

and I got this error: Exception found in thread main…Connection refused

Any help will be greatly appreciated :wink:

  • is the openhab host pingable from your window client ?
  • any network restriction between your windows client and openhab server ?
  • antivirus software ?
  • according to the binding documentation there is also java software that can be used to get the API key; try it from openhab host if it makes any difference

Thanks Wolfgang, those were great ideas! But unfortunately I wasn’t able to succeed.

So, Yes, It was pingable from my Windows client. But there are indeed antivirus and other firewall, so I decided to try directly on the Pi, but the thing is, I’m not 100% familiar with Pi architechtures and commands.

I have copied the core-0.0.3-shaded.jar file into /etc/openhab2/ directory (because I had access to it from my Win client where I had downloaded the file.

On the Pi, over SSH, I navigated to /etc/openhab2/ directory, and executed the following command:

java -jar core-0.0.3-shaded.jar -addr 192.168.2.XXX -gateway XXXX-XXXX-XXXX-XXXX -login

and got an error message:

Error: Unable to access jarfile core-0.0.3-shaded.jar

Now, I don’t know if java is installed on the Pi and don’t know how to make sure. I also don’t know if the file needs to be in a specific directory…

The error message

means the jar file is not accessible. In case java would not be found it would say something like command not found.
What is the user that you are logged on with when you executed the command ?
What is the file permission of the jar file.
To check the jar file permissions you can execute:

ls -l /etc/openhab2/core-0.0.3-shaded.jar

I assume that you are not logged in as user root and the file permissions that the user has and the file provides do not match.
You may try to run

sudo chmod ugo+r  /etc/openhab2/core-0.0.3-shaded.jar

and then try to run the java command again.

Thank Wolfgang for all your fabulous teaching.

First thing, i’m an idiot. I have realized that the file I had downloaded is 0.0.4 and not 0.0.3 so, no wonder why it couldn’t find the file.

You are correct, I am not logged in as root but rather as openhabian (user)

I have tried with the proper file name, and now I get an error message that is similar to the one I was getting on my windows client, but instead of “unknown source”, I have atual textes and numbers (which I have no clue what it means!)

I am not an expert in interpreting Java error messages. Just can guess here.
The connection is being refused. That could be because the wrong port is used to connect to or it can have other reasons. As ca. is mentioned as part of the last two error messages it could be that this is related to missing certificate or invalid certificate.
You could try to do a network trace to check if this gives more hints.
Try to get information from the owner of the binding or from the company that provides the hardware.

I’m not very able with Github … but where are you guys seeing that this is any kind of openHAB binding?

As far as I understand @KhameleonPerseverant follows the steps that are described at https://www.openhab.org/addons/bindings/sinope/

@Wolfgang_S is correct.Those are the instruction I am following.

I googled the error, and ended up on that page
https://javarevisited.blogspot.com/2013/02/java-net-ConnectException-Connection-refused.html#:~:text=reason%20of%20java.-,net.,to%20avoid%20connection%20refused%20exception.

which suggested to ping the server (I’m assuming they mean the sinope server) but I have looked at the code and couldn’t figure out what is the server…

Your GT130 gateway has the IP address 192.168.2.XXX ?
I don’t have that hardware and just ran the jar file.
It tries to connect to the ip address that is entered as value to the addr parameter on port 4550.
I get the same error message, of course because I don’t have a real GT gateway.
Can you ping your gateway. Of course it depends how that gateway works. It might not react on pings.
What do you get if you try to connect to the gateway on port 4550 using the telnet command ?

telnet gatewayipaddress 4550

Yes, my GT130 have the fixed IP address 192.168.2.101.

I am able to ping 192.168.2.101 from the Pi, but If I try to run

telnet 192.168.2.101 4550

on my Pi, I get

-bash: telnet: command not found

You may install it with the command

sudo apt install telnet

look like obvious! Sorry, I’m learning linux/Pi…

So, I got a bunc of error messages when installing telnet (about the locales…)

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  telnet
0 upgraded, 1 newly installed, 0 to remove and 13 not upgraded.
Need to get 60.7 kB of archives.
After this operation, 131 kB of additional disk space will be used.
Get:1 http://raspbian.freemirror.org/raspbian buster/main armhf telnet armhf 0.1                                      7-41.2 [60.7 kB]
Fetched 60.7 kB in 1s (92.9 kB/s)
apt-listchanges: Can't set locale; make sure $LC_* and $LANG are correct!
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = "en_GB.UTF-8",
        LC_ALL = "en_GB.UTF-8",
        LC_CTYPE = "en_GB.UTF-8",
        LANG = (unset)
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
Selecting previously unselected package telnet.
(Reading database ... 52893 files and directories currently installed.)
Preparing to unpack .../telnet_0.17-41.2_armhf.deb ...
Unpacking telnet (0.17-41.2) ...
Setting up telnet (0.17-41.2) ...
update-alternatives: using /usr/bin/telnet.netkit to provide /usr/bin/telnet (te                                      lnet) in auto mode
Processing triggers for man-db (2.8.5-2) ...
Updating FireMotD available updates count ... /bin/bash: warning: setlocale: LC_                                      ALL: cannot change locale (en_GB.UTF-8)

[16:05:29] openhabian@openHABianPi:~$ telnet 192.168.2.101 4550
Trying 192.168.2.101...
telnet: Unable to connect to remote host: Connection refused
[16:06:13] openhabian@openHABianPi:~$ ^C
[16:06:54] openhabian@openHABianPi:~$ Reading package lists... Done
-bash: Reading: command not found
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  telnet
0 upgraded, 1 newly installed, 0 to remove and 13 not upgraded.
Need to get 60.7 kB of archives.
After this operation, 131 kB of additional disk space will be used.
Get:1 http://raspbian.freemirror.org/raspbian buster/main armhf telnet armhf 0.1                                      7-41.2 [60.7 kB]
Fetched 60.7 kB in 1s (92.9 kB/s)
apt-listchanges: Can't set locale; make sure $LC_* and $LANG are correct!
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = "en_GB.UTF-8",
        LC_ALL = "en_GB.UTF-8",
        LC_CTYPE = "en_GB.UTF-8",
        LANG = (unset)
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
Selecting previously unselected package telnet.
(Reading database ... 52893 files and directories currently installed.)
Preparing to unpack .../telnet_0.17-41.2_armhf.deb ...
Unpacking telnet (0.17-41.2) ...
Setting up telnet (0.17-41.2) ...
update-alternatives: using /usr/bin/telnet.netkit to provide /usr/bin/telnet (te                                      lnet) in auto mode
Processing triggers for man-db (2.8.5-2) ...
Updating FireMotD available updates count ... /bin/bash: warning: setlocale: LC_                                      ALL: cannot change locale (en_GB.UTF-8)
[16:06:56] openhabian@openHABianPi:~$ Building dependency tree
-bash: Building: command not found
[16:06:56] openhabian@openHABianPi:~$ Reading state information... Done
-bash: Reading: command not found
[16:06:56] openhabian@openHABianPi:~$ The following NEW packages will be installed:
-bash: The: command not found
[16:06:56] openhabian@openHABianPi:~$   telnet

but after that, when I ran

telnet 192.168.2.101 4550

I got

telnet: Unable to connect to remote host: Connection refused
  • is there any webinterface for that gateway where clients need to be allowed ?
  • could it be that GT 130 and GT 150 are different in a way that this kind of access is not allowed/working ?
  • do you have any manual or documentation that may describe the differences between them ?
  • looks like you need to contact the developer of the binding

Thanks a lot for all your involvment Wolfgang… you have been very helpful.

I don’t know how to contact the owner on github, but I have created an issue, hoping he will see it. we’ll see if I get back from him.

As far as your other questions… I was asking myself the exact same questions.

I believe that the GT 130 is meant to be accessible, because I have seen other projects for it on github (but or homeassistant).

I will let you know when I get more answers!

Thanks for everything you did for me :wink:

just because of curiosity do you have links for these other projects ?

Sure!

Hello, Have you been able to connect to the GT130 gateway yet?

Not yet. But I didn’t have time to work on that a lot.

I think we’ll have to contact sinope (manufacturer), from comments I saw on their websites, I think that they changed the API or something like that, so we’ll have to ask them how to fix that

I called them today and they don’t plan to open the API of the gt130 for third party…