Giter VIP home page Giter VIP logo

Comments (10)

kyle-github avatar kyle-github commented on August 11, 2024 1

IIRC, discovery uses UDP broadcast. That might be blocked from a Docker container.

from pylogix.

TheFern2 avatar TheFern2 commented on August 11, 2024 1

Yeah if docker is out of the question for discovery of devices. The next best solution is as I mentioned before, with nssm, creating either a script or even an exe for a simple api /api/get_devices and you call that endpoint from your docker container. Would you probably be better to write this exe in another language for a smallest binary.

from pylogix.

TheFern2 avatar TheFern2 commented on August 11, 2024

Hey there, does this also happen with a host adapter?

https://docs.docker.com/network/network-tutorial-host/

from pylogix.

dmroeder avatar dmroeder commented on August 11, 2024

I don't know much about docker but if it doesn't have direct access to a network adapter, like bridged mode in a VM, then it is likely the broadcast isn't making it out of the container.

from pylogix.

TheFern2 avatar TheFern2 commented on August 11, 2024

host mode is the equivalent to a vm bridge mode, that should solve the issue.

from pylogix.

ranwang0417 avatar ranwang0417 commented on August 11, 2024

Hi @TheFern2 @dmroeder @kyle-github , thank you so much for your replies!

I was trying to create custom network for my container, but it seems that the host option is only for Linux host and transparent network is only for windows containers. I am looking into two directions now. One is to change from Linux container to Windows container and the other is to figure out how to send UDP broadcast from a docker container. I'll reply here if I could find anything.

from pylogix.

TheFern2 avatar TheFern2 commented on August 11, 2024

A bit off topic, but why do you need to run pylogix inside a container? pylogix requires zero deps aside python, so running in a container is imo an unnecessary overhead. Use venv or poetry if you don't want to install python on the system wide libraries, and use nssm to call your python script.

from pylogix.

ranwang0417 avatar ranwang0417 commented on August 11, 2024

This is mainly for deployment purposes. We are developing a web-based software framework that includes the frontend, backend and database. All the components are in a docker compose network for easy deployment and they are managed by nginx. I was trying to add pylogix to the Django backend app so that we can communicate with RA PLCs. Another way around is to use the common gateway platform which claims to work in docker but has other issues that we need to resolve.

from pylogix.

ranwang0417 avatar ranwang0417 commented on August 11, 2024

I did not find a working solution to broadcast from the container to the local network for my setup (windows host and linux container). Thank for all your help anyway!

from pylogix.

ranwang0417 avatar ranwang0417 commented on August 11, 2024

Thanks for the suggestion! I'll give it a try. I really like the discover function as it could simplify the workflow and make it easier for the user.

from pylogix.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.