Page 2 of 2

Re: MQTT binding now available

Posted: Tue 31 Jul 2018, 17:22
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?

Re: MQTT binding now available

Posted: Tue 31 Jul 2018, 18:21
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

Re: MQTT binding now available

Posted: Tue 31 Jul 2018, 23:19
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