IP camera for video and control
Posted: Mar 1st, 2013, 6:43 pm
Hello fellow enthusiasts. First time poster here. There may already be details of a similar set-up on the forum, if so forgive me for repetition and ignorance. Hopefully this approach may help some of us get over the control and video hurdle and into the fun stuff such as thrusters, tether and housings, and then develop a better control system over time
New Toy
I started looking at the DIY ROV and robotics forums and commercial sites a few months ago after buying a $60 IP camera as an educational project (new toy for me) with the view of using the pan and tilt motor signals as a means of controlling thrusters over ethernet. Minimal hardware with video and control over 2 pairs.
The Great "Discovery"
Searching the net for more information on said camera while waiting for it to arrive, I found other people had identified a logic-level serial port on the camera's main PCB. These guys were into changing the firmware through this port - that sort of programming a bit beyond me - but there was another who was sending his data out of the serial port by using a command sent down the ethernet cable. Turned out that my camera was a copy of these commonly hacked ones, and that the command codes I was interested in were the same. Much easier and way more elegant than trying to interpret the stepper motor signals!
Edited - credit where credit is due. Found the post that alerted me to the TXD port and how to access it from the browser Thanks Mickey!
http://letsmakerobots.com/node/22674
Three items needed for viewing and control:
1. IP camera ($60 purchased from large online retailer in Australia), warranty voided and two wires soldered on.
2. Microcontroller board with VERY simple program (Atmel M32 programmed in BASCOM, alternatively use Arduino or any similar) to receive serial out from the cam board and convert it to thruster speed control PWM signals.
3. PC running browser to view camera, and to send ROV commands from a simple HTML file on the PC ($200 ASUS netbook works well)
Typical command structure http://169.254.233.196/comm_write.cgi?port=0&baud=13&bytes=6&data=%ff%ff%ff%0f
Note that with this setup the only feedback I have at present is video, with the possibility of encoding very low speed data onto the alarm and mic inputs. Compass bearing etc could be displayed on LCD in edge of camera view. The camera's built-in webserver lets your PC record video, so you could have at least a visual log.
I stopped work on the ROV several months ago due to other commitments and the desire develop better thrusters instead of making another 2 mag-coupled units. So have a housing, electronics, speed control, 1 thruster and a bit of cable but no wet feet yet.
The Experimental User Interface:
After trying to see what was involved in writing a Javascript or some other control window, I decided to just use a mouse-over command in HTML to send the motor commands out of the camera's port. Pretty clunky, a joystick much better, but good as a start and very simple to implement. The test webpage I created is only controlling one motor. In practice you would be sending commands to 3 motors simultaneously. Mixing, as the RC folks call it. Anyway, when mouse-ing over a circular array of "buttons" (actually table cells) the motors speed and direction commands are sent, as if you were clicking an a link in any other webpage. The camera replies and these replies are sent to a junk frame and not used for anything.
I first open the camera's standard display/ control window, then open the HTML file with the table/commands in it in another so it overlays the unwanted part of the "normal" camera control. If you like, you can impress your friends and colleagues by adding your ROV's name to the control page.
Microcontroller:
The camera's serial port sends status messages every once in a while that need to be ignored or "filtered out" by the microcontroller. These are at a higher baud rate, but the camera is forced to send at lower baud that the micro can receive properly each time you want to send something. Some dummy characters (the FFs) are sent by the control webpage to indicate the start of valid data. The program reads and discards these, then reads and uses the motor speed data. Program can be easily changed to control more than 1 motor.
Language Suggestions
If someone has suggestions for an easyish-to-learn Windows PC compatible language that could produce a simple GUI and send data to the camera's address on the network from analog joysticks, then I would be keen to hear. If too complex, then my next step could be a stand-alone controller connected to the network, working alongside the camera's standard display
Cheers,
Ross
New Toy
I started looking at the DIY ROV and robotics forums and commercial sites a few months ago after buying a $60 IP camera as an educational project (new toy for me) with the view of using the pan and tilt motor signals as a means of controlling thrusters over ethernet. Minimal hardware with video and control over 2 pairs.
The Great "Discovery"
Searching the net for more information on said camera while waiting for it to arrive, I found other people had identified a logic-level serial port on the camera's main PCB. These guys were into changing the firmware through this port - that sort of programming a bit beyond me - but there was another who was sending his data out of the serial port by using a command sent down the ethernet cable. Turned out that my camera was a copy of these commonly hacked ones, and that the command codes I was interested in were the same. Much easier and way more elegant than trying to interpret the stepper motor signals!
Edited - credit where credit is due. Found the post that alerted me to the TXD port and how to access it from the browser Thanks Mickey!
http://letsmakerobots.com/node/22674
Three items needed for viewing and control:
1. IP camera ($60 purchased from large online retailer in Australia), warranty voided and two wires soldered on.
2. Microcontroller board with VERY simple program (Atmel M32 programmed in BASCOM, alternatively use Arduino or any similar) to receive serial out from the cam board and convert it to thruster speed control PWM signals.
3. PC running browser to view camera, and to send ROV commands from a simple HTML file on the PC ($200 ASUS netbook works well)
Typical command structure http://169.254.233.196/comm_write.cgi?port=0&baud=13&bytes=6&data=%ff%ff%ff%0f
Note that with this setup the only feedback I have at present is video, with the possibility of encoding very low speed data onto the alarm and mic inputs. Compass bearing etc could be displayed on LCD in edge of camera view. The camera's built-in webserver lets your PC record video, so you could have at least a visual log.
I stopped work on the ROV several months ago due to other commitments and the desire develop better thrusters instead of making another 2 mag-coupled units. So have a housing, electronics, speed control, 1 thruster and a bit of cable but no wet feet yet.
The Experimental User Interface:
After trying to see what was involved in writing a Javascript or some other control window, I decided to just use a mouse-over command in HTML to send the motor commands out of the camera's port. Pretty clunky, a joystick much better, but good as a start and very simple to implement. The test webpage I created is only controlling one motor. In practice you would be sending commands to 3 motors simultaneously. Mixing, as the RC folks call it. Anyway, when mouse-ing over a circular array of "buttons" (actually table cells) the motors speed and direction commands are sent, as if you were clicking an a link in any other webpage. The camera replies and these replies are sent to a junk frame and not used for anything.
I first open the camera's standard display/ control window, then open the HTML file with the table/commands in it in another so it overlays the unwanted part of the "normal" camera control. If you like, you can impress your friends and colleagues by adding your ROV's name to the control page.
Microcontroller:
The camera's serial port sends status messages every once in a while that need to be ignored or "filtered out" by the microcontroller. These are at a higher baud rate, but the camera is forced to send at lower baud that the micro can receive properly each time you want to send something. Some dummy characters (the FFs) are sent by the control webpage to indicate the start of valid data. The program reads and discards these, then reads and uses the motor speed data. Program can be easily changed to control more than 1 motor.
Language Suggestions
If someone has suggestions for an easyish-to-learn Windows PC compatible language that could produce a simple GUI and send data to the camera's address on the network from analog joysticks, then I would be keen to hear. If too complex, then my next step could be a stand-alone controller connected to the network, working alongside the camera's standard display
Cheers,
Ross