The gateway to online resources and design support for engineers, powered by RS ComponentsAllied

+Post a new topic

How to extend Arduino's Webserver example to create an IP camera?

Avatar Posted by lafruit at

In Arduino's compiler environment, there is a nice example of a Webserver displaying the analog input voltages on a webpage with Arduino's Network Shield.

I have a JPEG camera module (serially connected to the board) and instead of displaying analog voltages, I would like to display its pixels (the full image) on a webpage, all this wihout having to pass through an iPhone or Android platform (many examples are available on the net for this). So, just as in the Webserver example: you type in the IP address and the image of the camera is shown on your computer in a web browser.

Can someone help me out here? Where can I find source code for such thing?

    Regards,

       Gauthier

Replies

  • Avatar

    Posted by akaro at

    google search for: code website webcam jpg

     

    will show you

    <HEAD>

    <meta http-equiv="Refresh" content="60">

    </HEAD>

    <img src="http://mein.server/webcambild/bild.jpg"
    
    width=320 height=240 border=0 alt="">

     

     

     

     

     

     

     

     

     

  • Avatar

    Posted by lafruit at

    Hi Akaro,
     
    In that script, the JPEG file is somehow sent by the webcam, but what I would like to do is my Arduino to send all the bytes of the JPEG file (coming from reading a JPEG camera module through ISP) in the correct format to the calling webpage (that basically refers to the Arduino's IP, e.g. http://192.168.1.104).
    These bytes must be sent through Arduino's client.println() commands, as in Arduino's Webserver example (but that only transmits some text), and received by the PC browser.
     
    I found a page referring to "inline images": http://elf.org/essay/inline-image.html where the command <IMG SRC="data:image/gif;base64,[...]"> (which must be sent by the Arduino) does what I want, but it can only work for small images. They also refer to another method javascript:'GIF89a\1\0\1\0\200[...]\1\0;' but that does not seem to work.
     
    Any idea?
     G.

  • Avatar

    Posted by akaro at

    Hello

    For my better understanding

    Is that right?

    Webcam (Picture.jpg) -> Arduino-Webserver (Picture.jpg) -> Webbrowser (Picture.jpg)

                    1                               2                                             3

    Arduino is like a proxy?

    Which one (1-3) is in the internet or only intranet?

    „sent through Arduino's“ it seems to me  Arduino hast to pull the Picturelike the webbrowser

     

     

     

  • Avatar

    Posted by lafruit at

    Yes, that's the architecture, where the Arduino-Webserver is connected to my home router and the webbrowser is running on a PC also connected to the home router. When typing the Arduino IP in the PC webbrowser, Arduino should read in an image from the webcam (directly connected to the Arduino board via serial link) and transmit it through the home router to the PC, which then visualizes the image.

    Arduino hence pushes the image to the PC, on PC's request.

    Later on of course, I'd like to send the images through internet, so there I should probably use another IP address set up by my router. But first things first: let's make it work on the home network first for images of up to 640x480 pixels.

    Any suggestions?

      Regards,

       G.

  • Avatar

    Posted by lafruit at

    Hi Akaro, 

    In that script, the JPEG file is somehow sent by the webcam, but what I would like to do is my Arduino to send all the bytes of the JPEG file (coming from reading a JPEG camera module through ISP) in the correct format to the calling webpage (that basically refers to the Arduino's IP, e.g. http://192.168.1.104).These bytes must be sent through Arduino's client.println() commands, as in Arduino's Webserver example (but that only transmits some text), and received by the PC browser. I found a page referring to "inline images": http://elf.org/essay/inline-image.html where the command <IMG SRC="data:image/gif;base64,[...]"> (which must be sent by the Arduino) does what I want, but it can only work for small images. They also refer to another method javascript:'GIF89a\1\0\1\0\200[...]\1\0;' but that does not seem to work.  Any idea?

    G.

  • Avatar

    Posted by arduinomstr at

    You might like to have a look at this project for some web server hints - http://arduino.cc/forum/index.php/topic,51138.0.html

Post a reply