# OMRONFINS-OMRON CS1G-TypeError: self.socket.connect is not a function

**URL:** <https://discourse.nodered.org/t/omronfins-omron-cs1g-typeerror-self-socket-connect-is-not-a-function/57126>\
**Category:** Industrial\
**Created:** [24 January 2022 05:31 UTC](https://discourse.nodered.org/t/omronfins-omron-cs1g-typeerror-self-socket-connect-is-not-a-function/57126 "2022-01-24T05:31:53Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![dinesh](https://avatars.discourse-cdn.com/v4/letter/d/a8b319/32.png) [@dinesh](https://discourse.nodered.org/u/dinesh)\
**Post date:** [24 January 2022 05:31 UTC](https://discourse.nodered.org/t/omronfins-omron-cs1g-typeerror-self-socket-connect-is-not-a-function/57126/1 "2022-01-24T05:31:53Z")

</div>

Hi,

I'm using omronfins node to connect to my omron plc(CS1G) via CJ1W-EIP21. I am trying to read some data from the plc. I am using the 'read' example provided.

When I inject, the node shows not connected. The debug mesage shows "TypeError: self.socket.connect is not a function".

Not sure where the issue is. Any advice on how to proceed?

 ![im1](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/0/5086485507f1dac11859fd03eb89b078e1af9bea.png)  
 ![im2](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/b/7bb8454215dae687ca4ca632ca079669571e063e.png)

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [24 January 2022 06:26 UTC](https://discourse.nodered.org/t/omronfins-omron-cs1g-typeerror-self-socket-connect-is-not-a-function/57126/2 "2022-01-24T06:26:47Z")

</div>

Hmmmm. Not seen that one before for this node. What versions of nodejs, node-red & node-red-contrib-omron-fins do you have installed?

---

<div class="post-metadata">

**Author:** ![dinesh](https://avatars.discourse-cdn.com/v4/letter/d/a8b319/32.png) [@dinesh](https://discourse.nodered.org/u/dinesh)\
**Post date:** [24 January 2022 06:51 UTC](https://discourse.nodered.org/t/omronfins-omron-cs1g-typeerror-self-socket-connect-is-not-a-function/57126/3 "2022-01-24T06:51:30Z")

</div>

Hi,

nodeRed-1.2.7  
node-red-contrib-omron-fins-0.5.0  
nodejs v10.23.1

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [24 January 2022 08:10 UTC](https://discourse.nodered.org/t/omronfins-omron-cs1g-typeerror-self-socket-connect-is-not-a-function/57126/4 "2022-01-24T08:10:17Z")

</div>

> [@dinesh](#):
>
> nodejs v10.23.1

Hi, so node v10 is EOL by some time now.

And this error is due to lack of the `connect` function on UDP socket in the `dgram` package in node 10.

You have 2 choices here...

1. Upgrade to NODE v14 LTS (or 16 LTS) - _ **recommended** _
2. Switch to TCP connection instead

THAT SAID...

You say you have V0.5.0 but yet there is no protocol selector on the fins config

> [@dinesh](#):
>
> ![im1](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/0/5086485507f1dac11859fd03eb89b078e1af9bea.png)

V0.5.0 should look like this...

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/6/16fbef295c62ecbd2d1932995ba6fd4654cf7c56.png)

Have you just updated the omron node? If so, have you restarted node-red and refreshed your browser?

---

<div class="post-metadata">

**Author:** ![dinesh](https://avatars.discourse-cdn.com/v4/letter/d/a8b319/32.png) [@dinesh](https://discourse.nodered.org/u/dinesh)\
**Post date:** [25 January 2022 00:34 UTC](https://discourse.nodered.org/t/omronfins-omron-cs1g-typeerror-self-socket-connect-is-not-a-function/57126/5 "2022-01-25T00:34:09Z")

</div>

Hi,  
the protocol selection is available but not visible in the earlier screeenshot  
 ![im5](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/d/edb203af725f7d6831d92593819fb669ccfd355d.png)

---

<div class="post-metadata">

**Author:** ![dinesh](https://avatars.discourse-cdn.com/v4/letter/d/a8b319/32.png) [@dinesh](https://discourse.nodered.org/u/dinesh)\
**Post date:** [25 January 2022 00:35 UTC](https://discourse.nodered.org/t/omronfins-omron-cs1g-typeerror-self-socket-connect-is-not-a-function/57126/6 "2022-01-25T00:35:21Z")

</div>

I tried to change the protocol to tcp. Initially connected.  
 ![im4](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/1/71a64a4d8216f20cdf6aaf21d3bd4378b1fcb0f9.png)

But once inject, Im getting the following error messages

 ![im3](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/d/cd71e0cacc7528061d06ad5c920c8885ea93e05c.png)

TypeError: buf.readUint32BE is not a function. and then it shows timout in on the node

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [25 January 2022 07:09 UTC](https://discourse.nodered.org/t/omronfins-omron-cs1g-typeerror-self-socket-connect-is-not-a-function/57126/7 "2022-01-25T07:09:55Z")

</div>

Most odd. Without investigating, I think an upgrade of node js might be necessary.

Is there a reason you are sticking with an "end of life" version of node?

---

<div class="post-metadata">

**Author:** ![dinesh](https://avatars.discourse-cdn.com/v4/letter/d/a8b319/32.png) [@dinesh](https://discourse.nodered.org/u/dinesh)\
**Post date:** [25 January 2022 08:00 UTC](https://discourse.nodered.org/t/omronfins-omron-cs1g-typeerror-self-socket-connect-is-not-a-function/57126/8 "2022-01-25T08:00:26Z")

</div>

Hi,

We are using a Siemens IOT2050 (gateway-(OS-linux debian)). Here the node red + nodejs are all preinstalled via an image file. Im using their latest image file version from support site.

I actually tried to upgrade the nodejs based on your suggestion but then the entire node red system does not work. I then had to reload the original image file to make it work again.

Im not sure what went wrong in the background of the device when I updated the nodejs version.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [25 January 2022 08:09 UTC](https://discourse.nodered.org/t/omronfins-omron-cs1g-typeerror-self-socket-connect-is-not-a-function/57126/9 "2022-01-25T08:09:12Z")

</div>

> [@dinesh](#):
>
> We are using a Siemens IOT2050

Ah, good old obsolescence in a box.

Must you use this device when £35 raspberry pi can do this job?

---

<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 January 2022 08:22 UTC](https://discourse.nodered.org/t/omronfins-omron-cs1g-typeerror-self-socket-connect-is-not-a-function/57126/10 "2022-01-25T08:22:39Z")

</div>

> [@dinesh](#):
>
> Im not sure what went wrong in the background of the device when I updated the nodejs version.

After upgrading nodejs did you go into your .node-red directory (or whatever is the equivalent on that device) and run `npm rebuild`

---

<div class="post-metadata">

**Author:** ![dinesh](https://avatars.discourse-cdn.com/v4/letter/d/a8b319/32.png) [@dinesh](https://discourse.nodered.org/u/dinesh)\
**Post date:** [26 January 2022 00:32 UTC](https://discourse.nodered.org/t/omronfins-omron-cs1g-typeerror-self-socket-connect-is-not-a-function/57126/11 "2022-01-26T00:32:19Z")

</div>

Hi,

No I did not try this. Can this work?

These were the following lines I ran to update nodejs:

npm cache clean -f  
npm install -g n  
sudo n stable

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [26 January 2022 06:54 UTC](https://discourse.nodered.org/t/omronfins-omron-cs1g-typeerror-self-socket-connect-is-not-a-function/57126/12 "2022-01-26T06:54:23Z")

</div>

> [@dinesh](#):
>
> npm install -g n

Why are you installing `n`?

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [26 January 2022 07:13 UTC](https://discourse.nodered.org/t/omronfins-omron-cs1g-typeerror-self-socket-connect-is-not-a-function/57126/13 "2022-01-26T07:13:41Z")

</div>

There is a post on the Siemens forum [here](https://support.industry.siemens.com/tf/ww/en/posts/iot-2050-instability-and-crashing/262695#pagetop)...

> Hello,
> 
> I hope it helps, but I had problems myself at the beginning and I was told that with the IOT2050 the existing Node-Red version is not overwritten. So then there are two Node-Red versions.
> 
> Then I found ascriptto update Node-Red. (Actually for the Raspberry Pi, but it works on my IOT2050 too)
> 
> The script deletes the pre-installed Node-Red version and updates Node.js and Node-Red Npm. (The build-essential package is a reference for all the packages needed to compile a Debian package. It generally includes the GCC/g++ compilers and libraries and some other utilities.)
> 
> I have add complete command with once  
> apt install build-essential git
> 
> `bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered)`
> 
> I install new nodes with "npm install" in the directory /home/root/.node-red
> 
> I hope your Node-Red runs more stable.
> 
> Best regards
> 
> Marc

It seems to suggest that the official node-red pi update script works on the iot2050

If you are willing to give it a go, I suggest trying to get it updated using the script plus ` --node14`

E.g.

`bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered) --node14`

---

<div class="post-metadata">

**Author:** ![dinesh](https://avatars.discourse-cdn.com/v4/letter/d/a8b319/32.png) [@dinesh](https://discourse.nodered.org/u/dinesh)\
**Post date:** [26 January 2022 07:51 UTC](https://discourse.nodered.org/t/omronfins-omron-cs1g-typeerror-self-socket-connect-is-not-a-function/57126/14 "2022-01-26T07:51:24Z")

</div>

this line of coding is very unfamiliar but let me try it.  
thanks

---

<div class="post-metadata">

**Author:** ![dinesh](https://avatars.discourse-cdn.com/v4/letter/d/a8b319/32.png) [@dinesh](https://discourse.nodered.org/u/dinesh)\
**Post date:** [2 March 2022 04:44 UTC](https://discourse.nodered.org/t/omronfins-omron-cs1g-typeerror-self-socket-connect-is-not-a-function/57126/15 "2022-03-02T04:44:35Z")

</div>

Hi,

Recently, Siemens has released the latest image file that contains NodeJs v12.22.5.

After upgrading, I'm able to read the data from the READ node.

Thank you

---

<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:** [16 March 2022 04:44 UTC](https://discourse.nodered.org/t/omronfins-omron-cs1g-typeerror-self-socket-connect-is-not-a-function/57126/16 "2022-03-16T04:44:38Z")

</div>

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