Hilscher Community Forum
netpi-desktop-hdmi with setting network=bridge - Printable Version

+- Hilscher Community Forum (https://forum.hilscher.com)
+-- Forum: netPI 3 - Docker featuring Industrial Raspberry Pi 3 platform (https://forum.hilscher.com/forum-1.html)
+--- Forum: Software (https://forum.hilscher.com/forum-5.html)
+--- Thread: netpi-desktop-hdmi with setting network=bridge (/thread-606.html)

Pages: 1 2


RE: netpi-desktop-hdmi with setting network=bridge - tad - June-19th-2020

Dear Armin,

Thank you very much for your kind support.
I found out what the problem was.

The problem was in JavaScript.
I replaced hostname with IP address when creating a WebSocket object.
========
1: var uri = "wss://" + "192.168.1.23:1880" + "/andonws"; // it was "ntb827ebad4495:1880" before.
2: var webSocket = null;
3: function open() {
4: if (webSocket == null) {
webSocket = new WebSocket(uri);
.......
========

I am not sure why the hostname is not recognized in my home network environment.
But, anyway, the websocket is working properly with an IP address.

Best regards,

Dear Armin,

Thank you very much for your kind support.
I found out what the problem was.

The problem was in JavaScript.
I replaced hostname with IP address when creating a WebSocket object.
========
1: var uri = "wss://" + "192.168.1.23:1880" + "/andonws"; // it was "ntb827ebad4495:1880" before.
2: var webSocket = null;
3: function open() {
4: if (webSocket == null) {
webSocket = new WebSocket(uri);
.......
========

I am not sure why the hostname is not recognized in my home network environment.
But, anyway, the websocket is working properly with an IP address.

Best regards,


RE: netpi-desktop-hdmi with setting network=bridge - Armin@netPI - June-19th-2020

Well I just can guess what is the problem, but I think in the Node-RED container the Hostname resolver is not automatically making the correct entry in the container file named /etc/hosts when
running in bridged mode. So you have to edit this file and add a line „192.168.1.23 <your host name>“ manually


RE: netpi-desktop-hdmi with setting network=bridge - Armin@netPI - June-19th-2020

I might remember correctly that additional entries of file /etc/hosts can be also entered in container start parameter set in Docker web UI of netPI. I think under Container network setting dialog somewhere


RE: netpi-desktop-hdmi with setting network=bridge - tad - June-19th-2020

Dear Armin,

I really appreciate your support.
Yes, I am now able to access WebSocket by hostname after I added a pair of ip address and hostname into /etc/hosts under the HDMI container.
Your advice is so powerful!
Best regards,