Extending The Features Of An IP Camera

adding-external-control-via-IP-camera

[Dave Astolfo] wanted to be able to let his CNC mill run by itself with the ability to monitor it remotely. The only problem with that idea is that if he checked in and saw something bad happening he needed a remote kill switch as well. He ended up killing two birds with one stone by adding extra features to an IP camera.

These Internet Protocol cameras are pretty nifty. Just plug their power cord in and they’ll connect to WiFi and start streaming video. Many of them offer features like pan and tilt, and this model even features IR LEDs for night viewing that can be switched on and off through the web interface. That’s the point at which [Dave] started his hack. He patched into the leads on the IR LEDs. They’re monitored by an ATtiny85. When he turns on the LEDs via the webpage the ATtiny85 senses it and drives a servo motor to push the ESC key on the keyboard. As you can see in the clip after the break, this will stop the milling in its tracks. We especially liked the use of LEGO Technique pieces to make the servo mount removable.

17 thoughts on “Extending The Features Of An IP Camera

  1. He could have wired the output (First boosting it to 5VDC) to the EStop or other input on his parallel port’s BOB. Even if he is using Smooth stepper or such it could have been easily done. That would be a heck of a lot more reliable as you’d be surprised on how keyboards stop working from the dust.

    1. I was just thinking he could have just used the Tiny to enumerate a keyboard and use a pin signal to trigger a key event. less moving parts less likely to fail when the tool is racing for the block at shattering speeds.

  2. Perfect Timing, I have what I think is the exact same FOSCOM IP camera and I’m just about done building my Reprap 3D printer and was thinking of something similar so I could easily monitor the print while I work on my PC doing some coding or whatnot. I wounder if I could wire in an IR receiver to one of my mechanical end stops so if it picked up a simple IR pulse it would kill the system.

    Anyways, thanks for this post it’s got me thinking about simple solutions for a remote kill switch. Maybe I’ll just use an Arduino with the it all for environmental monitoring as well. Oh well one thing at a time, gotta get that 3D printer finished and printing first.

    1. A lot of these cameras look fairly identical. Some have accessible gpio pins on the back, the one I have looks just like this but in white and has 3 programmable pins from the browser. They usually dont even cost any more.

      1. I got one that looks the same and has a 4-pin screw terminal in the back labeled “I/O Alarm” which is controlled by a built in relay. The relay can be triggered from the web interface.

    1. Not 100% unsecured. The cameras have user access control built in. But you’re right in that they transmit in plain text, or plain MJPEG really. On Foscam cameras you can basically request it to start streaming you data by crafting the appropriate url, often incorporating the username and password.

      However there’s no need for encryption as encryption is handled by the network layer providing you’ve enabled the appropriate encryption on your WiFi router. The encryption standards for WiFi provide unique keys to each authenticated client so just because you have the network key and have joined Alice and Bob’s network doesn’t mean you can decode the wireless data between Alice and the router, and Bob and the router.

      Now if you actually ARE the router on the other hand all bets are off, especially since the username and password for the camera are sent via plaintext in many automated systems :-)

  3. Some of these cameras have accessible gpio pins on the back, the one I have looks just like this but in white and has 3 programmable pins from the browser. They usually dont even cost any more. If anyone plans on repeating this I highly suggest using one of those models instead of hacking into the ir leds. It is a nice hack though, use what you’ve got is what this site is all about.

  4. I was setting something like this up for my cnc, but just a network cam. I wanted to put a wrt ap to it, so when connected to ssid, any website accessed the dns would redirect you to the cam streaming page. Don’t think I ever got that part. Id still like to. Ideas?

    1. I use an .264 encoding DVR that I picked up for $70 that has four video inputs, two audio inputs, and PTZ output to monitor my house and watch TV(I have the two inputs that support audio connected to two different satellite receivers) on my iPhone or laptop remotely. When I want to use my Solidoodle remotely, I connect the PTZ output of the DVR to a wireless AC switch to kill power to the unit when I send a PTZ command. I’m working on using the PTZ output to control the satellite receivers… :)

      You could also just use VNC when using the CNC, as I did before I connected the PTZ to kill power…

  5. @mickey.

    NO, they have easy serial access.
    JTAG is doable, but given the depth of knowledge I have about the hardware (and software in them), I’m 9000% certain you meant serial.

    If anyone is interested in them, I have a forum here -> http://www.openipcam.com for them, plus source for the BSP’s in the file section.
    I also have some more IP-Cam material from my earlier exploits in my reverse engineering them here -> http://www.computersolutions.cn/blog/category/ip-cam/

    Its been a while since I’ve been on featured on Hackaday, I guess I need to do more cool stuff haha.

    Lawrence / 小杜

Leave a Reply to David RysdamCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.