MATLAB Answers

0

putFile command is not working

Asked by Biruntha Gnaneswaran on 27 Oct 2015
Latest activity Answered by Biruntha Gnaneswaran on 29 Oct 2015
Hi, I follow this to transfer file to raspberry pi hardware. it works well while i sending image. but if i send text file it gives an error. how can i solve this?
mypi = raspi;
putFile(mypi,'output.txt','/home/pi/output.txt');
Error executing command: pscp: output.txt: Cannot open file

  0 Comments

Sign in to comment.

2 Answers

Answer by Murat Belge on 27 Oct 2015

This works fine for me. Can you execute the following commands an post the results:
>> a = dir('output.txt');
>> disp(a)
>> system(mypi,'ls -al')
>> system(mypi,'df -h')

  0 Comments

Sign in to comment.


Answer by Biruntha Gnaneswaran on 29 Oct 2015

fid=fopen('output.txt','w');
fprintf(fid,'%s','hi');
fclose(fid);
mypi = raspi;
putFile(mypi,'output.txt','/home/pi/output.txt');
Before I used fclose after pufile command. now this code is working

  0 Comments

Sign in to comment.