MQTT binding now available

How to integrate SPC Web Gateway with different Home Automation Systems
fergalom
Posts: 15
Joined: Fri 11 Sep 2015, 09:16

Re: MQTT binding now available

Post by fergalom »

Hi Goran,

Have the spc gateway and mqtt node installed and working.
Using it for automations on NodeRED

However I cannot get the websocket to connect

Nodered WebSocket input node connect to a debug output
wss://192.168.1.16:8088/ws/spc?username=ws_user&password=ws_pwd

Have confirmed the settings in node-spc-mqtt config.json

Code: Select all

{
   "spc_gw_host":"192.168.1.16",
   "spc_gw_port":"8088",
   "spc_ws_user":"ws_user",
   "spc_ws_password":"ws_pwd",
   "spc_get_user":"get_user",
   "spc_get_password":"get_pwd",
   "spc_put_user":"put_user",
   "spc_put_password":"put_pwd",
   "mqtt_host":"192.168.1.16",
   "mqtt_port":"1883",
   "mqtt_main_topic":"/SPC/",
   "naming":"1"
}
and also spc-web-gateway config.xml

Code: Select all

<config>
   <enable_get_auth>yes</enable_get_auth>
   <enable_put_auth>yes</enable_put_auth>
   <enable_ws_auth>yes</enable_ws_auth>
   <enable_edp_encryption>yes</enable_edp_encryption>
   <enable_ssl_encryption>yes</enable_ssl_encryption>
   <access_control_list>-0.0.0.0/0,+192.168.1.0/24</access_control_list>
   <http_port>8088</http_port>
   <tcp_port>16000</tcp_port>
   <spc_id>1000</spc_id>
   <gateway_id>1100</gateway_id>
   <spc_time_diff>0</spc_time_diff>
   <spc_dst>yes</spc_dst>
</config>
Any thoughts or anybody tried this before?
gol
Webbplatsadministratör
Posts: 72
Joined: Sun 01 Jun 2014, 19:38

Re: MQTT binding now available

Post by gol »

Hi fergalom,
Probably you have to set the NODE_TLS_REJECT_UNAUTHORIZED environment variable to 0.
Please see: http://stackoverflow.com/questions/1088 ... ps-request

Best regards
Goran
fergalom
Posts: 15
Joined: Fri 11 Sep 2015, 09:16

Re: MQTT binding now available

Post by fergalom »

Thanks Goran!

Another alternative is to upgrade to Nodered 0.18 where the issue has been sorted and you edit TLS and untick verify cert
Post Reply