Hi
It is possible to schedule the Raspberry pi take a stitched photo from the Theta V via usb and send this by FTP?
If so, any tutorial or clues?
Appreciate any help!
Regards
Kristian
Hi
It is possible to schedule the Raspberry pi take a stitched photo from the Theta V via usb and send this by FTP?
If so, any tutorial or clues?
Appreciate any help!
Regards
Kristian
It’s covered in this video tutorial series, but I just realized that I have so much content scheduled that the video is scheduled for June 4. It uses scp with keys, but the concept is the same.
This other playlist has related information.
This may be useful.
Example
Feel free to ask more questions.
Also, please provide information on your platform
The information may help us to point you in the right direction.
Thank you for your replay!
Due to limited dataplan I’m planning to let the Raspberry pi take a stitched photo from the theta V and upload this to an server every five minute. The server is either private hosted or cloud hosted. I’m flexible regards the transfer method.
The photo should be shown on a website for the public.
Is this an task covered by the videos you attached?
Regards
Kristian
Please advice if you want to use the USB cable to send the API commands.
Get the tool we use for testing at this site:
Get the file raspberry_pi_theta.zip
It is best to download it from a desktop Mac/Linux/Windows computer and then transfer it to the Raspberry Pi as the RPi browser is slow on my system.
Once the file is on the RPi, unzip the files.
{1..500}
will take 500 pictures and upload each picturesleep 10s
and uncomment sleep 5m
. A comment has a #
mark in front of itecho start timelapse photography loop test
# example of loop to take 2 pictures for timelapse
# increase the number 2 below to 300 to take 300 pictures
# example {1..300}
for counter in {1..5}
do
./theta takeAndDownload
echo that was picture $counter
((counter++))
# if you want to have the timelapse space 30s apart
echo waiting 10 seconds for the next shot
sleep 10s
# if you want to take a shot every 5 minutes
# sleep 5m
done
echo timelapse done
# grab all the thumbnails and write to local storage
./theta download --thumb=all
echo thumbnail download test completed
echo *** Will Start Upload to Digital Ocean Hosting ***
scp -r *.JPG craig@45.55.31.80:/home/craig/robot/
echo completed upload
echo go to http://45.55.31.80/robot/ to view images
If you are making a video on the server, you may want to disable topbuttomcorrection
Hi
I have just ordered my Theta V and I will start testing this as soon I got it.
Thank you for all your help!
Kristian
Just to recap, there are two different ways to connect the Raspberry Pi and the RICOH THETA:
The software and APIs are different in each case. The THETA V can handle both methods.
The USB API is more difficult to set up. If you can use the Wi-Fi API, it might be better, especially initially. You will need to disable auto-power off and auto-sleep in the camera.
For long-term use, most people use the USB API, but as it could be more difficult for you to set up, it might be good for phase 2 of your project.
The choice depends on your goal and how much time you’re able to spend with configuration.
Hi craig
You are spot on!
I will try the “easy” method with wifi, as you explained, first. But at the end maybe try to get the USB API to work for a more stable setup.
Kristian
If you use the Wi-Fi API, there are two methods:
I suggest you use AP mode. If you use Client Mode, you must use Digest Authentication, which is possible, but not covered with our test application.
If you use AP mode (recommended approach to start with), then your Raspberry Pi must have two network interfaces (such as an onboard Wi-Fi plus an USB Wi-Fi adapter).
In this configuration, your Internet router must not be at 192.168.1.1. If your Internet router is at the same IP address as the camera, the RPi will not be able to find the camera reliably. You will need to change the IP address of your router or set up a different router for your RPi network.
With two network interfaces, you may need to manually set up the routes on the Raspberry Pi the first time. To help with configuration, you may need to plug a monitor and keyboard onto the raspberry Pi and see how the network routing is setup initially. Once you set up the network routing for each interface manually and verify that it works, then go back and create a script to automate this at startup.
As there is a large RPi community, you can likely find detailed up for the RPi network route setup on the RPi forums.
If you have time, please post your progress on this forum. There is a good body of knowledge here on the camera API, but we are not that familiar with the RPi. It will be good to get more RPi project builds.
Hello,
You can use gphoto2 to take photo (equirectangular) via USB and download the picture on the Rpi. Sending it to a ftp should be done on the Rpi in a second step
Here is an example how to take picture and download it via command line. Note that the picture is not deleted from the theta. This command line is executed in a python program but use your prefered language
gphoto2 --set-config=/main/other/5013=1 --capture-image-and-download --filename “/home/pi/photo.jpg” --force-overwrite
You may need to configure the photo parameters in a previous step and switch to photo mode
Hugues
Nice tip!
What does the config below set?
I don’t normally use gphoto2 on Raspberry Pi, but I will try using it more now.
Hi
I finally got some time to try to get my project going.
My Theta V is connected to the Rpi via USB-cable. And I use this code to take a photo and upload it to a ftp-server.
sudo gphoto2 --set-config=/main/other/5013=1 --capture-image-and-download --filename /home/pi/Pictures/photo.jpg --force-overwrite
curl -T /home/pi/Pictures/photo.jpg ftp://ftp_server_adress//www/photo.jpg --user username:password
But I have some questions;
*Is it possible to chage the picture quality or size, either from camera or in the code?
*Can I remove the battery from the Theta V so the camera is just powered from the Rpi?
So the camera will start and shut off when the Rpi is started/shut off?
*Can gphoto2 also be used with the Theta SC2?
Regards
Kristian
yes.
If you want greater control of the image size on the RPi before you transfer it, use something like ImageMagick on the RPi before you push the images up to your server.
You cannot remove the battery and power it from the Raspberry Pi, at least not easily. You would need some additional electrical skills and would likely need to add a resistor to the THETA V power circuit to compensate for the battery not being there. There are no working directions on this process, but there are “it should work in theory” instructions if you’re interested in a hobby hack and have time. Let me know if you want me to search for that info on the electrical characteristics of the power circuit.
You can turn the THETA V off with the RPi.
$ ptpcam -R 0x1013
You can power it on by cycling the power on the USB ports. Let me know if you want details on this.
If you turn the RPi on, the V will turn on through the USB cable.
yes.
The SC2 and the V are slightly different, but the USB API is the same specification. There may be some differences in actual use. If you buy an SC2, buy it from a place with a return policy just in case it does not perform as expected.
Hi
Thank you for all your help!
I have now manage to resize and timestamp the photo with ImageMagic! I’m very happy with that!
My focus now is the powering of the camera. I’ts important for my project that I manage to power the camera on/off with the power from the USB.
So if there is any directions how to do this I will appreciate some info!
Thank you for the update.
Power off
$ ptpcam -R 0x1013
Camera - RICOH THETA Development on Linux
Camera - RICOH THETA Development on Linux
Camera - RICOH THETA Development on Linux
You may be able to use the same technique used on the Raspberry Pi.
https://github.com/codetricity/hub-ctrl.c
Note that wake from sleep is not currently working with the V, but does work from the Z1.
Hi Craig
I have tried your solution for power on the Theta V with Raspberry Pi. But my lack of knowledge of programming of the pi I need some guidence how to do this.
I will appreciate if you can explain the process step by step.
Kristian
For the V, I don’t think you can change the image resolution.
There is no known way to remove the battery from the V and have it turn on like a webcam when the Raspberry Pi is turned on. You can:
Plug the camera into the Raspberry Pi when the camera is off. Then, you will see that it turns on.
I believe that gphoto2 will work with the SC2.
If you can download the files to the Raspberry Pi with the USB cable, you can reduce the file size on the RPi.
Additional examples of processing with GraphicsMagick, which is like ImageMagick.
The idea is for you to write a bash script for the RPi that uses ImageMagick to reduce the file size before you transfer it to the cloud.
Hi,
Thank you for all your help!
For the problem with the powering the theta from the Rpi, it this I need help with…
Can you direct me further?
Please confirm that the camera is in a power off mode and not in sleep mode. If you are trying to wake it up from sleep, there is additional information I can send. If you are turning it on from a power off state, see the tip below from Shun Yamashita of fulldepth.
Thanks to Shun Yamashita of fulldepth for this solution to cycle the power on the Raspberry Pi 4 USB ports, which has the effect of turning the THETA Z1 on when it is plugged in with a USB cable.
Shun reported that with the Raspberry Pi 4, the script above did not work. He wrote the script below for the RPi 4 which does work.
#!/bin/bash
ptpcam -R 0x1013
/usr/local/bin/hub-ctrl -h 0 -P 1 -p 0
/usr/local/bin/hub-ctrl -h 0 -P 2 -p 0
/usr/local/bin/hub-ctrl -h 0 -P 3 -p 0
/usr/local/bin/hub-ctrl -h 0 -P 4 -p 0
/usr/local/bin/hub-ctrl -h 1 -P 1 -p 0
/usr/local/bin/hub-ctrl -h 1 -P 2 -p 0
/usr/local/bin/hub-ctrl -h 1 -P 3 -p 0
/usr/local/bin/hub-ctrl -h 1 -P 4 -p 0
/usr/local/bin/hub-ctrl -v
sleep 5
/usr/local/bin/hub-ctrl -h 0 -P 1 -p 1
/usr/local/bin/hub-ctrl -h 0 -P 2 -p 1
/usr/local/bin/hub-ctrl -h 0 -P 3 -p 1
/usr/local/bin/hub-ctrl -h 0 -P 4 -p 1
/usr/local/bin/hub-ctrl -h 1 -P 1 -p 1
/usr/local/bin/hub-ctrl -h 1 -P 2 -p 1
/usr/local/bin/hub-ctrl -h 1 -P 3 -p 1
/usr/local/bin/hub-ctrl -h 1 -P 4 -p 1
/usr/local/bin/hub-ctrl -v