cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

ems filetransfer - adding virtual dir

jensiot1996
3-Newcomer

ems filetransfer - adding virtual dir

Hello everyone,

 

I'm a beginner in thingworx.

Right now i'm busy with adding filetransfer to my project.

 

I have an linux server with EMS 5.4 installed on it. 

I created in thingworx a Thing with base template "RemoteThingwithtunnelsandfiletransfer".

In my config.json i have this setup:

 

{
	"restart":	"any",
	"logger":	{
		"level":	"DEBUG",
		"audit_target":	"file://home/pi/microserver/logs/wsems",
		"publish_directory":	"/home/pi/microserver/logs/wsems"
	},
	"offline_msg_store":	{
		"enabled":	true,
		"directory":	"/home/pi/microserver/opt/thingworx",
		"max_size":	65535
	},
	"ws_servers":	[{
			"host":	"thingworx.be",
			"port":	443
		}],
	"resource":	"/Thingworx/WS",
	"ws_connection":	{
		"encryption":	"ssl"
	},
	"certificates":	{
		"validate":	false,
		"allow_self_signed":	true
	},
	"appKey":	"xxxxx",
	"http_server":	{
		"host":	"0.0.0.0",
		"port":	8000,
		"ssl":	false,
		"authenticate":	false
	},
	"auto_bind":[
		{ "name": "EEG.PoC.Edge.TestFileTransfer2" }
		],
	"tunnel":	{
		"tick_resolution":	5,
		"buffer_size":	8192,
		"read_timeout":	50,
		"idle_timeout":	300000,
		"max_concurrent":	4
	},
	"file": {
		"buffer_size": 8192,
		"max_file_size": 8000000000,
	"virtual_dirs":[
		{ "In" : "/home/pi/microserver/in" },
		{ "Out" : "/home/pi/microserver/out" }
		],
	"idle_timeout": 12000,
	"staging_dir" : "/home/eeg/microserver/staging"
		}
	
}

When i start my EMS. he create a new Directory "staging". But no "in" or "out". Also if a run a service on my thing like "getDirectoryStructure" i get no data back.

In the logs of the EMS i get a info message that he succesfully created the virtual dir in the path described.

 

How is it possible that he doesn't create the in and out directory on my linux ? And why im a getting no data back from the service ?

What i'm a doing wrong ?

 

Thanks for the help ! 

ACCEPTED SOLUTION

Accepted Solutions
wposner-2
14-Alexandrite
(To:jensiot1996)

Yes.  Anytime you make changes to your config files or any underlying .lua files you must restart the applicable runtime.

View solution in original post

7 REPLIES 7
wposner-2
14-Alexandrite
(To:jensiot1996)

Virtual directories that you specify need to exist.  The EMS will not automatically create them.  Once you're directories exist, the GetDirectoryStructure service will work

Thanks for the answer.

I added the 2 dirs to the path i specified in the config.json.

I setted the permissions of the 2 dirs to full access (chmod 777).

 

But still if i run the service i get no data .. 

There are also some text files in the 2 dirs.

wposner-2
14-Alexandrite
(To:jensiot1996)

I would check both your EMS and LSR log files to see what's going on.  For the EMS make sure you have verbose set to true:

 

"ws_connection":   {
        "verbose":  true,
 
You should be able to see the GetDirectoryStructure call being made in the logs.  If there are any errors, you should see them.

The only thing i get in the EMS log file when i execute the service is this:

 

[DEBUG] 2019-05-15 14:50:06,749 SDK: twMessage_Delete: Deleting RESPONSE Message: 147
[DEBUG] 2019-05-15 14:50:06,749 SDK: twMessage_Delete: Deleting REQUEST Message: 147

 

wposner-2
14-Alexandrite
(To:jensiot1996)

Did you add the verbose flag?  You should be seeing a lot more output.  What's in your LSR logs?

I restarted my server. Then it worked.

 

Thanks for the support ! 

wposner-2
14-Alexandrite
(To:jensiot1996)

Yes.  Anytime you make changes to your config files or any underlying .lua files you must restart the applicable runtime.

Announcements


Top Tags