Log is seen as an Error

Hello ,
I have this code and Error and I need to make this proiect done by today.
I have a Temp sensor on arduino how is connect with raspberry pi 4 and node red

Thx

log is not a built-in function.

As it looks like you are trying to do a logarithm, then you want to use Math.log() - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/log

Hi ,

When I do that the console says “function tried to send a message of type number “

That is because you are returning just a Number and not a valid message object.

Instead of return temp, you should do:

msg.payload = temp;
return msg;

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