Save file on the sd card from html client
hi,
trying days store config file web page sd card.
the rest command use "/arduino/saveconfig/data"
where data json string.
on arduino site collect data with code myfile on sd card
myfile filesystem.open("/mnt/sd/arduino/www/project/myfile.cfg", file_write);
while(client.available()>0) {
c=client.read();
myfile.print(c);
this works ok till configuration size bigger 500 bytes.
if size bigger 500 bytes timeout.
are there possibilities write sd card in other way?
regards
sahin
trying days store config file web page sd card.
the rest command use "/arduino/saveconfig/data"
where data json string.
on arduino site collect data with code myfile on sd card
myfile filesystem.open("/mnt/sd/arduino/www/project/myfile.cfg", file_write);
while(client.available()>0) {
c=client.read();
myfile.print(c);
this works ok till configuration size bigger 500 bytes.
if size bigger 500 bytes timeout.
are there possibilities write sd card in other way?
regards
sahin
for big size file please bypass fileio @ atmega32u4 , let ar9331 take care only.
profile code:
it take 7.64s download 10 mb file , save @ microsd.
by use sys.argv and process ar9331 could control atmega32u4.
code: [select]
nano /mnt/sda1/download.py
code: [select]
#!/usr/bin/python
import urllib2
zipfile = urllib2.urlopen("http://download.thinkbroadband.com/10mb.zip")
output = open('/mnt/sda1/10mb.zip','wb')
output.write(zipfile.read())
output.close()
code: [select]
chmod 755 /mnt/sda1/download.py
profile code:
code: [select]
time /mnt/sda1/download.py
real 0m 7.64s
user 0m 2.55s
sys 0m 1.49s
it take 7.64s download 10 mb file , save @ microsd.
by use sys.argv and process ar9331 could control atmega32u4.
code: [select]
void insertdb() {
process p;
p.begin("/mnt/sda1/download.py");
p.addparameter("http://download.thinkbroadband.com/10mb.zip");
p.addparameter("/mnt/sda1/10mb.zip");
p.run();
Arduino Forum > Products > Arduino Yún (Moderator: fabioc84) > Save file on the sd card from html client
arduino
Comments
Post a Comment