Detect GPIO pins on boot and make decision accordingly

@WayneWWW
I configured it through:
“Preferences”->“Users and Groups”->“Password”->Change->“Don’t ask for password on login”->“OK”

@WayneWWW
Ok, so I think I know what is causing the problem,in the case where the GUI is required, after the system boots and the service runs the shell script I was starting the gui session through: “systemctl start gdm3.service” and I was always asked to login through using the password. So I reset “systemctl set-default graphical.target” and I am no longer asked for a password after booting in GUI.
However, I am back to my original problem, if I set the system to normally start in gui mode how can I ask it to go to console (something like “systemctl start gdm3.service” but for console) ?
and also, even though I am no longer prompt to enter a password, I am not able to display the camera output on the screen after start up(“cannot open display”), any ideas?
one more thing, if don’t have a display connected and I start a gui session, will that add the display load on the system, computationally speaking ?

You can disable gdm3 service and it can make it enter console.

I don’t know what kind of camera framework you are using. export DISPLAY=:0 is required for argus camera case.

Also, to make this env work, the Xserver is needed. Which means gdm3 is needed. Our graphic driver supports to have no monitor connected case. You can use devkit to check it. For example, gdm3 is still running even when you have no monitor connected.

@WayneWWW
My problem is that when I start a gdm3 gui session using “systemctl start gdm3.service” auto login doesn’t work, and when I am in the normal gui session using “systemctl stop gdm3.service” doesn’t work.
I found that using Ctrl+ALT+F3 gets me to console mode, is there a command that can also do that ?
As for the framework used, I am running a python application which displays some output to the screen using Opencv ("cv2.imshow). Is there no way I can get this application to display its output on the screen after startup without Xserver?

@WayneWWW
Also, In the case where no monitor is connected, will the graphic driver still be rendering the display ?
Sorry if my English isn’t great…

“systemctl stop gdm3.service” doesn’t work.

You mean it didn’t go into console?

Also, In the case where no monitor is connected, will the graphic driver still be rendering the display ?

The app that uses GPU to do the work will still run. But no monitor means no display.

@WayneWWW
Correct, the system will not enter console mode if it is not initiated through gdm3.service

Please also run this after you disable gdm3.

sudo loginctl terminate-seat seat0

@WayneWWW
Running :
“sudo systemctl stop gdm3.service” and/ or “sudo systemctl disable gdm3.service”
followed by :
“sudo loginctl terminate-seat seat0”
took me back to the login screen in gui mode.

I am not sure what happened on your side. But this is the method that was validated by us and other customers also.

Only step 1 for your case. The rest is for enabling Weston. Not related ot your issue.

@WayneWWW
That’s weird…
I was able to stop and start the display using “sudo init 3” and “sudo init 5” , and I think it’s enough in my case for now.
Back to my other question, Is there no way I can get the python application to display its output on the screen after startup without Xserver?

Thank you some much for your assistance.

This depends on what kind of framework your python app is using to render something to the screen.

If the reason you disable gdm3 and still want to render something is just because of the Ubuntu desktop, then you can still run startX or xinit int the background. Which will enable Xserver but no GUI.

@WayneWWW
Ok, so lets say I am starting my system normally with a gui and the password is disabled (but the login screen still needs me to press “enter”).
How can my python application display its output using Opencv (cv2.imshow) on the screen after startup ?
Is there any way to bypass the login screen?
The application can be delayed a little if that helps…

I am still not sure why “login screen” is the concern here. Is your systemd service got stuck by the “login screen” here?

Also, what kind of “login screen” we are talking about here? Is that on your HDMI screen under console mode or GUI mode?

@WayneWWW ,
My concern with the login screen is that “I think” it’s not allowing me display my output using Opencv, After I login the app runs fine, and displays as expected,however I need the application to display its output on the screen automatically after startup.
I am talking about the Gui login screen.
I tried the solution of this thread, but I am still stuck on the login screen:

@WayneWWW
Nvm, I was able to enable auto-login by adding the following two lines to “/etc/lightdm/lightdm.conf” :
autologin-user=jetson
autologin-user-timeout=0

So my system is entering the desktop screen, but the app is failing to output the images on the screen, knowing that another application (which doesn’t need to display) works just fine.
If I run the application manually it also works fine, but it’s failing to run automatically on startup.
“sudo systemctl status mysthing.service”
gives: "python3[6574]: cannot open display " as an error

@WayneWWW
I also tried adding a 15 second delay before starting the python application, which did not work.

@WayneWWW
@kayccc
@JerryChang
Any idea why the app is failing to open the camera after power up ?

I found the solution here:

Thank you for your assistance.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.