UncleSamSwiss / ioBroker.loxone

ioBroker adapter for Loxone Miniserver
Apache License 2.0
27 stars 25 forks source link

No connection to miniserver #46

Closed tb1987 closed 3 years ago

tb1987 commented 4 years ago

I made a new installation of iobroker on an raspberry pi.

When connectiong to the Miniserver I get this error:

loxone.1 | 2020-08-16 13:16:35.214 | error | (23606) Miniserver connection error: Error [ERR_STREAM_WRITE_AFTER_END]: write after end

There are no messages in the miniserver log.

When I turned the debugging level higher I get the following messages: grafik

Here is one oh the keyexchange Messages: (1642) sent message: jdev/sys/keyexchange/ZnnUHHgH898oD9bJP5pYPuNZf0/xaUAm/EKSDYHXt5//d7nQfA46iS1W/UD4iweAHQ2Yu2LDM2bxf+BNmLV7haQjV7YpFgGrjcwP7DVkVFUGBHKL9aI6ehqk2sGqnwi3OnlYj9TSALG6RQAqSkCbdfSE/siiw

It's a first generation miniserver Version: 11.0.5.5

Version nodejs pi@raspberrypi:~ $ nodejs --version v12.18.3 12.18.3

Version io-broker: "hosts": [ { "version": "3.1.6", "platform": "Javascript/Node.js", "type": "linux" } ], "node": "v12.18.3", "arch": "arm", "adapters": { "admin": { "version": "4.0.10", "platform": "Javascript/Node.js" }, " info": { "version": "1.7.2", "platform": "Javascript/Node.js" }, "loxone": { "version": "1.1.0", "platform": "Javascript/Node.js" },.

I got a connection one time, but it is not reproducable.

As I get the same Error in node-red it may also be a configuration problem or a miniserver or node-js bug. It's my first installation, so I can't say, if I did eyerything right in the configuration.

But I have no idea where to look further and haven't found anything like this online.

UncleSamSwiss commented 4 years ago

Thanks for the precise reporting about your system! Everything is on the latest version, so this looks good.

Unfortunately the messages are encrypted, so I can't really tell anything from the keyexchange message above.

The last time I saw an issue like this, I used the wrong password. Are you using a different user for ioBroker or the same as usual? Is there a firewall between you and the Miniserver?

With an earlier version of the Miniserver I had to sometimes reboot the Miniserver because it wouldn't accept connections anymore; but I haven't seen this in a long time.

If you want to check that your installation is working properly, you can configure the following test server from Loxone: Host: testminiserver.loxone.com Port: 7777 Username: web Password: web

rc-itcon commented 4 years ago

Hello,

I have also exact the same Versions Installed, and getting exact the same error.

If needed, i can provide more details of the versions and the error.

tb1987 commented 4 years ago

The connection with the testminiserver worked. It seem to be running on an not yet published version: 11.1.8.12

The connection to my miniserver seems to work sometimes on the first try after a longer period.

UncleSamSwiss commented 4 years ago

I'm pretty certain it won't help, but can you try to install the pre-release of 2.0.0 (on NPM and GitHub)? If this fixes the issue, then we are good, if not, I need to investigate more.

rc-itcon commented 4 years ago

installing the 2.0.0 version solved the connect Problem. I have only one question about reading/building the tree structure under objects. For some elements i'm getting the following error:

loxone.0 | 2020-08-20 22:07:49.806 | error | Require stack: loxone.0 | 2020-08-20 22:07:49.806 | error | (11838) Unsupported control type IRoomControllerV2: Error: Cannot find module './controls/IRoomControllerV2' loxone.0 | 2020-08-20 22:07:48.618 | error | - /opt/iobroker/node_modules/iobroker.loxone/build/main.js

has that something to do with version 2.0.0 or is that normal?

nodejs -v = v12.18.3 node -v = v12.18.3 npm -v = 6.14.6 iobroker version = 3.1.6

thanks.

tb1987 commented 4 years ago

I'm sorry, but I can't confirm this. I updated via the iobroker GUI to the githubVersion 2.0.0. I also restarted the iobroker service. I still have the Problem.

There is also a Question on the Loxone website about web login: https://www.loxone.com/dede/question/ich-kann-mich-auf-der-webseite-nicht-anmelden-denn-hier-kommt-ein-berechtigungsfehler-tut-uns-leid/

I'm not sure, if this Question is about the Miniserver webinterface or Loxone homepage.

But maybe a new Miniserver software Version is the solution.

@UncleSamSwiss are you testing with the newest Miniserver software version?

rc-itcon commented 4 years ago

try to install Loxone config Firmware Version 11.0.7.15

You have to download that version on the Loxone Homepage under downloads. if you click on search for updates directly on your current config version you will don't see the update.

tb1987 commented 4 years ago

I installed the newest version from the website and updated the Miniserver. I still have the Problem.

UncleSamSwiss commented 4 years ago

For some elements i'm getting the following error:

You don't need to worry about these. The error message changed slightly, but it is still the same as before: some Loxone controls are (not yet) supported. I will try to add as many as possible in the coming weeks.

UncleSamSwiss commented 4 years ago

I'm not sure, if this Question is about the Miniserver webinterface or Loxone homepage.

I'm pretty certain it is about their website. Anyway the adapter is using the web connection, but is not actually loading the web page of the Miniserver, thus "hitting Ctrl-F5" wouldn't be possible and wouldn't help either.

I will investigate this further.

bullrandle commented 4 years ago

Saw the upgrade to 2.0.0, ran into the same problem as mentioned above. So I stepped back to version 1.1.0.

If you need a tester, I can help ...

Isidor-dev commented 4 years ago

Same Issue's like the first post here. I tried following:

install new loxone-ws-api from npm change loxone port back to 80 disable ALL firewalls in my system change port from ioBroker to 80 use simplest password 123456 for loxone user

nothing worked, but the testminiserver as seen above worked. What the hell?!

i don't know how to move on. Tried everthing i could.

@UncleSamSwiss please find a solution ;)

Isidor-dev commented 4 years ago

PS: i tried version 1.1.0 and 2.0.0

Isidor-dev commented 3 years ago

Any Suggestion so far?

Isidor-dev commented 3 years ago

Still not working. Installed 2.0.2.

UncleSamSwiss commented 3 years ago

@Isidor-dev I'm still absolutely unsure what is going on, this is frustrating.

May I ask you to do the following and report the log files?

  1. Ensure you have the latest version of the adapter (2.0.2) and also your Miniserver is updated to the latest available version
  2. Stop the adapter in ioBroker
  3. Remove power from the Miniserver
  4. Wait about 1 minute
  5. Add power to the Miniserver
  6. Wait for the Miniserver to start and ensure you can log in through its web interface
  7. Set the adapter log level in ioBroker to silly
  8. Start the adapter in ioBroker
  9. Wait for the adapter to connect at least twice, then stop the adapter again.

After this, please post the log file (only the entries for loxone.0 are relevant) as a text file (not an image!). If you are worried about sensitive data in the log file, you may also send it to me by PM in the ioBroker forum: https://forum.iobroker.net/user/unclesam

Isidor-dev commented 3 years ago

@UncleSamSwiss

Thanks for your advice. Here is the logfile. I now even tried to connect to an "empty" Miniserver and failed. Log_ioBroker_loxone.0.txt

UncleSamSwiss commented 3 years ago

@Isidor-dev thanks for the test run. Did you set the log level to silly? I only see info and error messages in the attached log file.

I changed one log message that was ambiguous ("Miniserver connect failed"). Can you please install the latest version from GitHub (not npm or the ioBroker registry).

After this, please re-run the test I described above.

Isidor-dev commented 3 years ago

@UncleSamSwiss

I installed the new github version (updated 2h ago), done the test, same result. Webinterface and APP: function as usually.

Log_ioBroker_loxone.0_2.txt

Isidor-dev commented 3 years ago

Sorry...i set the wrong IP ;)

Now it says: Auth failed, means Credentials are wrong (?) but im 100% sure i can login to my MS with these Credentials. Log_ioBroker_loxone.0_3.txt

TomTrek99 commented 3 years ago

I have exactly the same error messages as Isidor-dev. My IO Broker is quite freshly set up, but I have only tested up to adapter version 1.10. I can't imagine that the error is caused by the adapter, because otherwise many other users would have difficulties. @UncleSamSwiss Maybe we should check the Miniserver for similarities. I have created several users and tried it with different usernames, passwords with and without special characters etc. So far unsuccessfully. What surprises me is that I get the test minisever of Loxone without problems, but unfortunately not mine. Miniserver 1, with fixed IP, port 80, DNS server is a PiHole ( not the router ) Miniserver is also connected to Loxberry ( if that tells you anything ). / external access via dns.loxonecloud.com:2080

Maybe there are some similarities here that are helpful :-)

Isidor-dev commented 3 years ago

@TomTrek99

I tried the same (users, pw, port...) nothing helped. Testminiserver from loxone workes fine ;) i think its our network setup or miniserver setup/config, but i dont know, what else should i test to get results.

TomTrek99 commented 3 years ago

@Isidor-dev

Yes that is my guess. This error seems to be extremely rare, because I posted my question in the German Loxone Forum, nobody there has similar problems. But since the Loxone Adapter is extremely important for me, I absolutely need a solution. The key could be to compare similarities in our home network and Config. Where there are overlaps, which others might not have, the solution could there. We can also exchange information via PN or Skype. Would you be interested ? I would be very happy, because I have no more idea at the moment.

Tripmaster7 commented 3 years ago

I had the exakt same problem, and while reading this thread is started to work magically, but throwing new errors, complaining about unsupported controls

(3107) Unsupported control type IRoomControllerV2: Error: Cannot find module './controls/IRoomControllerV2' (3107) Unsupported control type TextState: Error: Cannot find module './controls/TextState' (3107) Unsupported control type EIBDimmer: Error: Cannot find module './controls/EIBDimmer'

and some other

bullrandle commented 3 years ago

@TomTrek99 Have the same problem and a similirity of my setup to yours is a pihole as dns server

Isidor-dev commented 3 years ago

I GOT IT!!!! OMG! I write it down and will post it in 10-15mins!

Isidor-dev commented 3 years ago

So guys. Here it is: How-To.txt

TomTrek99 commented 3 years ago

@Isidor-dev O.K. First of all, thank you very much for the effort. !!!! Unfortunately I have no possibility to test all steps today. So it would be great if you could check back here in the next few days if we have any questions :-)

So if I understand it correctly, we have some setting in our Config which is not compatible to the adapter. By loading an empty file (where this error probably does not exist) into the Miniserver and letting the adapter connect for the first time, we bridge this not yet discovered error, right ?

Two questions first. What does it mean that I have to search for extensions in the new empty project ? Do I have to save them as dummy values for the adapter to find something ? I really need a user with passwords without special characters ?

Isidor-dev commented 3 years ago

@TomTrek99

You have to search the Extenxions and insert with serial number to your empty project. I dont know why, but with a complete empty project, it doesnt connect after you upload your main project.

For me it only worked with a simple alphabetic password. Maybe you could try it with special characters.(?)

I dont know wich setting/s cause the errors, but yeah i think we bridge these with an empty project. Im currently testing if everything works fine in iobroker. But seems to be ok, except the known not supported objects.

UncleSamSwiss commented 3 years ago

@Isidor-dev Thank you very much for investigating the issue and finding the solution.

One question: You say: "DON'T PAUSE THE ADAPTER BEFORE THESE STEPS!", but am I right that you can restart the adapter after having uploaded your current project again?

If this proves to work also for @TomTrek99, I will add a description to the project so others with the same issue know how to fix it.

Isidor-dev commented 3 years ago

@UncleSamSwiss yea, after uploading the current project you can restart/pause the Adapter. I think, as TomTrek99 said, theres a problem with our config/settings wich block the initial connect to our MS.

tb1987 commented 3 years ago

I'm sorry, there are a lot of things going on at the moment here, so I haven't been able to test this yet. Has anyone tested this and can confirm it is working?

UncleSamSwiss commented 3 years ago

Seems to be solved with the steps described above.

Thanks to everybody who tested and contributed to this!