Docker IPC Communication (Backend to Frontend)

Hello guys,

we are in the process of connecting Storyboard to the backend. For this we first took the ThermostatIO example. We have problems to establish an IPC connection. 

We are working with Torizon Core and the backend and frontend are in two separate containers. Using the Docker compose file, we want to set up the communication, but we are failing at this. 

Does anyone have experience with this?

 

0

Comments

4 comments
  • One of our customers recently went through this scenario and provided some feedback ...

    To send to backend application (ie your C application)

    Storyboard side

    With a Lua script gre.send_event_data("Notify", format, myData, "tcp://50000") // were 50000 is the published port. That's it that all it needs.

    C application

    Channel name should be the same as Storyboard "tcp://50000" for the handle = gre_io_open(RECEIVE_CHANNEL, GRE_IO_TYPE_RDONLY);

    Docker specific settings:

    1) I'm using VS Code with the Torizon extention - Click on the Torizon extention while in the remote connection environment.

    2) add ports = Configurations - > ports, click the plus.. in command bar type 50000/tcp hit enter then 50000. The result should be 50000/tcp 50000

    3) add volume and map the location of the sb engine folder to a folder in the container.
    Mine is /home/torizon/crank/sbEngine:/tmp/sbEngine so I mapped the sbEngines folder to a /tmp folder. /tmp is available when the container is created. I change the long folder name of the engine to something shorted "sbEngine"

    4) under extra params, add network_mode host. This puts the container on the host network. If you put it on a bridge network you will have to provide the IP address to your send event name channel.

    5) IMPORTANT! IMPORTANT! Last you will have to export the LD_LIBRARY_PATH.
    In VS code this is done by going to the Torizon extention tab -> configurations -> custom Properties -> env. If env is not there, then click the "+" next to Custom Properties.
    Edit env to be ENV LD_LIBRARY_PATH="$LD_LIBRARY_PATH/tmp/sbEngine/lib"

    Start your debugger in vs code and let it run. Then start the storyboard container and it should be able to send.

    Hope this helps somebody

    0
  • We have followed steps 1-5 according to your instructions. Thanks for that!

    Unfortunately, this did not lead to success. 

    Using the Torizon extension, I can export the Dockercompose file that was created. 
    This also looks correct to me. 

    3.) I named the folder as you did, and copied it again to my Toradex. I have there the SbEngine "linux-imx8yocto-armle-opengles_2.0-wayland-obj". This is the right one for my SoC IMX8M Mini. 

    5.) In the backend container I can also display the environment variables. There I also get the correct specification for the environment variable LD_LIBRARY_PATH.

    we also used iogen to establish a connection. 

    as you can see, it can connect to the frontend but then always ends with Error 111. what does Error 111 mean? we have not found an error list for this.

    To make sure that the host and port are correct, we tried to use the host "foo". There the hostname can not be resolved, which is correct, because it does not exist. 

    0
  • I would suggest taking a look at this section from the documentation: Sending and Receiving Data with Storyboard IO – Crank Software

    In that section, you'll find a subsection specific to using SBIO over TCP channels.  It explains how we should specify our channel names.

    For a receiving channel:
    tcp://<port or channel>

    For a sending channel:
    tcp://<IP address>:<port or channel>

    In your case you used tcp://crank:thermostat_frontend, which means that "crank" needs to be findable by your DNS.  So, if you wrote the command `ping crank` you should expect to see packets sent to the remote device, if not, then you need to adjust your target IP address or network name.

    If you were to instead, replace "crank" with the IP address of the remote target, you may have a channel name that looks like this:
     tcp://192.168.1.101:thermostat_frontend

    Cheers,
    Mike

    0
  • At least we solved this Problem.
    Was a bit tricky with the torizon extension.
    Thanks for the help!

    0

Please sign in to leave a comment.

Didn't find what you were looking for?

New post