Propeller + SD + ENC28j60 = headache with HTML and images
sebastian1989
Posts: 14
Hi, my name is Sebastian, I am from chile, please be patient, my english is bad.
I am creating a web server with a propeller, the propeller read a HTML file from SD and sends the info with the library api_telnet_serial, the problem is that, when the HTML code search for images this obviously dont find any because all image are in the SD, the solution I found is send the image inside the HTML page in base64, but when I do this the propeller needs to transform the image to base 64 and this is very slow also whith the tranform to base64 the propeller need to send 33% more info.
This is a example in HTML to put a image in base64:
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA
AAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO
9TXL0Y4OHwAAAABJRU5ErkJggg==" alt="Red dot">
With the program I've done so far a jpg file 1024x768 1MB takes one minute to appear on the website but when I convert the image in the PC and the propeller only need transfer it this takes 15 seconds.
Does anyone know any other way to transfer the image (not base64)?
or how to make the transformation faster?
Again I apologize for my bad English.
I am creating a web server with a propeller, the propeller read a HTML file from SD and sends the info with the library api_telnet_serial, the problem is that, when the HTML code search for images this obviously dont find any because all image are in the SD, the solution I found is send the image inside the HTML page in base64, but when I do this the propeller needs to transform the image to base 64 and this is very slow also whith the tranform to base64 the propeller need to send 33% more info.
This is a example in HTML to put a image in base64:
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA
AAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO
9TXL0Y4OHwAAAABJRU5ErkJggg==" alt="Red dot">
With the program I've done so far a jpg file 1024x768 1MB takes one minute to appear on the website but when I convert the image in the PC and the propeller only need transfer it this takes 15 seconds.
Does anyone know any other way to transfer the image (not base64)?
or how to make the transformation faster?
Again I apologize for my bad English.
Comments
GET /img2.html HTTP/1.1 Host: 192.168.0.150 Connection: keep-alive Cache-Control: max-age=0 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Encoding: gzip,deflate,sdch Accept-Language: es-ES,es;q=0.8 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
When the browser sends the request?
Do I need to put some header or script to send the request?
I am reading a HTTP manual, I'm on page 50 of 450.
Does anyone see the problem?