1

I have a very odd problem and any help would be greatly appreciated.

I am running a version of this: https://learn.adafruit.com/dht-humidity-sensing-on-raspberry-pi-with-gdocs-logging/overview

When I run it manually with sudo python google_spreadsheet.py, it works fine. This works both in the desktop and the console. However using rc.local to run on startup I get an error 2, saying that the .json file does not exist or cannot be found. Obviously it is there, since it works when running manually. All other parts of the program work, it just won't connect to google.

Perhaps I should be using a different method to start it at startup?

Again, thanks a lot.

  • 1
    I've got a niggling feeling that it can't find the file as it's held remotely and your network interface isn't up at that point. This walkthrough has an outline on how to run things after networking becomes available. If your file's network dependent it may also be an idea to put something together to deal with the network failing as well (look at the ifup/ifdown commands). – goobering Apr 28 '16 at 13:26
2

rc.local runs with / as its cwd, and almost certainly you are not cd-ing to the directory where the json file lives and/or not accessing it with a fully-qualified path name.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.