[Tutorial]Octoprint Time-lapse with Go pro4 sliver

Post Reply
William
Site Admin
Posts: 31
Joined: Fri May 10, 2019 11:40 pm

[Tutorial]Octoprint Time-lapse with Go pro4 sliver

Post by William » Tue Jun 04, 2019 10:08 am

Hi, guys!
Today I will show you how to use the gopro4 for octoprint time-lapse.
First of all, if you don't know the octoprint.
Refer to it:
https://octoprint.org/
Octoprint allows remote control, printing, and monitoring.

Ok, here we go!

Step1:
You need to prepare these:
1. Raspberry3/3 b+(Raspberry Pi 1, 2 also ok)
2. Micro USB cable
3. 4GB tf card or a larger one
4. Power supply can provide 5V/2A phone charger
5. Gopro 4(Black or sliver)
6. Ethernet jack

Step2:
You can refer to this video to install the octoprint to your raspberry pi
https://www.youtube.com/watch?v=MwsxO3ksxm4

Words:
1. Download the octoprint
https://octoprint.org/download/
2. Check the MD5 of it correct or not
3. Use the win32 disk imager or other tools
write the img files to your tf card
4. Plug ethernet jack to raspberry pi
5. Plug the tf card to your raspberry pi,plug power supply to your raspberry pi

Step3:
1. Get the IP address of your raspberry pi
You can refer to this video:
https://www.youtube.com/watch?v=6ccvEjRHE_Q

Or here is a simple way to get it:
Use the HDMI cables to connect the pi and LCD display then you can use see it on your LCD display.

2. You need to use the toolkit to connect your pi on remote mode
1) Secure CRT
2) Xshell6
3) putty
Refer to this pic then enter your pi address
putty.png
putty.png (28.75 KiB) Viewed 611 times
3. Click yes or save when the windows show a warning.
Enter your pi default user name+password
User name: pi
Password: raspberry
Step4:
1. Install python3.6.1 to your raspberry pi
1) Install the environment of the python

Code: Select all

sudo apt-get install build-essential libsqlite3-dev sqlite3 bzip2 libbz2-dev
2) Install the python3.6.1

Code: Select all

wget https://www.python.org/ftp/python/3.6.1/Python-3.6.1.tgz
tar zxvf Python-3.6.1.tgz
-----------------------------------------------------------
-----------------------------------------------------------
3.

Code: Select all

cd Python-3.6.1
 sudo ./configure
 sudo make
 sudo make install
3)Check python3.6.1 install

Code: Select all

ls -al /usr/local/bin/python*
Step5:
Add the time-lapse plugin on your octoprint+set the profile for your printer
Refer to this video:
https://www.youtube.com/watch?v=BhiJua0q2Cs

Step6:
1.Set the"install-gopro-py-api.sh" to nano
Re-connect your pi via putty
Enter:

Code: Select all

sudo nano install-gopro-py-api.sh
Then copy these command lines and pasted into nano:

Code: Select all

#!/bin/bash

echo
echo
echo "gopro-py-api install script for Octopi/Octoprint"
echo
echo

##########################################
# asksure() function found on :
# https://stackoverflow.com/questions/2...
asksure() {
while read -r -n 1 -s answer; do
  if [[ $answer = [YyNn] ]]; then
    [[ $answer = [Yy] ]] && retval=0
    [[ $answer = [Nn] ]] && retval=1
    break
  fi
done

echo # just a final linefeed, optics...

return $retval
}

### using it
echo
echo
echo
echo -n "This will install gopro-py-api. Do you want to proceed (Y/N)? "

if asksure; then
 echo "Installing gopro-py-api"
else
 echo "Aborting installation..."
 exit
fi

echo "Installing gopro-py-api..."
echo
echo

git clone http://github.com/konradit/gopro-py-api
cd gopro-py-api
sudo python3 setup.py install
Use your keyboard enter"ctrl+o" >"enter">"ctrl+x"
Quit it

2. Enter these commands:

Code: Select all

sudo chmod +x  install-gopro-py-api.sh
./install-gopro-py-api.sh
3. You need to turn on the wifi function of the gopro4
Reboot your raspberry pi(Power off and then power on)

Step7:
1.Test the Gopro4 sliver work or not
Open the putty and log in.
Enter these command lines:

Code: Select all

  python3
  from goprocam import GoProCamera, constants
  gopro = GoProCamera.GoPro()
  gopro.take_photo()
  exit()
Your go pro should wake up and take a photo then it means successful
2.Enter these command lines:

Code: Select all

cd /home/pi/gopro-py-api
nano gopro_take_photo.py
Copy these commands lines and pasted into nano:

Code: Select all

python3 /home/pi/gopro-py-api/gopro_take_photo.py
Save it and exit
Don't forget to give it permission:

Code: Select all

chmod +x gopro_take_photo.sh
3. Open the octoprint
Enter IP address on your browser
Refer to this pics:
octoprint_1.png
octoprint_1.png (64.55 KiB) Viewed 606 times
octoprint_2.png
octoprint_2.png (122.04 KiB) Viewed 606 times
octoprint_3.png
octoprint_3.png (245.81 KiB) Viewed 606 times
When octoprint window shows "Sucess"
Then copy "/home/pi/gopro-py-api/gopro_take_photo.sh"
to "Before snapshot script" and save it
4. Enjoy it

Post Reply