MrJoshua
Posts: 4
Joined: Tue Oct 28, 2014 12:32 am

Rc.local edit - 'can't cd to' error on boot....

Tue Oct 28, 2014 12:48 am

Hi guys

I've just very recently got my first pi and have meddled around a bit trying a couple of different things like the pi arcade and so on. I love it.
I've currently got Raspbian installed along with wiringpi in order to use the lapsepi timelapse program, in conjunction with the pitft touchscreen. I can run the program fine and it works great but here's where I have run into what is almost certainly a really stupid noob problem.

I am trying to get the pi to boot straight to the lapsepi software since this will be the purpose of this pi (and I'll get another to mess with), and have been following the edits to rc.local specified here:

http://lapse-pi-touch.readthedocs.org/user_guide.html

This is to add in these two lines, prior to the end of the rc.local file:

Code: Select all

cd /home/pi/LapsePiTouch
python lapse.py
The problem I get though is that when attempting to boot up, I get an error "Can't cd to /home/pi/lapsepitouch" and I cannot find the correct way to resolve this. I assume this will be some sort of user/permissions issue but I don't understand quite what. I'm afraid I'm very new to Linux and trying to learn terminal etc but have a long way to go.

I did try as an alternative to forget about the cd command, and instead to specify the absolute path when launching lapse.py script. This almost worked as it tried to, but then fails as the code of the script is I think referring to folders/directories that it would be expecting to find, assuming the current directory had been changed. I'd rather not have to try and find every such reference in the script and attempt to adjust them all, when I'm sure I must be overlooking something basic for why the cd command isn't working?

Would really appreciate a point in the right direction if someone could be so kind please?

Many thanks indeed! ;)

User avatar
rpdom
Posts: 15196
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Rc.local edit - 'can't cd to' error on boot....

Tue Oct 28, 2014 7:43 am

/home/pi/LapsePiTouch is not the same as /home/pi/lapsepitouch. The capitalisation is important. Check that the name of the directory and the name on the cd command match *exactly*.

MrJoshua
Posts: 4
Joined: Tue Oct 28, 2014 12:32 am

Re: Rc.local edit - 'can't cd to' error on boot....

Tue Oct 28, 2014 8:43 am

Thanks for the suggestion. I wasn't sure if case mattered so thanks for clarifying.

I'm pretty sure I tried both as its written on the web page, and in lower case and neither worked, but it's quite possible I guess that the directory itself is written differently.

I'll check when I get home from work. I'll be very pleased if it's that simple!! :)

MrJoshua
Posts: 4
Joined: Tue Oct 28, 2014 12:32 am

Re: Rc.local edit - 'can't cd to' error on boot....

Tue Oct 28, 2014 8:46 am

I'm also trying to get wifi working on it, but it's proving a pain as I can't get hdmi to work after about half way through booting up as I assume it decides the outfit screen is all that's required.

Makes it hard to set things up on such a tiny screen as I can't move beyond what's visible on that portion of the desktop.
Tried editing a file last night to get it to always enable hdmi, but it still stops outputting to it half way through booting so I must have messed up.

DirkS
Posts: 9940
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Rc.local edit - 'can't cd to' error on boot....

Tue Oct 28, 2014 12:17 pm

MrJoshua wrote:I'm also trying to get wifi working on it, but it's proving a pain as I can't get hdmi to work after about half way through booting up as I assume it decides the outfit screen is all that's required.

Makes it hard to set things up on such a tiny screen as I can't move beyond what's visible on that portion of the desktop.
Tried editing a file last night to get it to always enable hdmi, but it still stops outputting to it half way through booting so I must have messed up.
This is an unrelated problem and it's best to create a new topic for that. It gives you the best chance of getting help

Gr.
Dirk.

MrJoshua
Posts: 4
Joined: Tue Oct 28, 2014 12:32 am

Re: Rc.local edit - 'can't cd to' error on boot....

Wed Oct 29, 2014 8:43 pm

Thanks guys

Update - I scrutinised the directory and the code and yes, embarrassingly it was a case error!
At least I know now to be wary in future so a useful lesson learned I guess.

Sorry to ask about such a basic thing though in hindsight, and thanks for the help! :D

tbd.pi
Posts: 34
Joined: Sat Aug 11, 2012 11:21 am
Location: NJ,USA
Contact: Website

Re: Rc.local edit - 'can't cd to' error on boot....

Wed Oct 29, 2014 8:53 pm

You shouldn't apologize for asking questions, we all have to start somewhere and that's a really simple one to fall foul of, especially if you're from a none *nix world.

Kardal
Posts: 3
Joined: Wed Oct 29, 2014 8:04 pm

Re: Rc.local edit - 'can't cd to' error on boot....

Thu Oct 30, 2014 5:38 am

Also, when starting programs from rc scripts, you can use python /path/to/dir/Program
cd to a directory is seldom used in these cases

Return to “Troubleshooting”