Skip to content

Latest commit

 

History

History
81 lines (57 loc) · 3.88 KB

How_to_Raspberry.md

File metadata and controls

81 lines (57 loc) · 3.88 KB

How to run InstaPy on a RaspberryPi

NOTE: If you add an empty file named ssh to the boot directory, ssh will be enabled when you first start your RPi (more info on the official website - section 3 - here). If you do this, you can connect your RPi via ethernet, ssh in (once you have your ip) and skip right to the update step below (step 7). If you do not want to do this, follow the initial setup instructions to connect peripherals below.

  1. connect rpi3 to monitor via HDMI
  2. connect internet via cat5
  3. insert usb for wireless keyboard and mouse (if using)
  4. plug in rpi3 with sd card preloaded with NOOBs
  5. select country & install Raspbian
  6. open terminal --> sudo raspi-config -->interfacing options --> SSH -->enable (allows ssh connection from MacBook); then navigate to VNC --> enable (allows GUI access)
  7. sudo apt-get update && sudo apt-get upgrade
  8. mkdir Projects
  9. cd Projects
  10. git clone https://github.com/timgrossmann/InstaPy.git
  11. cd InstaPy
  12. sudo pip install . (encountered some errors and resulting 3 commands below (13-15), all may not be necessary)
  13. sudo apt-get build-dep python-imaging
  14. sudo apt-get install libjpeg8 libjpeg62-dev libfreetype6 libfreetype6-dev
  15. sudo pip install .
  16. sudo apt-get install tightvncserver (to view GUI from MacBook)

For Chrome

This assumes you're using the latest version of raspbian (stretch). Note that this works best running headless.

  1. Switch to the root user sudo su
  2. Update apt source lists echo "deb http://security.debian.org/debian-security stretch/updates main" >> /etc/apt/sources.list
  3. Update apt-get update
  4. Install the browser apt-get install chromium-browser
  5. Install the driver apt-get install chromedriver
  6. Move the driver into the InstaPy/assets directory mv /usr/bin/chromedriver /path/to/InstaPy/assets/chromedriver

For Firefox

Remove any versions of Firefox as it will conflict with the correct one installed below:

  1. sudo apt-get remove firefox-esr
  2. sudo apt-get remove iceweasel
  3. sudo apt-get remove firefox

found the following commands to install Firefox here; https://www.q4os.org/forum/viewtopic.php?id=912

  1. echo 'deb http://q4os.org/qextrepo q4os-rpi-firefox-cn main' | sudo tee /etc/apt/sources.list.d/qextrepo.list
  2. wget -nv -O- http://q4os.org/qextrepo/q4a-q4os.gpg.pub | sudo apt-key add -
  3. sudo apt-get update
  4. sudo apt-get install firefox

Update GeckoDriver if needed. Instructions at the end of this document.

Firefox is not currently working correctly on Pi 2, to install a working version the following commands should be used:

Pi2.1. wget https://launchpad.net/~ubuntu-mozilla-security/+archive/ubuntu/ppa/+build/10930950/+files/firefox_49.0+build4-0ubuntu0.14.04.1_armhf.deb

Pi2.2 sudo dpkg -i firefox_49.0+build4-0ubuntu0.14.04.1_armhf.deb

Finishing Up

Encountered some errors when trying to run the quickstart.py and ran the next 3 commands (all may not be necessary)

  1. sudo pip install future
  2. sudo apt-get install xvfb
  3. sudo pip install pyvirtualdisplay
  4. sudo reboot (may not be required, but no harm)

Assuming you've modified quickstart.py to your liking and added your Instagram login to instapy.py

  1. sudo xvfb-run python quickstart.py

I installed TMUX to help run this headless, so that I can disconnect from the session and have the program continue to run on the rpi3

  1. sudo apt-get install tmux (more info found here: https://github.com/tmux/tmux)

  2. If using firefox, follow the example seen in examples\firefoxExample.py to set the default browser as Firefox

How to update GeckoDriver on Raspbian

New releases can be found in https://github.com/mozilla/geckodriver/releases

  1. wget https://github.com/mozilla/geckodriver/releases/download/v0.18.0/geckodriver-v0.18.0-arm7hf.tar.gz
  2. tar -xvzf geckodriver-v*
  3. chmod +x geckodriver
  4. sudo cp geckodriver /usr/local/bin/