Debian is 10.3 (default with the current version of Raspian)
npm is still reporting that it isn’t compatible with Node v10… which is weird… updated that too.
Node is 10.15.2 (so below the version threshold suggested by @Andrew_St_Laurent1)
I’ve checked a hundred times that my clock is set right on my Pi.
Edited to add: I wonder if this is an issue because I’m running a v1 Smartthings Hub? In my reading, this SSL error is an issue with clients running OpenSSL 1.1.1 connecting to servers running older versions.
Seeing some errors in the log on the node server. Any ideas?
10/30/2020, 6:45:14 AM | Refreshing monitor data, monitor data, and missed events…
(node:4830) UnhandledPromiseRejectionWarning: ReferenceError: log is not defined
at periodicRefresh (/Users/Server/Downloads/SmartThings_SenseMonitor-master/node_server/server.js:222:9)
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:4830) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 76)
10/30/2020, 6:45:44 AM | Sense WebSocket Closed | Reason: Normal
ERROR: Unable to connect to SmartThings Hub: Error: connect ETIMEDOUT 10.0.1.250:39500
^C10/30/2020, 6:46:04 AM | gracefulStop:
10/30/2020, 6:46:04 AM | gracefulStopNoMsg:
graceful setting timeout for PID: 4830
Could not close connections in time, forcefully shutting down
Right I usually don’t use the Sense App either but I notice that I wasn’t getting the notifications whenever my hvac turned on anymore, so I checked the app today just to find that error message. Maybe Sense is having some issues?
I was definitely seeing a ton of errors yesterday, but they seem to have resolved. Looks like something on the Sense side. This code could for sure use some better error handling. I’ll add that at some point - most of my development here is just on hold until the new changes are a bit more firm.
Have followed all the steps, but get this error in my log, and no devices get setup after configuration. The only device that shows up is the Sense Monitor itself, none of the other devices that sense has identified.
db1b596a-1b35-4e8d-b6fb-b7f9870fea53 3:35:28 PM: error AddDevice Error! physicalgraph.app.exception.UnknownDeviceTypeException: Device type ‘Sense Energy Device’ in namespace ‘brbeaird’ not found. @line 416 (doCall)
Digging up an old one here but I’ve found that upgrading to a 12.x or higher version of node adds the use of the --tls-min-v1.0 argument and allows it to communicate. Seems like the Sense monitor or hub isn’t TLS 1.2 and the combination of openssl 1.1.1 and node versions higher than 10.19 will default to that security level.
I’m running Ubuntu 20.04 LTS on a RPi just for the sense monitor, here are the basic steps. They can be run as a regular user with sudo most of the time but if it is dedicated to the monitor you can jump to root if you like.
I installed the Node Version Manager so I could run some tests on different versions, it isn’t necessary but it is easy:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | sudo bash
With that installed you can run nvm list-remote to show you what is out there and then install the latest version you like. I went with the current Node LTS:
sudo nvm install v14.16.0
Ran a quick verification in /SmartThings_senseMonitor/node_server:
sudo node --tls-min-v1.0 server.js
Fire tables started going crazy with devices (even though I have it turned off…) so then I added the option for pm2 to start and monitor:
sudo pm2 start server.js --node-args="–tls-min-v1.0"
That could probably be v1.1 but I don’t really care that much about internal only api access.
Hope that helps others who want to go beyond an ancient Debian install.