Wifi cam complete

Various modes of Marcy 2's fully functioning wifi camera are shown. A 168Mhz 128k RAM chip compresses JPEG & streams on 802.11g. As the frame size increases & color is enabled, the framerate goes down. Body movement around the antenna makes it drop packets. It still compresses a lot faster on 168Mhz & 128k RAM than a 166Mhz Cyrix with 64MB SDRAM did, 15 years ago. The Cyrix only did 5fps 320x240 color, if you were lucky.


With a new, unmelted camera finally arriving, the true frame rates & bit rates could be known.

640x480 color: 3fps    800 kbit
640x480 grey: 4fps    1 megabit
320x240 color: 20fps    2.5 megabit
320x240 grey: 30fps     3 megabit


Quite an improvement over the UART cams from Sparkfun.  The bitrate got a lot higher when the lens wasn't melted.  All the 640x480 modes had to go to single buffers to fit in the RAM.  They could double buffer if the quality was reduced way down.  Noise is now the real problem.  Capacitance directly on the wireless dongle is the key.  Networking bitrate is way up.  Bluetooth wouldn't be an option.


320x240.jpg

320x240c.jpg


640x480.jpg

640x480c.jpg


desolder01.jpg


Desoldering position for the melted cam.

cam81.jpg


Another $20 in Nate's retirement fund.

cam83.jpg


Another perfect soldering job.

cam84.jpg


Marcy 2's eye.

marcy2_19.jpg

 The TCM8230MD does run on as low a clockspeed as you want, giving a much brighter picture & a data rate suitable for 8 bit micros.  The rolling shutter got bad at 1Mhz.  It's certainly no good for aerial photos at 1Mhz.  Rolling shutter is much less at 28Mhz.


It would be revealing to know how bad the AR drone cameras are, but the guys who use those don't know what a rolling shutter is.

For video compression, some research led back to rtjpeg, an ancient piece of code from the early days of video.  A guy spent a lot of time making the simplest, fastest DCT image compressor possible.  It's totally impractical for video editing on today's computers, but perfect for embedded microcontrollers.

A port of RTJPEG & a step up in optimization flags got the frame rate way up.  The trick was compressing the DMA buffers directly & doing the whole process from camera to network without any mem copies.  For greyscale, it compresses 8 lines at a time, as the frame is read from the camera.  For color, it compresses 16 lines at a time.  Thus only 128k RAM can compress 640x480 color.


The camera generates much less noise when underclocked below 4Mhz, but the rolling shutter is really bad.  The network is very prone to going down or dropping out during a high bitrate stream, since the chip doesn't have enough bandwidth to service ASSOC requests while streaming at full speed.  Pounding on the 'iwconfig essid Marcy2' command keeps it alive, but a phone can't be depended on to do that.

It's not every day such an original hack job suddenly spits out 30fps video, but the nominal bitrate in flight is only going to be 256kbit & that could have been done by bluetooth.  It would be a lot easier for users to get working & it has a lot more supported parts.

Getting the frames to align on the top row ended up requiring starting
the DMA 1st, the camera configuration 2nd, & the DCMI last.  There was no obvious way to synchronize the DMA with the VSYNC.  Perhaps the DCMI does some magic when DMA is already running.
Finally got around to stepping the wifi up to 54 megabits.  It uses a lot less power than 1 megabit.  The bitrate is actually set in the hardware dependent header for each packet.  MGMT frames get 1 megabit.  DATA frames get 54 megabits.
That makes the connection drop more frequently, but gets the bandwidth up to 4 megabits, in our beacon response protocol.  That's way above Roving Networks.

Consider the material cost: $14 for the ARM, $10 for the camera, $5 for the wifi card, $10 for the board & discrete parts.  The receiver is built into every laptop & it's a modern digital signal instead of the 15 year old analog everyone else is using, so it could be a viable alternative to an analog flight downlink.

propeller06.jpg

Discovered these 1mm shaft propellers can simply be pressed on the 1.5mm motor shaft. This is what everyone's doing, hence the lack of any prop adapter like what we've been using. Even the adapter was friction based.


 Marcy 2 now needs a huge cash infusion to continue.  Hobbyking has stopped restocking most everything that made it not Tower Hobbies, leaving only full priced versions.

The very 1st images received from Marcy 2's wifi camera.

E-mail me when people leave their comments –

You need to be a member of diydrones to add comments!

Join diydrones

Comments

  • I would say that making a solution for any composite camera would be much more interesting. Like the "Axis M7001". I'm looking for something similar to the Axis these days, because the Axis is very expensive. Ane suggestion btw ?

  • Hello Jack,

    The WiFi solution is realy intresting, could you post some more info on this ?

    i think it's a RTL8188  USB chip ?

    thanks

  • That's just amazing Jack. Your work in the video field is really paying off.  One thing confuses me or makes me dizzy, what is this cams purpose on a monocopter? is it ground based orientation/nav?

  • Distributor

    Well, make a wishlist then with the hardware you could use. Maybe a DIY-fairy brings something to your door..

  • Donations may not work with the way unemployment compensation works.  Kickstarter reports all earnings to the IRS & at least until the benefits run out in 5 months, that could cost a lot more in the end. 

  • Distributor

    Jack, you should setup a Donations process... I am sure a lot of people would jump in and send some $ to you to make you push the limits again. 

    I sure would send something, your work is always brilliant and ahead of the main stream. 

    100 person sending you $20 would make a difference... 

  • Moderator

    Great work Jack! Ingenious use of the mane as a test subject as well! :D (damn, I miss my hair...)

  • The complexity and quality of your work is really amazing. It would be a really great progress to the whole community to have access to the source code, as well as to the schematic of the board. 

  • Hi Jack,

    I'd also be interested in seeing how you ran the camera through DMA. I've been playing with an OV7076 module and the STM32F4, but reading in the image data can be quite slow, so I'd like to use the DCMI.

  • Moderator

    Great Work Jack,

    what're your starting point code for this development ? A lot of time ago i develop a video compressor based on SH1 . I used H.264 compressor algorithm and i had only 4 fps as your cyrix 166 :)

    Are your development opensource ? Can we share our work ? The MP32F4 use your same micro controller STM32F4 . What wifi module are you used and how you connect it to micro ? I'm very interest to your work.

    Best

    Roberto

This reply was deleted.