# Error in Function Node

**URL:** <https://discourse.nodered.org/t/error-in-function-node/34080>\
**Category:** General\
**Created:** [11 October 2020 04:57 UTC](https://discourse.nodered.org/t/error-in-function-node/34080 "2020-10-11T04:57:09Z")\
**Posts on this page:** 1\
**Showing post:** 6

<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:** [11 October 2020 08:47 UTC](https://discourse.nodered.org/t/error-in-function-node/34080/6 "2020-10-11T08:47:58Z")

</div>

Why are you trying to JSON.parse the incoming binary message ? I gave you the function yesterday - and you seem to have broken it... revert it to what I gave you.

> [@Converting Base 64 to Hexadecimal](https://discourse.nodered.org/t/converting-base-64-to-hexadecimal/34031/16):
>
> Here are the docs you need to help here is the first part var bytes = msg.payload; if (bytes[0]==01) { var temperature = (bytes[3] \<\< 8) + bytes[2]; var humidity= bytes[6]; return { payload: { temperature: temperature/10, humidity: humidity/2 } } } // else { // var power=bytes[2]; // return { // power: power // } // } return msg;

---

_[View the full topic](https://discourse.nodered.org/t/error-in-function-node/34080)._
