# Fresh man ask for help

**URL:** <https://discourse.nodered.org/t/fresh-man-ask-for-help/79987>\
**Category:** General\
**Tags:** function-node\
**Created:** [21 July 2023 07:58 UTC](https://discourse.nodered.org/t/fresh-man-ask-for-help/79987 "2023-07-21T07:58:41Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![HenryTrang](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/henrytrang/32/81582_2.png) [@HenryTrang](https://discourse.nodered.org/u/HenryTrang)\
**Post date:** [21 July 2023 07:58 UTC](https://discourse.nodered.org/t/fresh-man-ask-for-help/79987/1 "2023-07-21T07:58:41Z")

</div>

Dear Vateran

i wanna to develop a box of adge serve to combine all communication protocol into one protocol to make main serve easier.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/4/448cfb2177123222bf2db0e7014d53f53d3448b8.png)

but something beyond my comprehension. I boot a websocket serve, and invoke it, the flow node socket in, didn't triggered.

so i wonder what does socket in really do?

thanks

best regard  
Henry

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [21 July 2023 08:40 UTC](https://discourse.nodered.org/t/fresh-man-ask-for-help/79987/2 "2023-07-21T08:40:55Z")

</div>

Hi Henry.

Welcome to the group.

> [@HenryTrang](#):
>
> i wanna to develop a box of adge serve to combine all communication protocol into one protocol to make main serve easier.

Sorry, but I don't understand what you mean by that.

Could you elaborate on what you mean: _all communication protocol into one protocol_ ??

Protocols are used for a reason. You can't (or maybe shouldn't) change protocols _willy nilly_ just because you want to.

---

<div class="post-metadata">

**Author:** ![HenryTrang](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/henrytrang/32/81582_2.png) [@HenryTrang](https://discourse.nodered.org/u/HenryTrang)\
**Post date:** [24 July 2023 08:35 UTC](https://discourse.nodered.org/t/fresh-man-ask-for-help/79987/3 "2023-07-24T08:35:33Z")

</div>

Dear Sir

thanks for your reply. i have several devices. some invoke via http, some invoke via mqtt, others invoke via websocket. but my main server only handle http. so i setup adge serve to convert http, mqtt, websocket to http.

sorry to confuse, and very appreciated your direction.

Best regard!  
sincerely Henry

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [24 July 2023 08:37 UTC](https://discourse.nodered.org/t/fresh-man-ask-for-help/79987/4 "2023-07-24T08:37:09Z")

</div>

I am not sure I am going to be able to help you.

Sorry.

---

<div class="post-metadata">

**Author:** ![HenryTrang](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/henrytrang/32/81582_2.png) [@HenryTrang](https://discourse.nodered.org/u/HenryTrang)\
**Post date:** [24 July 2023 08:42 UTC](https://discourse.nodered.org/t/fresh-man-ask-for-help/79987/5 "2023-07-24T08:42:04Z")

</div>

thanks sir. anyway i am appreciated.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [24 July 2023 08:57 UTC](https://discourse.nodered.org/t/fresh-man-ask-for-help/79987/6 "2023-07-24T08:57:06Z")

</div>

If you want a unified protocol I think it might be better to use MQTT rather than http. I think that might be simpler.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [24 July 2023 12:46 UTC](https://discourse.nodered.org/t/fresh-man-ask-for-help/79987/7 "2023-07-24T12:46:02Z")

</div>

In fact, thinking about it, that is effectively what I already do. Most sensors provide their data via MQTT already, but for those that don't, modbus devices for example, I poll them and write the values to MQTT so anywhere they are needed they are available via MQTT.

---

<div class="post-metadata">

**Author:** ![HenryTrang](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/henrytrang/32/81582_2.png) [@HenryTrang](https://discourse.nodered.org/u/HenryTrang)\
**Post date:** [25 July 2023 01:28 UTC](https://discourse.nodered.org/t/fresh-man-ask-for-help/79987/8 "2023-07-25T01:28:34Z")

</div>

Dear Colin

get your points. in coming may not from devices only. so there are difference types of incoming protocal. what confuse me is what node **websocket in** do? i am assuming, it triggered when devices provide data, but in fact it triggered when websocket serve response to devices.

i am jumping high expecting your answer. 😜

sincerely Henry

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [25 July 2023 08:44 UTC](https://discourse.nodered.org/t/fresh-man-ask-for-help/79987/9 "2023-07-25T08:44:01Z")

</div>

> [@HenryTrang](#):
>
> what node **websocket in** do?

It listens on a websocket and passes on any data received by that socket.

The screenshot you posted does not contain a Websocket In node. The node labelled 'websocket in' is an Inject node.

---

<div class="post-metadata">

**Author:** ![HenryTrang](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/henrytrang/32/81582_2.png) [@HenryTrang](https://discourse.nodered.org/u/HenryTrang)\
**Post date:** [26 July 2023 01:22 UTC](https://discourse.nodered.org/t/fresh-man-ask-for-help/79987/10 "2023-07-26T01:22:42Z")

</div>

i wire a flow like photoshot below

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/8/5820139c66115bc8be9b97a7da58dc3ef73da664.png)

then boot a websocket serve. the green mark of websocket in node and debug print show it connected.then i connected websocket and send a msg to the serve via websocket testing tool.

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/a/0a8657baa91babd780db6431f274c8f6b95a4f06.png)

the flow stay idle no any response while websocket testing tool connected the serve.

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [26 July 2023 05:35 UTC](https://discourse.nodered.org/t/fresh-man-ask-for-help/79987/11 "2023-07-26T05:35:48Z")

</div>

The websocket-in node is used for establishing the websocket client connection.  
Once connected, you can send data to the websocket-out node (if setup properly it is "internally" connected to the websocket-in node - this is required to understand which connected client is sending/receiving data).

So in your example flow - the http request node is only called once.

---

<div class="post-metadata">

**Author:** ![HenryTrang](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/henrytrang/32/81582_2.png) [@HenryTrang](https://discourse.nodered.org/u/HenryTrang)\
**Post date:** [26 July 2023 08:43 UTC](https://discourse.nodered.org/t/fresh-man-ask-for-help/79987/12 "2023-07-26T08:43:14Z")

</div>

thank you bakman2. i am naive, i will try to figure it out. your word is beacon in the dark

---

<div class="post-metadata">

**Author:** ![HenryTrang](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/henrytrang/32/81582_2.png) [@HenryTrang](https://discourse.nodered.org/u/HenryTrang)\
**Post date:** [28 July 2023 01:07 UTC](https://discourse.nodered.org/t/fresh-man-ask-for-help/79987/13 "2023-07-28T01:07:19Z")

</div>

Dear All

thanks for the concern. i am now find out my answer. you can regard socket in node as a socket server. http in node equal to a API. it work that way.

thanks sincerely Henry

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [11 August 2023 01:07 UTC](https://discourse.nodered.org/t/fresh-man-ask-for-help/79987/14 "2023-08-11T01:07:40Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
