Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not starting.. #19

Open
FloMeyer opened this issue Mar 15, 2021 · 6 comments
Open

Not starting.. #19

FloMeyer opened this issue Mar 15, 2021 · 6 comments

Comments

@FloMeyer
Copy link

At the first start, it tells: nodeBlueCredentialKey.txt

After creating this file with a random key, homegear ist starting, but the RPC-Server on Port 2001 does not anwer.
Also the Webinterface just showing 502: bad Gateway
image

Home Assistant OS 5.12
supervisor-2021.03.6
core-2021.3.4

Homegear
Current version: 0.72.0

homegear_log.txt

@FloMeyer
Copy link
Author

FloMeyer commented Mar 16, 2021

21-03-16 17:38:47 ERROR (MainThread) [supervisor.api.ingress] Ingress error: Cannot connect to host 172.30.33.8:8099 ssl:default [Connect call failed ('172.30.33.8', 8099)]
21-03-16 17:38:48 ERROR (MainThread) [supervisor.api.ingress] Ingress error: Cannot connect to host 172.30.33.8:8099 ssl:default [Connect call failed ('172.30.33.8', 8099)]
21-03-16 17:38:48 ERROR (MainThread) [supervisor.api.ingress] Ingress error: Cannot connect to host 172.30.33.8:8099 ssl:default [Connect call failed ('172.30.33.8', 8099)]

By default homegear is not running on port 8099, but homeassistant ingress des expect to run the webserver on port 8099.

--> https://developers.home-assistant.io/docs/add-ons/presentation/

Here are the requirements of Ingress:

Ingress must be enabled. Set ingress: true in config.json.
Your server may run on port 8099. If it does not run on 8099, you must set ingress_port: PORT_NUMBER in config.json to match your configuration.
Only connections from 172.30.32.2 must be allowed. You should deny access to all other IP addresses within your add-on server.
Users are previously authenticated via Home Assistant. Authentication is not required.
TIP


but simply setting the Port 80 to 8099 ends in "error 404" because homeassistant's ingress requests "index.php", which does not exist:
03/16/21 19:16:59.621 RPC Server (Port 8099): Info: Connection from ::ffff:172.30.32.2:46240 accepted. Client number: 15
03/16/21 19:16:59.622 RPC Server (Port 8099): Info: RPC server client id for client number 15 is: 3
03/16/21 19:16:59.623 Web server (Port 8099): Client is requesting: / (translated to /var/lib/homegear/www/rpc/index.php, method: GET)
03/16/21 19:16:59.623 Script Engine Server: Info: Starting script "/var/lib/homegear/www/rpc/index.php" with id 4.
03/16/21 19:16:59.626 Info: Script with id 4 finished with exit code 0

kreativmonkey added a commit that referenced this issue Mar 17, 2021
@kreativmonkey
Copy link
Owner

I've added some bugfixes to the new release. Now the nodeBlueCredentialKey.txt will be created if it not exist so the sartup is not blocked by this issue.

i have some trouble to get the webui running, test this fixes and give me some feedback pleace.

@FloMeyer
Copy link
Author

Hi Sebastian, i forked your repo and made some changes to "my" environment. I got it now up and running.

One big problem is, that my /dev/ttyUSB0 device is in group 18/audio. Homegear is started with the "homegear" user and there is no group 18 in the addon-container.. So homegear must be started as root.
They dont want to fix this... home-assistant/supervisor#1614

For the webserver you need to set
webServer = true
in the rpcservers.conf.
The configuration file says its a security issue to run rpc and webserver on the same port.. but i dont care. The documentation is incomplete...

It looks like homegear is not really maintained and it looks a bit orphaned. But unfortunately i need it for my Max! thermostat via 868 MHz nanoCUL. :/

@kreativmonkey
Copy link
Owner

Hi Flo,

it's not so nice to running homegear as root but for the moment it's the best workaround i think. I will have a look to the HA user management to get the ha user running in the docker container like mosquito and other add-ons. I'm not shure if this will fix the problem.

As I see it, homegear has not been developed properly for a long time. Version 0.8 has been in the documentation for a good two years now and the documentation sucks.

Did you try to newly install your fork (by deleting the existing folders)? Did you get the webfrontend up?

@FloMeyer
Copy link
Author

FloMeyer commented Mar 17, 2021

I fully agree!

Yes, I got it running. One strange thing is, that the admin interface is "not found" when accessing via ingress.
If i address Port 2001 directly, i can access it:
image
03/17/21 23:08:50.134 RPC Server (Port 2001): Info: Connection from ::ffff:10.1.5.220:20747 accepted. Client number: 116
03/17/21 23:08:50.134 RPC Server (Port 2001): Info: RPC server client id for client number 116 is: 63
03/17/21 23:08:50.163 RPC Server (Port 2001): Info: Connection from ::ffff:10.1.5.220:20748 accepted. Client number: 117
03/17/21 23:08:50.163 RPC Server (Port 2001): Info: RPC server client id for client number 117 is: 64
03/17/21 23:08:50.172 Web server (Port 2001): Client is requesting: /admin/ (translated to /var/lib/homegear/www/admin/, method: GET)
03/17/21 23:08:50.172 Script Engine Server: Info: Starting script "/var/lib/homegear/admin-ui/public/index.php" with id 14.
03/17/21 23:08:50.829 Info: Script with id 14 finished with exit code 0

But via ingress:
image
03/17/21 23:07:10.695 RPC Server (Port 2001): Info: Connection from ::ffff:172.30.32.2:44322 accepted. Client number: 109
03/17/21 23:07:10.696 RPC Server (Port 2001): Info: RPC server client id for client number 109 is: 60
03/17/21 23:07:10.699 Warning: Requested URL not found: /admin/

rpcservers.conf.txt

@kreativmonkey
Copy link
Owner

I think you don't need the ingress_entry setting in your config.json becouse there is a index.php that will direct you to /admin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants