@redloro - Thank you SO much for helping me work through this! That worked!! I will continue with the rest of the install and let you know how it goes.
Does this install require python be installed?
@redloro - Thank you SO much for helping me work through this! That worked!! I will continue with the rest of the install and let you know how it goes.
Does this install require python be installed?
Nopeā¦ all you need to install is NodeJS, setup/configure SmartThings Node Proxy and go!
No, unfortunately the refresh icon doesnāt do anything when you tap it. I thought that @tcjennings may have been on to something when he recommended that I check the notify ip address in the config.json file, but the ip address is correct for my hub. The restart.me file does not seem to work either. I created a service file to start both server.js and app.js at boot. That works, but when I run the restart.me file, i get the following error within the log file:
When I kill the server.js process and restart it using sudo node server.js, it starts up fine and I get the following:
sudo node server.js
SmartThings Node Proxy listening at http://:::8080
Doing something interesting during initā¦
Loaded plugin: generic
Loaded plugin: mpr-sg6z
Connected to MPR6Z: /dev/ttyUSB0
Detected serial ports: ["/dev/ttyAMA0","/dev/ttyUSB0"]
::ffff:192.168.11.1 GET /plugins/mpr-sg6z/zones/12/source/4
::ffff:192.168.11.1 GET /plugins/mpr-sg6z/zones/12/source/4
::ffff:192.168.11.1 GET /plugins/mpr-sg6z/zones/12/source/2
::ffff:192.168.11.1 GET /plugins/mpr-sg6z/zones/12/source/1
::ffff:192.168.11.1 GET /plugins/mpr-sg6z/zones/12/source/4
::ffff:192.168.11.1 GET /plugins/mpr-sg6z/zones/12/source/5
::ffff:192.168.11.1 GET /plugins/mpr-sg6z/zones/12/source/3
::ffff:192.168.11.1 GET /plugins/mpr-sg6z/zones/12/source/3
::ffff:192.168.11.1 GET /plugins/mpr-sg6z/zones/12/source/5
::ffff:192.168.11.1 GET /plugins/mpr-sg6z/zones/12/source/2
Another odd thing is that if I reboot my Raspberry Pi, which is running node, and reopen the SmartThings app, the current status of the selected zone will update on the app. After the initial update, when I change the zone settings, even though they do change on the controller, they are not reflected in the app.
Any ideas on how to troubleshoot this issue? Is there any way to log the notify command attempts so that I can ensure that they are being sent to the correct IP address? Thanks.
Thanks for the tip! Unfortunately, i checked and the ip address is correct in the config.json file.
Also, is there a plugin that has to be loaded for the notify process to work? I read the instructions again, and this section mentions that the notify process is controlled by a plugin. Currently, I only have the generic and mpr-sg6z plugins loaded.
The only other thing that is different with my installation is that I chose not to put the files in my user folder, and installed everything to /opt/local instead, if that matters?
Callback / Notifications
A plugin can post data to the SmartThings Hub asynchronously via an HTTP NOTIFY. The notify() method is exposed to a plugin by the SmartThings Node Proxy, to be used for this purpose. The plugin can call the notify() method to post data back to the SmartThings Hub whenever an update or change of state is required. It is the responsibility of the corresponding SmartThings app/device to process the notification.
@jsn0327 the plugin is the mpr-sg6zā¦ you can delete the generic.js plugin.
Forget about restart.me as all it does is fire off forever and if you donāt have that configured right, it wonāt run. You can start the service by just running node server.js
Why are you running app.js??
First update your server.js and the mpr-sg6z.js plugin from GitHubā¦ Iāve made some updates to help with logging, etc. When youāve updated these two files, add the following line to server.js at line #120:
logger("Notify: "+data);
This will now output to the console each notification message that the service is sending to SmartThings and should help troubleshoot the issue.
@redloro I was able to gete npm install to run but now when I try to start the service I get this error:
C:\SmartThings Russound\smartthings-master\smartthings-nodeproxy>node server.js
[2016-11-30T06:56:22.969Z] [stnp] SmartThings Node Proxy listening at http://:::
9090
DEPRECATION: Please use require('serialport')
instead of require('serialport' ).SerialPort
C:\SmartThings Russound\smartthings-master\smartthings-nodeproxy\node_modules\se
rialport\lib\serialport.js:79
throw new TypeError(āopenImmediately
is now called autoOpen
and is a pro
perty of optionsā);
^
TypeError: openImmediately
is now called autoOpen
and is a property of optio
ns
at new SerialPort (C:\SmartThings Russound\smartthings-master\smartthings-no
deproxy\node_modules\serialport\lib\serialport.js:79:11)
at Rnet.init (C:\SmartThings Russound\smartthings-master\smartthings-nodepro
xy\plugins\rnet.js:153:14)
at Object. (C:\SmartThings Russound\smartthings-master\smartthing
s-nodeproxy\plugins\rnet.js:131:6)
at Module._compile (module.js:570:32)
at Object.Module._extensionsā¦js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
Thanks, Iāll give that a shot. I run app.js in order to allow my Raspberry Pi to act as a serial server and interface with the audio controller. It was part of the instructions that I followed. Is it not required?
I donāt even know where you got app.jsā¦ itās not in my repo. Where did you download it from?
@dalley333 fixed itā¦ issue with upgrading to the latest serial port library. Just download the latest rnet.js and you should finally be good to go!
I found it here http://www.intranetofstuff.com/2016/08/03/rpi-serial-server.html
This allows the Raspberry Pi to interface with the audio controller through a USB to Serial/RS232 adapter and use your software.
@jsn0327 yeahā¦ I donāt think you need that. If you read the post here http://www.intranetofstuff.com/2016/08/09/rpi-serial-server-2.html youāll see that @tcjennings actually took the serial logic and included that in the mpr-sg6z plugin. AFAIK you would only use the app.js standalone mpr-6zhmaut-api service if you had hooked up a web page or other component to it.
If you are using the SmartThings Node Proxy service, all you need is the mpr-sg6z plugin.
And actually, if you were running both, it would explain why you werenāt getting notify messagesā¦ they were probably going to the app.js 6zhmaut-api service.
@redloro Got it, thank you SO much for helping me with this! If you need anyone else to help get 2 controllers or the ST2 going, Iām happy to help!
I am all over trying to get the ST2 going. It would be fantastic for me. The ST2-KP control pads are no longer made and despite 3 years worth of ebay crawling, I have yet to find any.
I do have a Russound ST2 āPC Power Toolā Kit with CD and RS232 connectors for the ST2-KP.
I do have 1 ST2-KP running - I am still looking for 3 more.
@Cory_Booth and @redloro Quite some time ago I had an integration called cav66.exe that allowed control of a PC playlist from the CAV66 keypads. It allowed integration of 12 zones and the ST2. I still have the documentation and ini files that I could share if it would be helpful. Unfortunately I donāt have a whole lot of coding experience otherwise Iād jump all over trying to figure this out!
Installing this on my Raspberry Pi is a little over my head. I already have Node.js installed for some other stuff but Iām not skilled enough to follow your read.me to get the rest installed. I only have SSH access to the Pi that this will go on.
The directions call for āDownload SmartThings Node Proxyā - When I go to your github page, I see a handful of files and folders but none called āSmartthings Node Proxyā (except āsmartthings-nodeproxy.serviceā but itās only a few lines.) āserver.jsā is the largest file. Am i supposed to download all these files individually? Is it downloaded via npm? If so, whatās the exact command? Should I download them to my laptop and then move them to the Pi via Samba?
Sorry to be such a noob! I need a much lower level read me to do this, as it seems to have a lot more assumed knowledge than I have. Can someone please make a step by step tutorial for installing on a Pi via console?
Ok, hereās what I did:
Downloaded the whole /smartthings-nodeproxy/ folder from github to my Mac laptop.
Created āpluginsā folder and moved ārnet.jsā into it
Copied āconfig.json.sampleā into http://jsonmate.com/ and made the necessary changes
Copied output back into Atom text editor and saved the file as āconfig.jsonā in ā/smartthings-nodeproxy/ā folder
Used Samba to transfer entire ā/smartthings-nodeproxy/ā to ā/homeā on my Raspbian Jessie OS
SSHād into Pi, and changed directory to ā/home/smartthings-nodeproxy/ā
ran $ ānode server.jsā
Received this error:
module.js:471
throw err;
^
Error: Cannot find module 'expressā
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object. (/home/smartthings-nodeproxy/server.js:19:15)
at Module._compile (module.js:570:32)
at Object.Module._extensionsā¦js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
What am I missing?
You have to install express. Use the following commands:
npm install
npm install express --build-from-source
The --build-from-source option may not be needed. Try to install express without it first. If you get an error stating that npm doesnāt have the necessary permissions, add the --unsafe-perm option.
That was it! Thanks a lot!! Once i disabled app.js everything started working properly. Iām still going to upgrade everything so that I can get your latest features. Very impressive!
Wellā¦ after updating package.json and server.js, then re-running npm install, everything installed without issue, but I am now receiving the following error when attempting to run server.js
root@NetMon:/opt/local/smartthings-master/smartthings-nodeproxy# node server.js
[2016-12-03T02:48:43.728Z] [stnp] SmartThings Node Proxy listening at http://:::8080
/opt/local/smartthings-master/smartthings-nodeproxy/node_modules/serialport/lib/serialport.js:101
throw new TypeError('Invalid ābaudRateā must be a number got: ā + settings.baudRate);
^
TypeError: Invalid ābaudRateā must be a number got: undefined
at new SerialPort (/opt/local/smartthings-master/smartthings-nodeproxy/node_modules/serialport/lib/serialport.js:101:11)
at Mpr6z.init (/opt/local/smartthings-master/smartthings-nodeproxy/plugins/mpr-sg6z.js:172:14)
at Object. (/opt/local/smartthings-master/smartthings-nodeproxy/plugins/mpr-sg6z.js:150:7)
at Module._compile (module.js:435:26)
at Object.Module._extensionsā¦js (module.js:442:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:311:12)
at Module.require (module.js:366:17)
at require (module.js:385:17)
at /opt/local/smartthings-master/smartthings-nodeproxy/server.js:88:35