Search code examples
network-programmingwifiarduino

IP camera setup and control from a C++ application


I would like to control a small robot based on arduino and an IP camera from a PC via WIFI, but I have been browsing the internet for quite a while now and I am still not sure how to set it up.

I thought of having on the robot a WIFI router such as this one, linked via ethernet to an arduino which will control the motors, and also linked via WIFI to an IP motorised camera next to it (I couldn't find such a small router with several ports). I would connect my laptop to the network broadcasted by this router (I can't use my school's network) to send commands to either the camera or the arduino, and retrieve the video from the camera.

Now, I've looked everywhere but couldn't find how I could interface with the camera from my client application on the laptop (C++/Qt/Windows)? OpenCV sounds apropriate for the live stream but what about its motors?


Solution

  • Got it! I sniffed the communication port established with my camera with WireShark (filtered the capture with "HTTP port 99"), and noticed HTTP requests "/decoder_control.cgi?command=0", "/decoder_control.cgi?command=2" etc. After sending them from my browser: "192.168.1.99:99/decoder_control.cgi?command=0" etc., turns out the commands of this IP camera are the same as those at this address, it works like a charm!

    That's too bad though that the speed can't be adjusted (it's set up in the settings, maybe I can dynamically change its value by the same means) but that's a start.

    Thank you for your help in any case, keep the good work that's by far my favorite professional forum.