Skip to main content
1-Visitor
October 26, 2018
Question

Not able to connect EMS to thingworx evaluation trial server.

  • October 26, 2018
  • 2 replies
  • 3893 views

Hi,

 

I am trying to connect EMS to thingworx trail evaluation server but the web socket is not getting connected.

Below are the jason.config file i am using:

 

{
"ws_servers": [{
"host": "pp-18102412130w.devportal.ptc.io",
"port": 443
}],
"appKey": "XXXXXXXXXXXXXXXXXXXXXXXX",
"certificates": {
"validate": false,
"cert_chain": ["certificate.cer"]
},
"logger": {
"level":"INFO",
"publish_directory":"logs",
"publish_level":"INFO",
"max_file_storage":2000000,
"auto_flush":true,
"flush_chunk_size": 16384,
"buffer_size" : 4096
},
"file": {
"virtual_dirs": [
{"logs": "logs"},
{"instruction":"instruction"}
],
"staging_dir": "C:\\Projects\\PTCDocs\\PTC_Work\\EMS\\microserver\\staging"
}
}

 

 

 

 

And the error i  am getting:

 

C:\Projects\PTCDocs\PTC_Work\EMS\microserver>wsems
[INFO ] 2018-10-26 15:50:01,552 wsems: Using config file: C:\Projects\PTCDocs\PTC_Work\EMS\microserver\etc\config.json
[FORCE] 2018-10-26 15:50:01,552 wsems: Starting up ....
[FORCE] 2018-10-26 15:50:01,581 wsems: Initializing EMS ....
[FORCE] 2018-10-26 15:50:01,581 main: Using config file C:\Projects\PTCDocs\PTC_Work\EMS\microserver\etc\config.json
[INFO ] 2018-10-26 15:50:01,581 wsems: Creating the WsEms proxy.
[INFO ] 2018-10-26 15:50:01,581 wsems: Starting HTTP Server.
[INFO ] 2018-10-26 15:50:01,582 wsems: Initializing the ThingWorx REST interface.
[FORCE] 2018-10-26 15:50:01,584 httpServer: starting http server port=8000
[INFO ] 2018-10-26 15:50:01,716 wsEmsProxy::initialize: Initialization complete!
[INFO ] 2018-10-26 15:50:01,717 wsems: Starting the connection.

pp-18102412130w.devportal.ptc.io:443-->[ERROR] 2018-10-26 15:50:02,76 SDK: Error intializing SSL connection
[ERROR] 2018-10-26 15:50:02,76 SDK: twWs_Connect: Error restarting socket. Error 126

 

 

 

Please help, I think the server is not getting connected.

Please check the host " https://PP-18102412130W.devportal.ptc.io/Thingworx"

 

 

Thanks and regards

Saurabh.

 

2 replies

1-Visitor
October 26, 2018

Sorry its config.json file, typing mistake.

 

Please resolve my issue its urgent.

16-Pearl
October 30, 2018

Hi @SaurabhHCL,

 

Can you please try the below configuration in your config file and make the relevant changes as per your environment.

 

{
	"ws_servers": [{
		"host": "pp-18102412130w.devportal.ptc.io",
		"port": 443
	}],
	 "http_server": {
 "host": "127.0.0.1",
 "port": 8080,
 "ssl": false,
 "authenticate": false
 },
	"appKey": "XXXXXXXXXXXXXXXXXXXXXXXX",
	"certificates": {
		"validate": false,
		"cert_chain": ["certificate.cer"]
	},
	"logger": {
		"level": "INFO",
		"publish_directory": "logs",
		"publish_level": "INFO",
		"max_file_storage": 2000000,
		"auto_flush": true,
		"flush_chunk_size": 16384,
		"buffer_size": 4096
	},
 "ws_connection": {
 "encryption": "ssl",
 "verbose": true,
 "msg_timeout": 1000
 },
	"file": {
		"virtual_dirs": [{
				"logs": "logs"
			},
			{
				"instruction": "instruction"
			}
		],
		"staging_dir": "C:\\Projects\\PTCDocs\\PTC_Work\\EMS\\microserver\\staging"
	}
}

Thanks,

Himanshu

1-Visitor
October 31, 2018

Hi Himanshu,

 

Thanks for your response.

Still not working, this is my app key "5d6d4f8c-320b-4c1e-8bbc-5747c0742379"

can you please try at your end and see if it works.

Also do we need to give some permissions from the composer also ?

As i have created an appkey only.

 

 

Thanks and regards

Saurabh.

16-Pearl
November 1, 2018

use below config file and make appropriate changes to it

and also do validate the appKey expiry date from composer as well.( extend the date)

 

****************************************************************************

{
"ws_servers": [{
"host": "vdccwp1259.logon.ds.ge.com",
"port": 443
}],
"appKey": "ba4c0ded-4f5f-4069-91be-8ca9a084777a",

"ws_connection": {
"encryption": "ssl",
"verbose": true,
"binary_mode": true,
"msg_timeout": 5000,
"ping_rate": 55000,
"pingpong_timeout": 10000,
"connect_period": 60000,
"duty_cycle": 100,
"message_idle_time": 50 ,
"max_msg_size": 1048576,
"message_chunk_size": 8192,
"max_frame_size": 8192,
"max_messages": 500,
"connect_on_demand": false,
"connect_timeout": 10000,
"connect_retry_interval": 10000,
"max_threads": 4,
"max_connect_delay" : 0,
"socket_read_timeout" : 100,
"frame_read_timeout": 10000,
"ssl_read_timeout": 500,
"connect_retries" : -1
},
"logger": {
"level": "TRACE",
"publish_directory": "c:\\Microserver\\logs",
"publish_level": "TRACE",
"max_file_storage": 2000000,
"auto_flush": true
},
"certificates": {
"validate": true,
"allow_self_signed": false,
"cert_chain": ["c:/Microserver/certificates/exported_rootcacert.pem"]
},

"http_server": {
"host" : "localhost",
"port" : 8000,
"ssl" : false,
"authenticate" : false
},

"auto_bind": [{
"name": "IS.PL02.RemoteRepository",
"host": "vdccwp1259.logon.ds.ge.com",
"port": 443
}],

"file": {
"virtual_dirs":[
{ "In" : "C:\Microserver\\In" },
{ "Out": "C:\\Microserver\\out" },
{ "staging": "C:\Microserver\\staging"}
],
"staging_dir": "staging"
}
}