# Kalman filter not working

**URL:** <https://discourse.nodered.org/t/kalman-filter-not-working/13468>\
**Category:** General\
**Created:** [19 July 2019 06:26 UTC](https://discourse.nodered.org/t/kalman-filter-not-working/13468 "2019-07-19T06:26:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![innotractor](https://avatars.discourse-cdn.com/v4/letter/i/90db22/32.png) [@innotractor](https://discourse.nodered.org/u/innotractor)\
**Post date:** [19 July 2019 06:26 UTC](https://discourse.nodered.org/t/kalman-filter-not-working/13468/1 "2019-07-19T06:26:22Z")

</div>

Hi,

The designer is not responding, perhaps somebody has the same experience as I.  
I am interested in applying the kalman filter to process RSSI values in general.

Before coding, I just made the most simple configuration but I am receiving failure:

"TypeError: KalmanFilter is not a constructor"

I installed the filter from:

> **[node-red-contrib-kalman](https://flows.nodered.org/node/node-red-contrib-kalman)**
>
> node-red-contrib-kalman ========================

cd ~/,node-red npm install node-red-contrib-kalman

My test config:

[{"id":"617e9a45.0803f4","type":"tab","label":"Flow 3","disabled":false,"info":""},{"id":"f6568dd0.cad2f","type":"inject","z":"617e9a45.0803f4","name":"","topic":"3","payload":"","payloadType":"date","repeat":"10","crontab":"","once":false,"onceDelay":0.1,"x":440,"y":340,"wires":[["b9f0162f.9b0f88"]]},{"id":"b9f0162f.9b0f88","type":"kalman-filter","z":"617e9a45.0803f4","r":0.01,"q":3,"x":600,"y":340,"wires":[["b0bc90a2.cfce"]]},{"id":"b0bc90a2.cfce","type":"debug","z":"617e9a45.0803f4","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":800,"y":340,"wires":}]

---

<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:** [19 July 2019 06:27 UTC](https://discourse.nodered.org/t/kalman-filter-not-working/13468/2 "2019-07-19T06:27:08Z")

</div>

Unfortunately your flow isn't currently importable.Please read the following post [How to share code or flow json](https://discourse.nodered.org/t/how-to-share-code-or-flow-json/506) and then edit the above message.

---

<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:** [19 July 2019 06:34 UTC](https://discourse.nodered.org/t/kalman-filter-not-working/13468/3 "2019-07-19T06:34:41Z")

</div>

You could also try opening an issue on the nodes github page, but it doesn’t look as if the node has been updated in several years.

---

<div class="post-metadata">

**Author:** ![innotractor](https://avatars.discourse-cdn.com/v4/letter/i/90db22/32.png) [@innotractor](https://discourse.nodered.org/u/innotractor)\
**Post date:** [19 July 2019 08:38 UTC](https://discourse.nodered.org/t/kalman-filter-not-working/13468/4 "2019-07-19T08:38:35Z")

</div>

Thanks, the code is indeed 2 years old.

Point is that the Kalman filter is quite a topic, somebody must have a working implementation.  
Of course I could try to create a constructor...

---

<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:** [19 July 2019 08:50 UTC](https://discourse.nodered.org/t/kalman-filter-not-working/13468/5 "2019-07-19T08:50:32Z")

</div>

It looks like a matter of updating `package.json` with the correct dependency and node version requirements.

eg. fork the repository, clone it locally into the node-red/node\_modules directory, cd to the module, update package.json, cd back to the node-red directory, perform `npm install <repo>`
