# Bufferparser with U64 Modbus

**URL:** https://discourse.nodered.org/t/bufferparser-with-u64-modbus/37071
**Category:** General
**Created:** [6 December 2020 09:11 UTC](https://discourse.nodered.org/t/bufferparser-with-u64-modbus/37071 "2020-12-06T09:11:02Z")
**Posts on this page:** 20
**Page:** 2

<div class="post-metadata">

### Author: ![UnborN](https://avatars.discourse-cdn.com/v4/letter/u/4491bb/32.png) [@UnborN](https://discourse.nodered.org/u/UnborN)
#### Post date: [6 December 2020 19:53 UTC](https://discourse.nodered.org/t/bufferparser-with-u64-modbus/37071/21 "2020-12-06T19:53:45Z")

</div>

> [@Steve-Mcl](#):
>
> Not sure what you mean

I mean maybe there is a difference between defining/using a bigint as a variable and converting it from buffer  
I dunno internally what you use in Buffer-parser but if its the buf.readBigInt that was introduced in node v10.20 and Becker is using

> [@Becker](#):
>
> v10.16.3

---

<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: [6 December 2020 20:03 UTC](https://discourse.nodered.org/t/bufferparser-with-u64-modbus/37071/22 "2020-12-06T20:03:01Z")

</div>

Ah - ok, i see where you are going with that (I missed the small print Added in: v10.20.0).

so yes, it is that. And is confirmed by the caught message...

`TypeError: Cannot read property 'bind' of undefined\n at dataGetter (/home/pi/.node-red/node_modules/node-red-contrib-buffer-parser/buffer-parser.js:373:49) `

```auto
var fn = buffer[bufferFunction].bind(buffer);

```

^ this attempts to bind the selected function (in this case `readBigInt64BE`). I will look to update the node to better report the issue but the only solution for BigInt is to update node.js to a newer version.

so, @Becker - it looks like you need to update node.js

* * *

NOTE: I do suspect the the value is less than 32bit MAX so you could likely just grab the 32bits...

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/b/fbd0ecccb3edd1118d0cc515d470ed6cd8f7d25c.png)

but as node 10 is EOL in 4 months - might be a good time to jump to node 12 or better still node 14.

---

<div class="post-metadata">

### Author: ![UnborN](https://avatars.discourse-cdn.com/v4/letter/u/4491bb/32.png) [@UnborN](https://discourse.nodered.org/u/UnborN)
#### Post date: [6 December 2020 20:07 UTC](https://discourse.nodered.org/t/bufferparser-with-u64-modbus/37071/23 "2020-12-06T20:07:55Z")

</div>

running the script should update your node version :

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

```

### [Installing and Upgrading Node-RED](https://nodered.org/docs/getting-started/raspberrypi)

---

<div class="post-metadata">

### Author: ![Becker](https://avatars.discourse-cdn.com/v4/letter/b/c77e96/32.png) [@Becker](https://discourse.nodered.org/u/Becker)
#### Post date: [7 December 2020 06:43 UTC](https://discourse.nodered.org/t/bufferparser-with-u64-modbus/37071/24 "2020-12-07T06:43:30Z")

</div>

I did, but it doesn´t update:

 ![grafik](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/0/e0cf29ad3b19477a1711471c83810e0e0a13d7e7.png)

==\> v10.16.3

---

<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: [7 December 2020 07:16 UTC](https://discourse.nodered.org/t/bufferparser-with-u64-modbus/37071/25 "2020-12-07T07:16:31Z")

</div>

I don't think the script updates from V10 (only \< 10).

If you were to uninstall node& npm manually and run it again, it will work.

---

<div class="post-metadata">

### Author: ![Becker](https://avatars.discourse-cdn.com/v4/letter/b/c77e96/32.png) [@Becker](https://discourse.nodered.org/u/Becker)
#### Post date: [7 December 2020 07:21 UTC](https://discourse.nodered.org/t/bufferparser-with-u64-modbus/37071/26 "2020-12-07T07:21:10Z")

</div>

but then the "NibePi" will be destroyed maybe 🙄  
I got an image: [https://github.com/anerdins/node-red-contrib-nibepi/](https://github.com/anerdins/node-red-contrib-nibepi/)  
"nibepi\_1.1\_clean.rar" with integrated Node RED, what I've built everything on!

I´ve no idea to make a clean basic installation with NibePi.

My wish would be to install the latest Raspbian, then install the latest NR and install NibePi in the NR myself. I have to speak to the developer of NibePi...

---

<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: [7 December 2020 07:38 UTC](https://discourse.nodered.org/t/bufferparser-with-u64-modbus/37071/27 "2020-12-07T07:38:21Z")

</div>

For a clean install, first backup your flows, update os, install node-red via the script, install nibepi like you would any other node, import your flows.

If you have a spare SD CARD, use that - it might save you if you forget something.

---

<div class="post-metadata">

### Author: ![Becker](https://avatars.discourse-cdn.com/v4/letter/b/c77e96/32.png) [@Becker](https://discourse.nodered.org/u/Becker)
#### Post date: [7 December 2020 07:42 UTC](https://discourse.nodered.org/t/bufferparser-with-u64-modbus/37071/28 "2020-12-07T07:42:49Z")

</div>

NibePi is not just a flow, it is "deeper". It simulates a Modbus Gateway over RS485 ([https://www.nibe.eu/assets/documents/24801/031725-10.pdf](https://www.nibe.eu/assets/documents/24801/031725-10.pdf)) - i have no idea to "save" and reinstall.

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [7 December 2020 07:55 UTC](https://discourse.nodered.org/t/bufferparser-with-u64-modbus/37071/29 "2020-12-07T07:55:50Z")

</div>

Yes, I agree. It would be safer to talk to the manufacturer of this device and let them issue a new image. In the meantime maybe do as Steve suggested earlier and do 2 32bit reads.

---

<div class="post-metadata">

### Author: ![UnborN](https://avatars.discourse-cdn.com/v4/letter/u/4491bb/32.png) [@UnborN](https://discourse.nodered.org/u/UnborN)
#### Post date: [7 December 2020 16:13 UTC](https://discourse.nodered.org/t/bufferparser-with-u64-modbus/37071/30 "2020-12-07T16:13:27Z")

</div>

Hi all,

I was reading about this node version update/downgrade manager program called `n`.  
would it be safe if Becker installed `n`, update to the minor node 10.20 version and test if bigInts work.  
With `n` he'll have the option to revert back to older version in case something breaks with NibePi?!

Command to Intall `n` globally  
`sudo npm install -g n`

Install node version 10.20 using `n`  
`sudo n 10.20.0`

Check node version  
`node -v`

Option to choose different node red version that was installed  
`n`

> **[How to Update Node to Any Version Using Npm - Codeforgeek](https://codeforgeek.com/update-node-using-npm/)**
>
> Node.js is very active in the development and you may receive news about the new release almost every month. There are times when we actually need to maintain multiple version of Node with the flexibility to switch between versions without going...

Has anyone used it ? .. any implications with installation paths etc ?

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [7 December 2020 17:49 UTC](https://discourse.nodered.org/t/bufferparser-with-u64-modbus/37071/31 "2020-12-07T17:49:12Z")

</div>

Well - certainly something to try on a device you don't care about - but this is a dedicated piece of hardware that has been customised with modbus extras - so the chances are just blasting it with a new version may not pick up any customisations to the hardware that may be required to make it work. It may work - but may not... depends how sure you are about restoring it back if it all goes wrong.  
(Plus we don't really support using n with our install script so you have to install Node-RED manually on top - not hard but... not as easy as the script.)

---

<div class="post-metadata">

### Author: ![Becker](https://avatars.discourse-cdn.com/v4/letter/b/c77e96/32.png) [@Becker](https://discourse.nodered.org/u/Becker)
#### Post date: [7 December 2020 18:05 UTC](https://discourse.nodered.org/t/bufferparser-with-u64-modbus/37071/32 "2020-12-07T18:05:02Z")

</div>

I asked the inventor of NibePi, if he would create a manual to install the "NibePi components" for a fresh new installation on Raspian Buster with Node RED.  
If he´ll not, I will live with U32. It is just too unimportant to tinker around here on myself / to steal your time.

---

<div class="post-metadata">

### Author: ![Becker](https://avatars.discourse-cdn.com/v4/letter/b/c77e96/32.png) [@Becker](https://discourse.nodered.org/u/Becker)
#### Post date: [8 December 2020 07:22 UTC](https://discourse.nodered.org/t/bufferparser-with-u64-modbus/37071/33 "2020-12-08T07:22:23Z")

</div>

the inventor wrote me:

> You can install a fresh raspian.  
> In your nodered folder just type "npm install --save anerdins/node-red-contrib-nibepi#master" that Will give you The nodes

Can it be so easy ? Maybe one of you has a virtual machine and could try 🙈

---

<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: [8 December 2020 07:27 UTC](https://discourse.nodered.org/t/bufferparser-with-u64-modbus/37071/34 "2020-12-08T07:27:10Z")

</div>

That is a fairly normal process. The only difference to my previous suggestion is the author has said to install his nodes from git instead of the palette.

If you can, make a full backup or use other SD then give it a go.

---

<div class="post-metadata">

### Author: ![Becker](https://avatars.discourse-cdn.com/v4/letter/b/c77e96/32.png) [@Becker](https://discourse.nodered.org/u/Becker)
#### Post date: [8 December 2020 11:40 UTC](https://discourse.nodered.org/t/bufferparser-with-u64-modbus/37071/35 "2020-12-08T11:40:08Z")

</div>

Do I get the newst NR-Version after clean Install with:

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

```

?

---

<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: [8 December 2020 12:15 UTC](https://discourse.nodered.org/t/bufferparser-with-u64-modbus/37071/36 "2020-12-08T12:15:08Z")

</div>

That looks correct.  
Also, dont run this as root.

Lastly (from the docs) you might need to do this first...

> You may need to run `sudo apt install build-essential git` first to ensure npm is able to build any binary modules it needs to install.

---

<div class="post-metadata">

### Author: ![Becker](https://avatars.discourse-cdn.com/v4/letter/b/c77e96/32.png) [@Becker](https://discourse.nodered.org/u/Becker)
#### Post date: [8 December 2020 16:24 UTC](https://discourse.nodered.org/t/bufferparser-with-u64-modbus/37071/37 "2020-12-08T16:24:48Z")

</div>

damn, doesn´t work

looks good

 ![grafik](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/c/cc587d22d8b2bf0da97f175986dba256e98b49ba.jpeg)  
 ![grafik](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/8/c86851ed8a42c75457a5484275107080578bb4a6.jpeg)

no config & no nibe nodes:

 ![grafik](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/1/313148d5955c902982a21125baa129aebbd6a506.jpeg)

no idea to create such

---

<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: [8 December 2020 16:31 UTC](https://discourse.nodered.org/t/bufferparser-with-u64-modbus/37071/38 "2020-12-08T16:31:24Z")

</div>

> [@Becker](#):
>
> no config & no nibe nodes:

Did you install from `~/.node-red`? from the bit can make out, it looks like you may NOT have been inside the .node-red folder at some point. Look here...  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/6/86d0f764c1970fce7057e3c3b61e17d3da6b8e3b.png)  
^ suggests you were not in .node-red folder when you installed that node

Also, I cant see everything i need to from that screen shot.  
Would be better if you copy the log to a reply

`````  
`paste log`  
`````

Does this help...

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

---

<div class="post-metadata">

### Author: ![Becker](https://avatars.discourse-cdn.com/v4/letter/b/c77e96/32.png) [@Becker](https://discourse.nodered.org/u/Becker)
#### Post date: [8 December 2020 16:50 UTC](https://discourse.nodered.org/t/bufferparser-with-u64-modbus/37071/39 "2020-12-08T16:50:20Z")

</div>

Nope, just from console. 😱  
new try

---

<div class="post-metadata">

### Author: ![Becker](https://avatars.discourse-cdn.com/v4/letter/b/c77e96/32.png) [@Becker](https://discourse.nodered.org/u/Becker)
#### Post date: [9 December 2020 09:40 UTC](https://discourse.nodered.org/t/bufferparser-with-u64-modbus/37071/40 "2020-12-09T09:40:23Z")

</div>

I reinstalled the old image and imported my flows... 5h for nothing.

Now the courses leave blank. I'll go crazy.  
Any idea?  
I see the data comes into the course node, but the dashboard stays empty.

[Previous page](https://discourse.nodered.org/t/bufferparser-with-u64-modbus/37071.md?page=1)

[Next page](https://discourse.nodered.org/t/bufferparser-with-u64-modbus/37071.md?page=3)
