Now that we have our Zybot set up and the firmware installed, we can set up our server script and get our webcam working! This is part of the Zybot collaboration, so be sure to check out the other Instructables. The previous instructable is here. (Setting Up the Zybot-Software)
The plan for this Instructable is to have the webcam send a "video" to an IP address. That way a computer that's on the same server can view what the robot sees.
Note: If you have your WIFI adapter plugged in, be sure to unplug it while your are connected to the Ethernet Cable.
Open up your terminal, and enter the commands:
sudo apt-get update
sudo apt-get install linux-firmware motion
Step 1: Putting the files into Home
When you boot up your ZYBO and it gets to the main screen, a disk symbol should pop up, this is the ZYBO_BOOT partition in the Micro SD card. Open up your folders and drag and drop files.zip into the Home folder. Then extract into home.
Step 2: Building your server and motion file
Now that the Micro SD card is plugged back into the ZYBO, we want to build server.cpp.
Step 3: Replacing the motion.conf file
Now we are going to replace our motion file. To do this we want to run the following commands:
This will change the motion.conf to transmit to a specified web address. To find this web address enter the command ifconfig.
Look for the wlan0 line, then the inet addr: line and that will give the IP address to use. Now you can go onto any Firefox browser and enter that IP address (add :8081 at the end of the address) and see what your Zybot sees.
Step 4: Putting the server_script file into init.d
The last thing we want to set up is the script. Just like replacing the motion file, all we have to do is run rsync again.
This will create a copy of the server_script file and place it into init.d.
Step 5: Building everything
The last thing we have to do is update everything, that way all the changes we made will take effect.
Run the following commands:
Now restart your Zybo, and everything should be running!
We can move onto the next Instructable in the collection! (Setting up the Zybot - Power Considerations)