04.01.2015 Views

CR1000 Manual - Campbell Scientific

CR1000 Manual - Campbell Scientific

CR1000 Manual - Campbell Scientific

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Section 8. Operation<br />

8.6.3.7 Files Management<br />

8.6.3.7.1 Sending a File to a Datalogger<br />

Web API commands allow a web client to manage files on host <strong>CR1000</strong> memory<br />

drives. Camera image files are examples of collections often needing frequent<br />

management.<br />

A file can be sent to the <strong>CR1000</strong> using an HTTPPut request. Sending a file<br />

requires a minimum .csipasswd access level of 1 (all access allowed). Unlike<br />

other web API commands, originating a PUT request from a browser address bar<br />

is not possible. Instead, use JavaScript within a web page or use the program<br />

Curl.exe. Curl.exe is available in the LoggerNet RTMC program files folder or at<br />

http://curl.haxx.se. The Curl.exe command line takes the following form<br />

(command line parameters are described in the accompanying table):<br />

curl -XPUT -v -S -T "filename.ext" --user username:password<br />

http://IPAdr/drive/<br />

Table 101. Curl HTTPPut Request Parameters<br />

-XPUT<br />

Parameter<br />

Description<br />

Instructs Curl.exe to use the HTTPPut command<br />

-v Instructs Curl.exe to print all output to the screen<br />

-S Instructs Curl.exe to show errors<br />

-T "filename.ext" name of file to send to <strong>CR1000</strong> (enclose in quotes)<br />

username<br />

password<br />

IPAdr<br />

drive<br />

user name in the .csipasswrd file<br />

password in the .csipasswrd file<br />

IP address of the <strong>CR1000</strong><br />

memory drive of the <strong>CR1000</strong><br />

Examples:<br />

To load an operating system to the <strong>CR1000</strong>, open a command prompt window<br />

("DOS window") and execute the following command, as a continuous line:<br />

curl -XPUT -v -S -T<br />

"c:\campbellsci\lib\OperatingSystems\<strong>CR1000</strong>.Std.25.obj" --user<br />

harrisonford:lostark1 http://192.168.24.106/cpu/<br />

Response:<br />

* About to connect() to 192.168.7.126 port 80 (#0)<br />

* Trying 192.168.7.126... connected<br />

* Connected to 192.168.7.126 (192.168.7.126) port 80 (#0)<br />

* Server auth using Basic with user 'fredtest'<br />

>PUT /cpu/myron%22Ecr1 HTTP/1.1<br />

>Authorization: Basic ZGF2ZW1lZWs6d29vZnk5NTU1<br />

>User-Agent: curl/7.21.1 (i386-pc-win32) libcurl/7.21.1<br />

OpenSSL/0.9.8o zlib/1.2.5 libidn/1.18 libssh2/1.2.6<br />

>Host: 192.168.7.126<br />

>Accept:*/*<br />

>Content-Length: 301<br />

>Expect: 100-continue<br />

><br />

391

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!