# Kv-read/write node doesn´t work

**URL:** <https://discourse.nodered.org/t/kv-read-write-node-doesn-t-work/7321>\
**Category:** General\
**Created:** [28 January 2019 05:42 UTC](https://discourse.nodered.org/t/kv-read-write-node-doesn-t-work/7321 "2019-01-28T05:42:48Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dane809](https://avatars.discourse-cdn.com/v4/letter/d/9de053/32.png) [@Dane809](https://discourse.nodered.org/u/Dane809)\
**Post date:** [28 January 2019 05:42 UTC](https://discourse.nodered.org/t/kv-read-write-node-doesn-t-work/7321/1 "2019-01-28T05:42:48Z")

</div>

Hey guys,

I want to write to the kv-write node. At the localhost (PC) I can read or write the values and everything works fine. At the IoT2040 nothing happens. I can´t read or write from/to the kv nodes. The node work as a key value database (JSON).  
I can also write to the "file in" node.  
Can someone help me?

Thanks a lot for your answer

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [28 January 2019 07:03 UTC](https://discourse.nodered.org/t/kv-read-write-node-doesn-t-work/7321/2 "2019-01-28T07:03:17Z")

</div>

I don't know what that node is but if you have a problem with a node (unless it is a core node), you will need to take it up with the author. Usually by raising an issue on GitHub.

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [28 January 2019 07:27 UTC](https://discourse.nodered.org/t/kv-read-write-node-doesn-t-work/7321/3 "2019-01-28T07:27:26Z")

</div>

If you have a problem with a contrib-node it is useful if you actually list the full name of the node.  
As there are often similar nodes it helps to know which one you are using.

---

<div class="post-metadata">

**Author:** ![Dane809](https://avatars.discourse-cdn.com/v4/letter/d/9de053/32.png) [@Dane809](https://discourse.nodered.org/u/Dane809)\
**Post date:** [28 January 2019 08:56 UTC](https://discourse.nodered.org/t/kv-read-write-node-doesn-t-work/7321/4 "2019-01-28T08:56:03Z")

</div>

Sorry guys. I use the following node.

> **[node-red-contrib-key-value-store](https://flows.nodered.org/node/node-red-contrib-key-value-store)**
>
> Simple, persistent, JSON-based key-value store for Node-RED

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [28 January 2019 09:08 UTC](https://discourse.nodered.org/t/kv-read-write-node-doesn-t-work/7321/5 "2019-01-28T09:08:41Z")

</div>

That node states in it's ReadMe that it requires nodejs v6.0.0+, what version of nodejs are you running on your device?

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [28 January 2019 09:09 UTC](https://discourse.nodered.org/t/kv-read-write-node-doesn-t-work/7321/6 "2019-01-28T09:09:10Z")

</div>

Given that node stores data in JSON format, why not just use global or flow variables with file persistence? That feature is now native to Node-RED so the store node probably not required now.

---

<div class="post-metadata">

**Author:** ![Dane809](https://avatars.discourse-cdn.com/v4/letter/d/9de053/32.png) [@Dane809](https://discourse.nodered.org/u/Dane809)\
**Post date:** [28 January 2019 11:28 UTC](https://discourse.nodered.org/t/kv-read-write-node-doesn-t-work/7321/7 "2019-01-28T11:28:52Z")

</div>

I know what you mean.

My UseCase:  
I have a machine with different error messages.  
The messages are different. So I made a flow wich can add the new entries in da key-value-database and increment them if they already exist.  
This solution is very flexibel.  
The flow work fine at my localhost, so I think the problem is the IoT.

---

<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 2019 11:49 UTC](https://discourse.nodered.org/t/kv-read-write-node-doesn-t-work/7321/8 "2019-01-28T11:49:59Z")

</div>

Just to clarify,

1. you have NR installed on some device - what is it? a Pi? a PC?
2. on that device, node-red-contrib-key-value-store works fine
3. you have another device - the IoT2040 - you want to access the data...correct?

Since the data is stored onthe device running NR, how do you plan on having the IoT2040 access it?

---

<div class="post-metadata">

**Author:** ![Dane809](https://avatars.discourse-cdn.com/v4/letter/d/9de053/32.png) [@Dane809](https://discourse.nodered.org/u/Dane809)\
**Post date:** [28 January 2019 12:31 UTC](https://discourse.nodered.org/t/kv-read-write-node-doesn-t-work/7321/9 "2019-01-28T12:31:45Z")

</div>

1. I have installed Node Red on PC (localhost) and on the IoT 2040.
2. On both the node-red-contrib-key-value-store were installed and only on localhost it works.
3. I got the data from a S7 and want to write the active marker to my key-value-store  
I can write the active marker to a .csv file but the key-value don´t work on the IoT

Thx for all the quick answers

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [28 January 2019 12:38 UTC](https://discourse.nodered.org/t/kv-read-write-node-doesn-t-work/7321/10 "2019-01-28T12:38:16Z")

</div>

So what version of nodejs have you installed on your IoT2040?

---

<div class="post-metadata">

**Author:** ![Dane809](https://avatars.discourse-cdn.com/v4/letter/d/9de053/32.png) [@Dane809](https://discourse.nodered.org/u/Dane809)\
**Post date:** [29 January 2019 17:00 UTC](https://discourse.nodered.org/t/kv-read-write-node-doesn-t-work/7321/11 "2019-01-29T17:00:35Z")

</div>

I updated the nodejs version and now everything works fine. Thanks for the hint 😉
