Skip to content

On the Track of an Exciting Idea

April 2, 2015

Bear with me, this is good.
15-04-02 favicon

Most browsers, when they access a web site for the first time, send a separate request for a file named favicon.ico. This is supposed to be a little image that the browser uses to identify the site (in bookmarks for example). All my web servers just automatically refuse the request, sending back a “HTTP/1.1 404 Not Found” message. The browser doesn’t complain it just uses some kind of default.

So, I started wondering If the olduino could actually serve the image and i looked at examples where people were using arduinos to serve images – usually from external storage like an SD card. It looks like all you have to do is, instead of sending the 404 message, send the same “HTTP/1.1 200 OK\r\n\r\n” acknowledgement I usually send followed by the binary data for the file!

This seems quite exciting, not especially because of the favicon but it opens up the possibility of programatically generated output for the olduino. Let’s take a bit map file. Say 64X64 monochrome. A BMP file will have some framing and metadata in it but the guts will be 64 lines of 64 bits(8 bytes) either off or on. The Olduino could easily store 64X8 bytes but that’s not the point – to send all black you send 00 64X8 times, Close spaced vertical lines would be 0x80 repeated 64X8 times and so on. You could generate images on the fly with no buffer at all or maintain a buffer which you update like an LCD or 1861 video buffer before you send it out.

Or take a .WAV audio file. The guts of a low res wav file can be as little as 1000 8 bit samples per second of sound. You could store a few seconds OR, you could generate a siren sound as long as you like exactly as if you were sending it out to a local speaker.

This isn’t a completely original idea, once i started looking i found an example where someone stores images in flash memory on the arduino but I really think the possibilities are pretty neat.

It’s also not working yet. I can display the favicon.ico file(above it’s meant to be a tiny starship enterprise) if i explicitly request it from the browser url box but safari, at least, doesn’t seem to recognize it as a favicon and neither does chrome on the tablet. I’m quite convinced the idea is sound though so i’ll keep working at it.

char iconhdr[]="HTTP/1.1 200 OK\r\n\r\n";
char starshipicon[]={

void sendfavicon(){
	printf("sending the icon\n");
	sendconst(iconhdr); 	// Now Send a header
	sendconst(starshipicon);//and the binary data!

and in the session handler:
			else if (strncmp((char *)buf,"GET /favicon",12)==0){
  				sendfavicon(); //(this used to be sendnak();

From → web server

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: