Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't get server to autostart on boot #18

Open
Regenhardt opened this issue Apr 17, 2022 · 14 comments
Open

Can't get server to autostart on boot #18

Regenhardt opened this issue Apr 17, 2022 · 14 comments

Comments

@Regenhardt
Copy link

Hi,

not sure why, hope you can help me. I followed the tutorial.pdf, but it won't automatically start.
Manually calling sudo python main.py -tn starts the server and works as expected.

After following the tutorial exactly and it didn't work, I manually executed the start.sh and an error was displayed that it couldn't connect to display, which makes sense since I used ssh. So I added -tn to the call in the start.sh and now it works if I call it manually.

Since the point.txt isn't copied to ~ when rebooting, I guess start.sh isn't even being called, but I don't know why.

Here is a screenshot of the actual file contents and ls output to show the executable status:

grafik

@DenzelChen
Copy link
Contributor

DenzelChen commented Apr 22, 2022

@DenzelChen
Copy link
Contributor

4 days ago and zero help. my kit is missing hardware. all signs point to return to amazon asap and look elsewhere. thanks for posting this.

You can also tell me the missing parts and your address. We can send you replacements.

Freenove Support Team
[email protected]

@Regenhardt
Copy link
Author

Oh so the server only autostarts when I login to the desktop? Can't I autostart it whenever I start the raspberry pi?

@lacuna2
Copy link

lacuna2 commented Apr 24, 2022

so the instructions aren't clear.
Where you see ".../pi/..." you should replace with your username.
For me it was ".../Peter/...".

@DenzelChen
Copy link
Contributor

Oh so the server only autostarts when I login to the desktop? Can't I autostart it whenever I start the raspberry pi?
It can autostart when I start the Raspberry Pi. Please check the video again.

@lacuna2
Copy link

lacuna2 commented Apr 24, 2022

no it starts logged in or not

@DenzelChen
Copy link
Contributor

no it starts logged in or not

It can start without login.

@Regenhardt
Copy link
Author

so the instructions aren't clear. Where you see ".../pi/..." you should replace with your username. For me it was ".../Peter/...".

No worries, my user is indeed called "pi" (as you can see in the screenshot).

no it starts logged in or not

When I follow the video exactly, the server only starts when I login to the desktop.
Starting the raspberry pi does not start the server (legs aren't activated).
Logging in using ssh also doesn't start the server.
As soon as I login to the desktop via RDP/VNC the server starts and the legs are activated, just like in the video you linked earlier.

It can start without login.

How? Do I need to add anything that isn't in the video you linked earlier?

@DenzelChen
Copy link
Contributor

Add -tn after sudo python main.py to try.

Add the following contents to “start.sh” file.
#!/bin/sh
cd "/home/pi/Freenove_Big_Hexapod_Robot_Kit_for_Raspberry_Pi/Code/Server"
pwd
sleep 10
sudo cp point.txt /home/pi
sudo python main.py -tn
Press Ctrl + O and then press Enter to save it. Press Ctrl+X to exit.

@Regenhardt
Copy link
Author

As mentioned in my original post, and visible in the screenshot aswell, I did just that - add -tn to the call so it doesn't open the window. Unfortunately nothing happens until I login via RDP/VNC.

To further test this I even tried adding sudo python test.py buzzer to the start.sh just before starting the main.py to have an additional cue, but that one didn't happen either. So I figured it must be the file being called at all, but since I usually don't use Linux I'm a bit lost here.

@DenzelChen
Copy link
Contributor

Can you use the commands to start server without window successfully?

  1. Use cd command to enter directory where main.py is located:
    cd ~/Freenove_Big_Hexapod_Robot_Kit_for_Raspberry_Pi/Code/Server
  2. Run main.py:
    sudo python main.py -t -n
    or Run main,py with following command:
    sudo python main.py -tn

@Regenhardt
Copy link
Author

Yes, this works perfectly fine.

I can also login using ssh and then call sudo ./start.sh and the server starts as expected.

@DenzelChen
Copy link
Contributor

Sorry I don't know the reason. It works here.
I am using Raspberry Pi 4B and following OS:
https://downloads.raspberrypi.org/raspios_full_armhf/images/raspios_full_armhf-2022-04-07/2022-04-04-raspios-bullseye-armhf-full.img.xz

@DiscipulusNakamoto
Copy link

DiscipulusNakamoto commented Oct 11, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants