Sunday, June 19, 2011

Fisheye Lens Webcam

I video conference often for work, and fret that I can only see one person on the other side of the call. Wouldn't this be easier and more natural if I could see everyone? Time to get creative and mount a fisheye lens to my webcam.

I started with a door viewer a.k.a. peephole. Fail.
side by side3

Then I upgraded to a Vivitar 0.21X 37mm fisheye lens made for a video camera. Win. I estimate the "before" viewing angle at 75º and the after at 115º. More than 90 is what I was after (stick it in the corner, see the whole room), so this is very good.

Next I needed a housing; preferably one that was non-destructive to both the lens and the laptop. Below is a 1 1/2" EMT insulated bushing (the blue ring) super glued to a plastic faceplate. You can see I drilled holes through the ring so that nuts and bolts can hold the lens in place – the lens barrel has a concave shape, so friction in the lowest point keeps it stable.

1" C-clamps hold the rig in place on the rim of my laptop's display. The clamps should work on pretty much any laptop screen thickness.

Sure it interferes with the display – but that wasn't a design goal since I have a second display.

And of course since I'm an engineer, the housing started with a sketch. Total project cost was under $50.

Here are some other like-minded projects on the Internet that inspired me:

Thursday, June 09, 2011

Enabling IPv6 on Comcast with Buffalo WZR-HP-G300NH

I'm running Buffalo's latest (as of this writing) DD-WRT firmware, V24-SP2 build 16783.

The DD-WRT IPv6 tutorial is in the ballpark, but didn't work for my setup. See the section on 6rd for Comcast-specific scripts; for me, the script never succeeded on startup (I presume because the WAN wasn't up before the script was executed). Here's what actually worked:

  • In the web interface, Administration / Management.
    • IPv6: Enable
    • Radvd: Disable
    • JFFS2: Enable
    • Clean JFF2: Enable (this will format a writable partition where you can store user scripts)
  • Apply, and then reboot the router.
  • For some reason, nslookup throws a segmentation fault on my router… so the script below shows a hard-coded value IP address. The original script linked above intended to parse the result of nslookup.
  • Use SSH/SCP/SFTP to copy this script onto the router to /jffs/etc/config/ipv6comcast.wanup:

insmod /lib/modules/`uname -r`/kernel/net/ipv6/sit.ko
#nslookup segfaults
WANIP=$(ip -4 addr show dev eth1 | grep 'inet ' | awk '{print $2}' | cut -d/ -f1)
if [ -n "$WANIP" ]
V6PREFIX=$(printf ' 2001:55c:%02x%02x:%02x%02x' $(echo $WANIP | tr . ' '))
ip tunnel add tun6rd mode sit ttl 255 remote any local $WANIP
ip link set tun6rd mtu 1280
ip link set tun6rd up
ip addr add $V6PREFIX:0::1/32 dev tun6rd
ip addr add $V6PREFIX:1::1/64 dev br0
ip -6 route add 2000::/3 via ::$HOST6RD dev tun6rd
kill -HUP $(cat /var/run/
echo "interface br0 { \
MinRtrAdvInterval 3; MaxRtrAdvInterval 10; AdvLinkMTU 1280; AdvSendAdvert on; \
prefix $V6PREFIX::/64 { AdvOnLink on; AdvAutonomous on; AdvValidLifetime 86400; \
AdvPreferredLifetime 86400; }; };" \
> /tmp/radvd.conf
radvd -C /tmp/radvd.conf start