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

feat: allow accessing broadlink controllers by referencing static ip.… #86

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jannylund
Copy link

… This allows use of non-host network mode in docker and makes the app work properly on mac.

This will provide a solution for the following issues:

To confirm, the following docker-compose file can be used:

services:
  broadlinkmanager:
    build: .
    environment:
      - ENABLE_GOOGLE_ANALYTICS=False
      - STATIC_IP_LIST=<ip-of-controller1>,<ip-of-controller2..>
    ports:
      - 7020:7020

… This allows use of non-host network mode in docker and makes the app work properly on mac.
@jannylund
Copy link
Author

Ping @t0mer - please check when you have time. I have another PR ready for opening to simplify dependency management, but would be great if this is handled first as they are a bit dependent on each other.

@gorbypark
Copy link

hey was trying out this branch to see if it would help me with my "no devices" issue...the IP of 192.168.1.151 is the RM4Pro.
docker-compose.yml

services:
  broadlinkmanager:
    build: .
    environment:
      - ENABLE_GOOGLE_ANALYTICS=False
      - STATIC_IP_LIST=192.168.1.151
    ports:
      - 7020:7020

still not seeing any devices.

broadlinkmanager-1  | INFO:     Application startup complete.
broadlinkmanager-1  | INFO:     Uvicorn running on http://0.0.0.0:7020 (Press CTRL+C to quit)
broadlinkmanager-1  | INFO:     192.168.65.1:27912 - "GET / HTTP/1.1" 200 OK
broadlinkmanager-1  | INFO:     192.168.65.1:27912 - "GET /all.min.css HTTP/1.1" 304 Not Modified
broadlinkmanager-1  | INFO:     192.168.65.1:27912 - "GET /adminlte.min.css HTTP/1.1" 304 Not Modified
broadlinkmanager-1  | INFO:     192.168.65.1:27912 - "GET /hex.js HTTP/1.1" 304 Not Modified
broadlinkmanager-1  | INFO:     192.168.65.1:27913 - "GET /broadlink.png HTTP/1.1" 304 Not Modified
broadlinkmanager-1  | INFO:     192.168.65.1:27914 - "GET /jquery.min.js HTTP/1.1" 304 Not Modified
broadlinkmanager-1  | INFO:     192.168.65.1:27915 - "GET /bootstrap.bundle.min.js HTTP/1.1" 304 Not Modified
broadlinkmanager-1  | INFO:     192.168.65.1:27912 - "GET /home.js?V=5 HTTP/1.1" 304 Not Modified
broadlinkmanager-1  | INFO:     192.168.65.1:27913 - "GET /clippy.svg HTTP/1.1" 304 Not Modified
broadlinkmanager-1  | INFO:     192.168.65.1:27916 - "GET /adminlte.min.js HTTP/1.1" 304 Not Modified
broadlinkmanager-1  | INFO:     192.168.65.1:27917 - "GET /clipboard.min.js HTTP/1.1" 304 Not Modified
broadlinkmanager-1  | INFO:     192.168.65.1:27912 - "GET /fa-regular-400.woff2 HTTP/1.1" 304 Not Modified
broadlinkmanager-1  | INFO:     192.168.65.1:27913 - "GET /fa-solid-900.woff2 HTTP/1.1" 304 Not Modified
broadlinkmanager-1  | 2024-09-23 18:28:29.190 | INFO     | __main__:search_for_devices:615 - Searching for devices...
broadlinkmanager-1  | 2024-09-23 18:28:29.191 | INFO     | __main__:search_for_devices:617 - Checking devices on interface assigned with IP: 172.22.0.2
broadlinkmanager-1  | 2024-09-23 18:28:34.198 | DEBUG    | __main__:search_for_devices:634 - Devices Found: []
broadlinkmanager-1  | INFO:     192.168.65.1:27918 - "GET /autodiscover HTTP/1.1" 200 OK
broadlinkmanager-1  | INFO:     192.168.65.1:27918 - "GET / HTTP/1.1" 200 OK

seems like it's still only scanning 172.22.0.2 which I guess is the internal docker IP?

@jannylund
Copy link
Author

Hey @gorbypark , indeed, this looks like you are still on the master branch. Can you show the git log output from your clone to validate that it has my latest commit?

@gorbypark
Copy link

gorbypark commented Sep 23, 2024 via email

@gorbypark
Copy link

Hey @gorbypark , indeed, this looks like you are still on the master branch. Can you show the git log output from your clone to validate that it has my latest commit?

So it turns out master is the branch I should have been on and I appear to be using the correct fork/branch..

git log

Author: Jan Nylund <jan.nylund@mac.com>
Date:   Thu Jul 25 20:41:58 2024 +0300

    feat: allow accessing broadlink controllers by referencing static ip. This allows use of non-host network mode in docker and makes the app work properly on Mac.

@jannylund
Copy link
Author

Strange. I confirmed that this works in my environment. Note that the static ip is scanned only after clicking the rescan button in the ui. Please see my screenshot. If this still fails for you, I can push a container to dockerhub to ensure that it is the proper commit that is running.

Screenshot 2024-09-24 at 20 38 53

@gorbypark
Copy link

Strange. I confirmed that this works in my environment. Note that the static ip is scanned only after clicking the rescan button in the ui. Please see my screenshot. If this still fails for you, I can push a container to dockerhub to ensure that it is the proper commit that is running.

So in the end I was missing the step of doing docker-compose build. I had run docker build ., which in theory should do the same thing if I am not mistaken. It's also possible I did the docker build . in the non-forked repo (but I'm about 90% sure I didn't!). Anyways, this works perfectly on my setup (macOS, docker desktop)! +1 for getting this merged.

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

Successfully merging this pull request may close these issues.

2 participants