I’d like to have Python files run automatically when I turn on the Jetson TX2.
hyebin@hyebin-desktop:~/project/tensorrt_demos$ python3 trt_ssd.py --model ssd_mobilenet_v2_face --usb --vid 1 --width 1280 --height 720
I will use these commands.
I’ve tried Startup Application.
And I put this command in the command line.
python3 /home/hyebin/project/tensorrt_demos/trt_ssd.py --model ssd_mobilenet_v2_face --usb --vid 1 --width 1280 --height 720
Is it right to use ‘Startup Application’ like this?
2.What can I do if not that way?
I also used ‘crontab -e’. If I type crontab -e, that window pops up. I wrote the command command on the bottom line like that.
@reboot /usr/bin/python3 /home/hyebin/project/tensorrt_demos/trt_ssd.py --model ssd_mobilenet_v2_face --usb --vid 0 --width 1280 --height 720
I saved it and rebooted it, but there is no result.
Please let me run that script as soon as I boot up.
hi @gpqls7669 , This may help you out.
Hi all,
I have a question.
How to auto-run shell script made by me when system is booted.
The source version is R28.1 and, OS is ubuntu 14.04
Could you let me know your idea?
Thanks & BR,
Hi,
You can follow this comment to add your python app into systemd:
How to make something run on boot with systemd systems:
Create a file named “/usr/local/bin/mything.sh” with the commands you need to run on start:
$ sudo nano /usr/local/bin/mything.sh
...
$ sudo chmod +x /usr/local/bin/mything.sh
Create a file called “/etc/systemd/system/mything.service”
In this file, put this text:
[Unit]
Description=mything: do my own thing
After=multi-user.target
[Service]
ExecStart=/usr/local/bin/mything.sh
Restart=always
StartLimitInterval=10
RestartSec=10
[…
Thanks.
Hello!
I have a question about Crontab.
I want to run the jetson-inference code (jetson-inference/pytorch-collect.md at master · dusty-nv/jetson-inference · GitHub ) when I start jetson. So I used crontab and I get an error.
When I looked at the log, I saw the following error.
display = jetson.utils.glDisplay()Exception: jetson.utils -- failed to create glDisplay device
I don’t know what caused this error.
By the way, I will run into the same error if I did with the other jetson-inference examples. For example this one (Real-Time Object Detection in 10 Lines of Python Code on Jetson Nano - YouTube )
Furthermore, nvgstcapture was able to automatically start the camera, so I think that the reason why crontab does not work is in jetson.utils.glDisplay.
If you know the cause, can you tell me.
Thanks for the great demo code.
Thank you