Wrong output voltage with nodejs library on relay

grovepi
pending
fw127

#1

Raspberry Pi 3 / GrovePi+ 1.2.7

When using the relay (version 1.2) with the python script in /home/pi/Dexter/GrovePi/Software/Python/
i get 5.1v from sig to gnd when the relay is on (works), but using the SPDTRelay from the nodejs library i only get 2.95v when using the .on() method (not enough to trigger the switch).

Weird thing is, that after i switch the relay with the python script one time and use the nodejs library later to do the same the voltage is 5.1v regardless of library used. When restarting the GrovePi, i get 2.95v when using only the nodejs library again.


#3

Hi @pusteblume,

That’s super odd.

I’ll bring up a logic analyzer and compare the differences between the Python and NodeJS library. There should be a difference between what they communicate, otherwise, it wouldn’t make any sense.

Thanks for reporting this!


#4

Did you find anything? I am trying to add that relay to an mqtt endpoint and just cannot get it to work with the nodejs library.
I suck at python, but if you need help with some JavaScript debugging i can help.


#5

Hi @pusteblume,

Ahh … thanks for reminding me this. There are so many things on my plate during this time.

I’ll try to have a look at it and be back with an answer.

Thank you!