maxwellhadley / node-red-contrib-rfxcom

node-RED nodes to access an RFXtrx433 transceiver
BSD 2-Clause "Simplified" License
22 stars 13 forks source link

Is TEMP2 not working? #39

Closed Mastiffen closed 6 years ago

Mastiffen commented 6 years ago

I have just bought a bunch of Oregon THN132N, which are supported by the RFXtrx according to their page, and it's considered a TEMP2 sensor. I am not able to catch it, though. Is this not supported by this node?

maxwellhadley commented 6 years ago

This sensor should be supported, though I don't have on here to test. Do you have the Oregon protocol enabled for receive on the RFXtrx433E? If you use RFXMGR.EXE, do you receive messages?

Mastiffen commented 6 years ago

I was sort of afraid of that answer... It's a pain to get the sensor connected to a pc to check that and set the protocol if it isn't set (which I thought it was), but at least I know it should be supported, thanks!

maxwellhadley commented 6 years ago

You can check the enabled protocols using the scripts provided in the node-rfxcom package which is installed by node-red-contrib-rfxcom. Instructions here (which also documents the response codes discussed in your issue #40)

Mastiffen commented 6 years ago

I can't find the package. I must have installed globally, I guess. And I know very little about Linux. I tried to open the explorer window and search for RFXcom, but nothing. Can you perhaps tell me where I should look when it's not under Node-RED directory? Oh, and the link over doesn't work. I had to copy the test in the link, clicking int sendt me to a missing page.

maxwellhadley commented 6 years ago

I fixed the link. The package directory is called rfxcom (all lower case) and it will itself be in a directory called node_modules, the exact location of which depends on which version of nodejs & npm you are running. Try looking in the .node-red directory in the home directory of the user account that runs Node-RED, and chase down the stack of node_modules directories until you find the rabbit!

Mastiffen commented 6 years ago

Thanks, but that's where I looked. It's not there. It goes straight from request to rimraf (whatever that is).

maxwellhadley commented 6 years ago

Try:

find / -name rfxcom -type d -print

That will start at the filesystem root and print the full paths of all directories called 'rfxcom'. Ignore the 'permission denied' warnings.

Mastiffen commented 6 years ago

Thanks! Found it under .npm. But I got an error mesage from it...

`npm ERR! Please include the following file with any support request: npm ERR! /home/pi/.npm/rfxcom/1.0.3/npm-debug.log pi@raspberrypi:~/.npm/rfxcom/1.0.3 $ npm run find-rfxcom npm ERR! Linux 4.9.59-v7+ npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "run" "find-rfxcom" npm ERR! node v6.12.3 npm ERR! npm v3.10.10 npm ERR! path /home/pi/.npm/rfxcom/1.0.3/package.json npm ERR! code ENOENT npm ERR! errno -2 npm ERR! syscall open

npm ERR! enoent ENOENT: no such file or directory, open '/home/pi/.npm/rfxcom/1.0.3/package.json' npm ERR! enoent ENOENT: no such file or directory, open '/home/pi/.npm/rfxcom/1.0.3/package.json' npm ERR! enoent This is most likely not a problem with npm itself npm ERR! enoent and is related to npm not being able to find a file. npm ERR! enoent

npm ERR! Please include the following file with any support request: npm ERR! /home/pi/.npm/rfxcom/1.0.3/npm-debug.log `

maxwellhadley commented 6 years ago

You need to run the npm run find-rfxcom command from the directory containing the package information file package.json. You are currently running from the directory npm uses internally to keep track of the different versions of rfxcom it has installed, not the actual package directory (npm can be confusing). The find command should have found another rfxcom directory that isn't under /home/pi/.npm

Mastiffen commented 6 years ago

Aha! Sorry... Yeah, I'm dumb. ;) you were of course completely right. About the protocol not being set too. And I found it in the directory /home/pi/.node-red/node_modules/node-red-contrib-rfxcom

But I do not seem to get the syntax right. This is what I tried to use:

npm run set-protocols --enable OREGON --save /dev/ttyUSB0

That gave me set-protocols: Invalid use of switch 'OREGON'

maxwellhadley commented 6 years ago

Nearly right! It should be:

npm run set-protocols -- --enable OREGON --save /dev/ttyUSB0

You need the extra -- to tell npm that the following switches should be passed to the set-protocol script, not to the run command

Mastiffen commented 6 years ago

Like I said... Dumb. I thought that was a typo... But now I got that working, and the Oregon thermometers came up at once. Thanks for your patience!

maxwellhadley commented 6 years ago

No problems - it's great to see my software being used!