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

use host.docker.internal for talking to blueos #39

Merged
merged 2 commits into from
Feb 16, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ LABEL permissions='\
},\
"HostConfig": {\
"Binds":["/root/.config:/root/.config"],\
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we also change this to use the extensions folder?

I'm aware that's not relevant for this PR, but it'd be nice if we could sort that out as part of the general "fitting more with BlueOS best practices" theme :-P

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm... let me make a version with this pr first, as this got tested already =]

"ExtraHosts": [\
"host.docker.internal:host-gateway"\
],\
"PortBindings": {\
"9001/tcp": [\
{\
Expand Down
2 changes: 1 addition & 1 deletion dvl-a50/dvl.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def look_for_dvl(self):
time.sleep(1)

def wait_for_cable_guy(self):
while not request("http://127.0.0.1/cable-guy/v1.0/ethernet"):
while not request("http://host.docker.internal/cable-guy/v1.0/ethernet"):
self.report_status("waiting for cable-guy to come online...")
time.sleep(1)

Expand Down
2 changes: 1 addition & 1 deletion dvl-a50/dvlfinder.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def find_the_dvl() -> Optional[str]:

nmap = nmap3.Nmap()
# generate the scan mask from our current ips
networks = json.loads(request("http://127.0.0.1/cable-guy/v1.0/ethernet"))
networks = json.loads(request("http://host.docker.internal/cable-guy/v1.0/ethernet"))
current_networks = [network["addresses"] for network in networks]
# this looks like [{'ip': '192.168.2.2', 'mode': 'server'}]
current_ips = []
Expand Down
2 changes: 1 addition & 1 deletion dvl-a50/mavlink2resthelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

from blueoshelper import post, request

MAVLINK2REST_URL = "http://127.0.0.1/mavlink2rest"
MAVLINK2REST_URL = "http://host.docker.internal/mavlink2rest"
GPS_GLOBAL_ORIGIN_ID = 49

# holds the last status so we dont flood it
Expand Down
Loading