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.
Hey @NorCalLights. Very sorry to hear about your job situation.
I’m wondering if it’s the newer Debian version. I may try upgrading mine when I get some time and see if I can reproduce it or at least eliminate that as a possibility.
The SmartThings Hub v1 would not affect it. That error has to do with connecting to Sense. Besides that, I also have a v1 hub that I’ve used successfully.
There definitely should be a way to get this working. I’m still just not quite sure what that is.
Hey @brbeaird thanks for looking into it for me. If it’s just an issue with Debian 10, I can try installing an earlier version of Raspbian based on Debian 9 and see if that solves it!
@brbeaird Hey that worked!!! I loaded a version of Raspbian based on Debian 9 and everything worked great. It might be worth adding a note to the Readme that it won’t work with Debian 10.
Sweet!! That’s so awesome. I’ve added a note to the top of the README. Glad you confirmed it and got things working. Hopefully you have some fun with it.
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)
Me too. For some reason, it does not enumerate the devices. However when I go to smartapp section on smartthings app, I can see those devices there. No sure why the aren’t populated in my devices tab.
That error indicates you’re missing one of the device type handlers, in particular - the Sense Energy Device handler. Can you check your IDE and make sure it’s there and published?
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.
I’ll try this. I’m running on new pi with latest stable raspian and node. Connection works fine between all systems… but Pi hangs after 15-20 minutes (consistently). Any ideas?
The Pi itself hangs or node? If it is the Pi it is usually something with the sdcard. If it is the process I would check the logs (pm2 logs) to see if there is an issue or segfault.