# SNMP node new version outputs buffer, old version outputs string

**URL:** https://discourse.nodered.org/t/snmp-node-new-version-outputs-buffer-old-version-outputs-string/94950
**Category:** General
**Created:** [28 January 2025 05:00 UTC](https://discourse.nodered.org/t/snmp-node-new-version-outputs-buffer-old-version-outputs-string/94950 "2025-01-28T05:00:25Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![Rgrove](https://avatars.discourse-cdn.com/v4/letter/r/5f8ce5/32.png) [@Rgrove](https://discourse.nodered.org/u/Rgrove)
#### Post date: [28 January 2025 05:00 UTC](https://discourse.nodered.org/t/snmp-node-new-version-outputs-buffer-old-version-outputs-string/94950/1 "2025-01-28T05:00:25Z")

</div>

I'm trying to offload some SNMP calls to a new install, and the SNMP flows on the new install are all completely broken.  
The flows are direct copy/paste from old machine to new one.

New SNMP node version is 2.0.0  
Old version with all the flows is 0.0.25, installed in 2022 or 2023.

Old version returns this:

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

Current version returns this:

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

Is there a config setting I'm missing on the new one that maybe I forgot I'd made on the old one?  
If not, is there a way to copy the old version of the node and install it on the new system?

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [28 January 2025 10:58 UTC](https://discourse.nodered.org/t/snmp-node-new-version-outputs-buffer-old-version-outputs-string/94950/2 "2025-01-28T10:58:04Z")

</div>

Go read the notes about the node

> **[node-red-node-snmp](https://flows.nodered.org/node/node-red-node-snmp)**
>
> A Node-RED node that gets and sets SNMP oid values. Supports v1, v2c and v3

---

<div class="post-metadata">

### Author: ![Rgrove](https://avatars.discourse-cdn.com/v4/letter/r/5f8ce5/32.png) [@Rgrove](https://discourse.nodered.org/u/Rgrove)
#### Post date: [28 January 2025 14:35 UTC](https://discourse.nodered.org/t/snmp-node-new-version-outputs-buffer-old-version-outputs-string/94950/3 "2025-01-28T14:35:39Z")

</div>

That sucks for me...is there a way to save and reinstall the old version of a node? I probably have hundreds of flows with the old one, and will take a long time to figure out and implement a conversion. If my central system fails before then, and I import the flow backup to a rebuild, my stuff will grind to a halt.

Also, I thought I'd read the documentation...I didn't realize there was a more thorough library here. Thanks.

---

<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: [28 January 2025 15:46 UTC](https://discourse.nodered.org/t/snmp-node-new-version-outputs-buffer-old-version-outputs-string/94950/4 "2025-01-28T15:46:26Z")

</div>

You can install an old version by going to your .node-red folder and running  
`npm install node-red-node-snmp@a.b.c`  
where `a.b.c` is the version you want, obviously. Then restart node-red and remember not to update it again at some point in the future.

---

<div class="post-metadata">

### Author: ![Rgrove](https://avatars.discourse-cdn.com/v4/letter/r/5f8ce5/32.png) [@Rgrove](https://discourse.nodered.org/u/Rgrove)
#### Post date: [28 January 2025 18:38 UTC](https://discourse.nodered.org/t/snmp-node-new-version-outputs-buffer-old-version-outputs-string/94950/5 "2025-01-28T18:38:54Z")

</div>

Awesome, thank you.

---

<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: [28 January 2025 19:00 UTC](https://discourse.nodered.org/t/snmp-node-new-version-outputs-buffer-old-version-outputs-string/94950/6 "2025-01-28T19:00:58Z")

</div>

The reason for the change was that the underlying library returns an object that isn't a normal object so when I was trying to be helpful and sending a string - it wan't always successful and caused other problems for users so we changed it to just send the raw object so users could do what they wanted with it. In your case you can probably just `.toString()` the value property to convert it to a string.  
Though indeed as Colin said you can re-install the old with something like `npm i node-red-node-snmp@0.*` which would get the last version 0 before we changed it over.

---

<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: [28 January 2025 21:40 UTC](https://discourse.nodered.org/t/snmp-node-new-version-outputs-buffer-old-version-outputs-string/94950/7 "2025-01-28T21:40:31Z")

</div>

> [@dceejay](#):
>
> you can re-install the old with something like `npm i node-red-node-snmp@0.*` which would get the last version 0 before we changed it over.

Does not @Rgrove want the latest 1.x?

---

<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: [28 January 2025 21:41 UTC](https://discourse.nodered.org/t/snmp-node-new-version-outputs-buffer-old-version-outputs-string/94950/8 "2025-01-28T21:41:51Z")

</div>

Well he said originally he was using 0.0.25

---

<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: [28 January 2025 21:55 UTC](https://discourse.nodered.org/t/snmp-node-new-version-outputs-buffer-old-version-outputs-string/94950/9 "2025-01-28T21:55:30Z")

</div>

That's true.

---

<div class="post-metadata">

### Author: ![Rgrove](https://avatars.discourse-cdn.com/v4/letter/r/5f8ce5/32.png) [@Rgrove](https://discourse.nodered.org/u/Rgrove)
#### Post date: [29 January 2025 03:10 UTC](https://discourse.nodered.org/t/snmp-node-new-version-outputs-buffer-old-version-outputs-string/94950/10 "2025-01-29T03:10:13Z")

</div>

The old version was simpler form my perspective, but I see the rationale in making it consistent with it's packaged nodes, and outputting raw data.

I'll re-use the old version until I can update the flows with a way to string the output.

---

<div class="post-metadata">

### Author: ![Rgrove](https://avatars.discourse-cdn.com/v4/letter/r/5f8ce5/32.png) [@Rgrove](https://discourse.nodered.org/u/Rgrove)
#### Post date: [29 January 2025 04:52 UTC](https://discourse.nodered.org/t/snmp-node-new-version-outputs-buffer-old-version-outputs-string/94950/11 "2025-01-29T04:52:05Z")

</div>

In case anyone runs across this in the future (or I forget what I did), the suggestion for .toString() got me in the right direction.

The text below, used in a function node, converted the buffer data to string for me.

```auto
var pl = msg.payload;

for (var i = 0; i < pl.length; i++) {
    var pli = msg.payload[i].value;  
    var converted = pli.toString();
    msg.payload[i].value = converted;
}

return msg;

```

---

<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: [29 January 2025 13:56 UTC](https://discourse.nodered.org/t/snmp-node-new-version-outputs-buffer-old-version-outputs-string/94950/12 "2025-01-29T13:56:36Z")

</div>

In case you are interested you should be able to replace that with this more concise code

```auto
msg.payload.forEach((element) => {
    element.value = element.value.toString()
})
return msg;

```

---

<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: [12 February 2025 13:56 UTC](https://discourse.nodered.org/t/snmp-node-new-version-outputs-buffer-old-version-outputs-string/94950/13 "2025-02-12T13:56:36Z")

</div>

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