I am trying to set up a script on a new Pi Zero W that was previously working on my Pi 3 B. It seems the hardware may be causing the issue as simply moving the whole operating system etc over to the new pi causes this issue. There are no other changes.
I have tried looking at my Chrome and chrome driver version and matching it up. I am also using the ARMhf version of chrome driver found here https://launchpad.net/ubuntu/trusty/+package/chromium-chromedriver.
My full code set for the project is here https://github.com/RemakingEden/ski-lodge-tv-slideshow and the relevant code is
import sys
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.action_chains import ActionChains
import time
import schedule
import os
url1 = 'http://niseko.nadare.info/'
url2 = 'https://www.windy.com/?43.044,141.348,5,i:pressure,p:off'
url3 = 'https://www.niseko.ne.jp/en/niseko-lift-status/'
intervalAmount = 45
chromeDriverLocation = "/usr/lib/chromium-browser/chromedriver"
timeToSwitch = "09:00"
vlcPlaylistDirectory = "/home/pi/snowFilms"
options = Options()
options.add_argument("--kiosk")
options.add_argument('disable-infobars')
driver = webdriver.Chrome(chromeDriverLocation,
chrome_options=options)
As this works on the Pi 3 B I would expect it to work on the Zero however on the Zero I get the error
Traceback (most recent call last):
File "/home/pi/python/ski-lodge-tv-slideshow/skiLodge.py", line 24, in <module>
driver = webdriver.Chrome(chromeDriverLocation, chrome_options=options)
File "/home/pi/.local/lib/python3.5/site-packages/selenium/webdriver/chrome/webdriver.py", line 73, in __init__
self.service.start()
File "/home/pi/.local/lib/python3.5/site-packages/selenium/webdriver/common/service.py", line 98, in start
self.assert_process_still_running()
File "/home/pi/.local/lib/python3.5/site-packages/selenium/webdriver/common/service.py", line 111, in assert_process_still_running
% (self.path, return_code)
selenium.common.exceptions.WebDriverException: Message: Service /usr/lib/chromium-browser/chromedriver unexpectedly exited. Status code was: -4
Selenium is version 3.141.0
Chromium is 65.0.3325.181
Chromedriver is 65.0.3325.181
I have looked everywhere to find the list of status codes and what they mean. If anyone has them or knows how to help it would amazing.
Thank you.
After a lot of looking around I have not found the meaning of the -4 code however I have found a solution for myself.
sudo apt-get update && sudo apt-get -y upgrade
As I had already updated I presume it was the upgrade that made the difference. If this does not work for you I found a big discussion and some instructions for people who had the same problem with a different application. You could follow the instructions there to see if those help. https://github.com/timgrossmann/InstaPy/issues/4033#issuecomment-466491400
Don't forget to get the correct armhf version of chromedriver I have linked above in my question and ensure all chrome versions match. Good luck, Selenium is not easy on the Pi but it is possible.