Synchronization Without “.PNC”

Discussions about syncing data via Bluetooth, Dropbox, FTP, and using CSWeb
Forum rules
New release: CSPro 8.0
Post Reply
khurshid.arshad
Posts: 571
Joined: July 9th, 2012, 11:32 am
Location: Islamabad, Pakistan

Synchronization Without “.PNC”

Post by khurshid.arshad »

Dear Team

I am using an example from CSPro 7 for test run and I have found the instructions as follows:
“If running on Android, copy the folder Deployment/Synchronization in Logic to the csentry folder on the Android device.” It means we are going to copy manually in all the devices or is there any quicker way, as we were using "PNC" in the past.

I am using dropbox for my survey with version 7 and file type is text. My syntax is as follows:

Code: Select all

Function SynDatatoServer();
		if syncconnect(Dropbox) then
	    syncfile(PUT,"../Work/IND/*.dat","CAPI/Survey/Work/IND/");//First Path is "FROM" and second Path is "TO"
	    syncfile(PUT,"../Work/HH/*.dat","CAPI/Survey/Work/HH/" ); //First Path is "FROM" and second Path is "TO"
	    syncfile(PUT,"../Work/COM/*.dat","CAPI/Survey/Work/COM/" ); //First Path is "FROM" and second Path is "TO"
		syncdisconnect();
		else
		endif;
end;
I want to use getdeviceid() and date,time when we are going to upload data on dropbox.

Please advice.
Thanks.
a.
khurshid.arshad
Posts: 571
Joined: July 9th, 2012, 11:32 am
Location: Islamabad, Pakistan

Re: Synchronization Without “.PNC”

Post by khurshid.arshad »

Dear Team
What i have figured out:

Code: Select all

Function SynDatatoServer();
		if syncconnect(Dropbox) then
		String DateTime=concat (edit("999999",sysdate("DDMMYY")), edit("999999", systime()));
		syncfile(PUT,"../Work/IND/*.dat",concat("CAPI/Survey/Work/IND/",getdeviceid(), "/",DateTime,"/") );//First Path is "FROM" and second Path is "TO"
	    syncfile(PUT,"../Work/HH/*.dat",concat("CAPI/Survey/Work/HH/",getdeviceid(), "/",DateTime,"/" )); //First Path is "FROM" and second Path is "TO"
	    syncfile(PUT,"../Work/COM/*.dat",concat("CAPI/Survey/Work/COM/", getdeviceid(), "/",DateTime,"/")); //First Path is "FROM" and second Path is "TO"
				syncdisconnect();
		else
		endif;
end;
If there is a better way please advice. Please advice on PNC as well.
thanks.
a.
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Synchronization Without “.PNC”

Post by josh »

With the new sync there is currently no way to deploy the application other than via USB. We are working on something but it won't be ready for a little while yet.

What you are doing is a good way to include device id in the path. However, you can now use syncdata() for data files with FTP and Dropbox. With that approach you don't have to worry about interviewers overwriting each others files. You can simply replace the syncfile calls with syncdata calls and then use the DataViewer to download the data from Dropbox into a single csdb file. See "Synchronization Overview" in the help for more info.
arkagwa
Posts: 119
Joined: November 18th, 2014, 5:25 am

Re: Synchronization Without “.PNC”

Post by arkagwa »

I am getting this error when i sync with my android tablet device
Attachments
Screenshot_2017-06-21-15-57-51[1].png
Screenshot_2017-06-21-15-57-51[1].png (52.18 KiB) Viewed 7607 times
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Synchronization Without “.PNC”

Post by josh »

127.0.0.1 is the address for localhost. You need the public url of the machine that your CSWeb server is running on. Localhost is a special address that is always a server on the local device so in this case it is looking for a server running on your tablet. Setting up a server with a public URL is beyond what we can help you with. Consult someone with experience in this area or just stick to Dropbox sync.
arkagwa
Posts: 119
Joined: November 18th, 2014, 5:25 am

Re: Synchronization Without “.PNC”

Post by arkagwa »

Dear Josh

Thanks, but my csweb server is installed in localhost (my PC). Does this public URL??
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Synchronization Without “.PNC”

Post by josh »

Setting up a web server that is publicly accessible or accessible over the network is not CSPro specific so I'm not going to help there. Maybe someone else on the forum is willing. Lots of info online as getting your csweb accessible is the same as making any website available over the network. Try Googling stuff like "access local web server from network".
jfigueroa
Posts: 100
Joined: August 28th, 2014, 12:46 pm

Re: Synchronization Without “.PNC”

Post by jfigueroa »

Dear arkagwa,

To access to CSPro Web Server through internet, you need to configure and setup your CSWeb Server on a Server Machine that has a Public IP address. That way you can access that server through Internet by the public IP.
Post Reply