0

I am using a raspberry pi zero w. The script runs when the pi is manually connected to a computer via a USB. We are viewing the interface with a VNC viewer. The script written is trying to connect to the internet, and once an internet connection has been established it will continue through the rest of the script. When we click run inside VNC, the code works perfectly. We have sent the script to the pi by putting the file under rc.local so that it runs when the raspberry pi is booted up without being connected to the computer. However, the program seems to be getting stuck in the checking internet connection loop and does not connect to the internet. We know it is getting stuck there because we coded in an initial buzzer when the device boots up, and then another buzz when the internet connection has been established. I am unsure why it would work correctly when connected to the computer, and not when it is booting up on the pi.

  • 1
    Welcome! Probably it's only me, but this question is a bit vague. What does "manually connected" mean? "It is trying to connect to the internet" do you mean the script or the RPi? "sent the script to the pi via rc.local" how? "it does not connect to the internet" what error do you get? "when it is booting up on its own" sorry I don't get it. What is the wanted result? If you don't mind please edit your question, but don't add these details as comment. Thanks! – Fabian Apr 30 '18 at 17:29
  • I added some more details to my original question! Any ideas would be greatly appreciated. – I. Patel Apr 30 '18 at 21:16
  • 1
    Correct me if I'm wrong: the 1st buzz (at boot) works. 2nd buzz (at "connection check") not. Both are invoked by the same script. If that's correct, then your script runs on boot. Correct? Then I'd suggest you post the script (if it is too long, upload it on a service like github or pastebin and add the URL to your question). And of course remove security sensitive codes from your script, like credentials, before you post it! – Fabian Apr 30 '18 at 22:52
  • We figured out what our issue was. We had downloaded a dropbox uploader file onto the user pi, but when the pi was running it was using user root. So we had to change in rc.local to make sure the script was being run as user pi and not user root. – I. Patel May 1 '18 at 21:24
  • Please make your comment an answer and accept it. – Ingo May 2 '18 at 18:15
0

@I. Patel wrote in his comment: "We figured out what our issue was. We had downloaded a dropbox uploader file onto the user pi, but when the pi was running it was using user root. So we had to change in rc.local to make sure the script was being run as user pi and not user root."

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.