Jetson autorun

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

  1. Is it right to use ‘Startup Application’ like this?
    2.What can I do if not that way?

1

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,

You can follow this comment to add your python app into systemd:

Thanks.

Hello!

I have a question about Crontab.

I want to run the jetson-inference code (https://github.com/dusty-nv/jetson-inference/blob/master/docs/pytorch-collect.md) 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 (https://www.youtube.com/watch?v=bcM5AQSAzUY&t=1181s)

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