Changes

Jump to navigation Jump to search

X630-Software

2,426 bytes removed, 13:28, 25 October 2021
Save and exit with ctrl + x, followed by y when prompted to save, and then enter.
5.Reboot your Raspberry Pi to verify that the CAM LED lights up.
sudo reboot
[[File:X630-led.png|X630]]
ls /dev/video0
 
[[File:Raspi-config-3.jpg|800px]]
If you see anything other than ‘file not found‘, then it’s available.
7.Create a script to reset the X630 module
sudo nano reset.sh
enter the following:
8. Reboot your Raspberry Pi
sudo reboot
 9.To take first photo with the X630 Module
sudo bash reset.sh
raspistill -o image1.jpg
Here, "image1" is the name of your image that will be saved to your Raspberry Pi
10.To take second photo with the X630 Module
sudo bash reset.sh
raspistill -o image2.jpg
Here, "image2" is the name of your image that will be saved to your Raspberry Pi.
11.Record first video with the X630 module
sudo bash reset.sh
raspivid -o video1.h264 -t 10000
Here, "video1" is the name of your video and "10000" is the number of milliseconds.
12.Record second video with the X630 module
sudo bash reset.sh
raspivid -o video2.h264 -t 10000
(Please use when operating system cannot control the X630 module via GPIO509)
13.To take a photo with the X630 Module
raspistill -o image.jpg
sudo reboot
15.To record a video with the X630 module
raspivid -o video.h264 -t 10000
Here, "video" is the name of your video and "10000" is the number of milliseconds.
16.If you need to record second video, then you will need to reboot the Raspberry Pi and execute the "raspivid" again
sudo reboot
4. Once rebooted, you need to make sure that the ‘/dev/video0’ device is available. Use this command to check in a terminal window:
ls /dev/video0
[[File:Raspi-config-3.jpg|800px]]
 
If you see anything other than ‘file not found‘, then it’s available.
 
<hr/>
 
'''For Software Reset''' - Starting RASPISTILL or RASPIVID multiple times and no need to reboot Raspberry Pi
 
You can skip to step 12 if you use hardware reset mode;
 
5. Execute CAM GPIO initialization at startup, need to add scripts in /etc/rc.local file.
Run the following two commends;
sudo sed -i '$ i echo "509" > /sys/class/gpio/export' /etc/rc.local
sudo sed -i '$ i echo "out" > /sys/class/gpio/gpio509/direction' /etc/rc.local
sudo sed -i '$ i echo "1" > /sys/class/gpio/gpio509/value' /etc/rc.local
Or
sudo nano /etc/rc.local
Scroll down, and just before the 'exit 0' line, enter the following comment:
echo "509" > /sys/class/gpio/export
echo "out" > /sys/class/gpio/gpio509/direction
echo "1" > /sys/class/gpio/gpio509/value
[[File:Raspi-config-4-1.jpg|800px]]
 
Save and exit with ctrl + x, followed by y when prompted to save, and then enter.
 
6. Create a script to reset the X630 module
cd ~
sudo nano reset.sh
Enter the following:
echo "0" > /sys/class/gpio/gpio509/value
sleep 1
echo "1" > /sys/class/gpio/gpio509/value
Save and exit with ctrl + x, followed by y when prompted to save, and then enter.
 
NOTE:Don't forget the folder where the reset.sh file is located
 
7. Reboot your Raspberry Pi
sudo reboot
 
8.To take first '''photo''' with the X630 Module
 
Return the fold of reset.sh file after restart
cd ~
sudo bash reset.sh
raspistill -o image1.jpg
Here, "image1.jpg" is the name of your image that will be saved to your Raspberry Pi
 
9. To take second '''photo''' with the X630 Module
sudo bash reset.sh
raspistill -o image2.jpg
Here, "image2.jpg" is the name of your image that will be saved to your Raspberry Pi
10. Record first '''video''' with the X630 module
sudo bash reset.sh
raspivid -o video1.h264 -t 10000
Here, "video1" is the name of your video and "10000" is the number of milliseconds.
11. Record second '''video''' with the X630 module
sudo bash reset.sh
raspivid -o video2.h264 -t 10000
Here, "video2" is the name of your video and "10000" is the number of milliseconds.
 
'''Note''': "sudo bash reset.sh" is always required to execute before starting RASPISTILL or RASPIVID. the CAM LED will go off for 1 second then turn on.
<hr>
'''For Hardware Reset''' - Starting RASPISTILL or RASPIVID once then reboot your Raspberry Pi

Navigation menu