#trying to get ender 3 v2 screen on raspberry pi to run on boot

114 messages · Page 1 of 1 (latest)

desert mauve
#

Trying to get it to run on boot, it wont do so, and ive executed all commands, one thing i saw tho was that the simplelcd.service would not start. The screen works when i manually do the commands tho, heres the journalctl
Aug 23 18:08:42 carterpi systemd[1]: simpleLCD.service: Failed with result 'exit-code'.
Aug 23 18:08:43 carterpi systemd[1]: simpleLCD.service: Scheduled restart job, restart counter is at 2.
Aug 23 18:08:43 carterpi systemd[1]: Stopped simpleLCD.service - My LCD Service.
Aug 23 18:08:43 carterpi systemd[1]: Started simpleLCD.service - My LCD Service.
Aug 23 18:08:43 carterpi systemd[1]: simpleLCD.service: Main process exited, code=exited, status=217/USER

tropic pawn
#

Quick question as I'm not familiar with that service, can you send a link to the docs about this?

desert mauve
#

Yes!

tropic pawn
#

So it's no klipper feature but some kind of addon?

#

Or is that just a tutorial?

desert mauve
wraith turretBOT
#

Ahoi @desert mauve!
It looks like you did not provide all the necessary information we need to help you.
Please upload your logfiles and a detailed description of your problem.
For further information see: https://docs.mainsail.xyz/faq/getting-help/discord#provide-information
Note: We only accept .log and .txt files as log files.
This is an automated message

We are glad to help and chat with you on our Community Discord, but if you need help and want the best support possible you should, follow a few simple rules:

tropic pawn
#

The screen works when i manually do the commands tho
What commands?

desert mauve
#

cd DWIN_T5UIC1_LCD
python3 ./run.py

#

I am also open to having other ways to run at boot

#

i just am not sure where to start

tropic pawn
#

The service outputs into that file /tmp/lcd.log. Have a look at it

tropic pawn
desert mauve
#

I cant find it in winscp

tropic pawn
#

Try out this exact command: /usr/bin/env python3 /home/pi/DWIN_T5UIC1_LCD/run.py > /tmp/lcd.log 2>&1

#

Wait, what's the username of your pi?

desert mauve
#

ctn3770

tropic pawn
#

It's carterpi, isn't it?

desert mauve
#

Oh of the pi?

#

the name of the pi is carterpi, the user is ctn3770

tropic pawn
#

Yeah of the pi

#

Ok

desert mauve
tropic pawn
#

Output of cat /lib/systemd/system/simpleLCD.service

desert mauve
#

ctn3770@carterpi:~ $ cat /lib/systemd/system/simpleLCD.service
[Unit]
Description=My LCD Service
After=multi-user.target

[Service]
Type=idle
ExecStartPre=/bin/sleep 30
ExecStart=/usr/bin/python3 /home/ctn3770/DWIN_T5UIC1_LCD/run.py
User=ctn3770
Restart=always
[Install]
WantedBy=multi-user.target
ctn3770@carterpi:~ $

tropic pawn
#

Any reason why you deleted the /bin/sh?

#

And the log output too

desert mauve
#

I did?

tropic pawn
#

At least it's different to the repo you sent

desert mauve
#

I didnt even realise

tropic pawn
#

I recommend to adjust it, just to be sure.

desert mauve
#

I can change that rq

tropic pawn
#

You also got a user and a restart policy ^^

desert mauve
#

yeah lol, i was reccomended to add it

#

i will remove those

#

and try the new one with the username of the pi

tropic pawn
#

It should be fine, but I'm not the best in such linux things ^^

desert mauve
#

Still isnt working, ill get the log output

#

python3: can't open file '/home/pi/DWIN_T5UIC1_LCD/run.py': [Errno 2] No such file or directory

tropic pawn
#

You didn't adjust the path

desert mauve
tropic pawn
#

It's /home/ctn3770/...

desert mauve
#

isnt this correct tho?

tropic pawn
#

Yes it is

#

Weird one

#

Did you reload the service?

desert mauve
#

Yes

tropic pawn
#

It wouldn't make sense otherwise ^^

#

Do a reboot and check the log again

desert mauve
#

Ill try a reboot

#

For some reason it isnt putting out a log

#

lemme try another reboot

tropic pawn
#

Ah, ok. It should log at least one line, if it starts

desert mauve
#

Process: 1322 ExecStart=/usr/bin/env python3 /home/ctn3770/DWIN_T5UIC1_LCD/>
Main PID: 1322 (code=exited, status=217/USER)
CPU: 0

Aug 24 14:48:17 carterpi systemd[1]: simpleLCD.service: Scheduled restart job, >
Aug 24 14:48:17 carterpi systemd[1]: Stopped simpleLCD.service - My LCD Service.
Aug 24 14:48:17 carterpi systemd[1]: simpleLCD.service: Start request repeated >
Aug 24 14:48:17 carterpi systemd[1]: simpleLCD.service: Failed with result 'exi>
Aug 24 14:48:17 carterpi systemd[1]: Failed to start simpleLCD.service - My LCD>
lines 1-13/13 (END)

#

Theres no log shown, and here is the status

tropic pawn
#

Run /usr/bin/env python3 /home/ctn3770/DWIN_T5UIC1_LCD/run.py

desert mauve
#

ctn3770@carterpi:~ $ /usr/bin/env python3 /home/ctn3770/DWIN_T5UIC1_LCD/run.py

DWIN handshake
DWIN OK.
the ip
Waiting for connect to /home/ctn3770/printer_data/comms/klippy.sock

Connection.

Boot looks good
Testing Web-services
Web site exists

tropic pawn
#

Then the only thing coming to my mind would be to increase the startup delay or add debugging prints into the python code, to check if it's even starting

desert mauve
#

How could i do that?

tropic pawn
#

The startup delay is in the service

#

Currently it's at 30s

desert mauve
#

Ah

#

ill try 50

#

How do i add the debugging prints>

tropic pawn
#

In the /home/ctn3770/DWIN_T5UIC1_LCD/run.py file you could add print('Test') at the beginning of the file and at various other lines

#

That way it should print those into the log file and we can see where the error happens

desert mauve
#

Ill do that

desert mauve
tropic pawn
#

Then it doesn't even start the file

#

I will then ask someone else to correct that service file

tropic pawn
#

Make sure to reboot once

desert mauve
#

Im rebooting rn

#

Ill check again

#

Nope, no print

tropic pawn
#

Remember, it needs like 50s before it starts

desert mauve
#

Just checked again

#

still nothing

tropic pawn
#

k

desert mauve
#

rip

tropic pawn
#

I asked someone to look at it

#

Maybe he got some idea

weak lion
#

What does happen if you start thr run.py in a terminal session?(aka ssh command prompt)

#

How does the file permissions look like? ls -al path/to/run.py

#

Which version of python has to be used for this script? Is it installed? If it is python3 did you try /usr/bin/python3 in your service file?

#

Whats the output of whereis python ?

desert mauve
#

Let me try this today once i get home

desert mauve
#

Hi, sorry for the wait, i am finally trying to figure this out once again lol

#

Whereis python is python: /usr/bin/python /usr/share/man/man1/python.1.gz

#

And for some reason the run.py stopped working, now yielding ctn3770@carterpi:~/DWIN_T5UIC1_LCD $ python3 ./run.py
Test
Traceback (most recent call last):
File "/home/ctn3770/DWIN_T5UIC1_LCD/./run.py", line 3, in <module>
from dwinlcd import DWIN_LCD
File "/home/ctn3770/DWIN_T5UIC1_LCD/dwinlcd.py", line 6, in <module>
from RPi import GPIO

tropic pawn
#

We would need the whole traceback

desert mauve
tropic pawn
#

No, you copied something. But you copied only the first few lines

desert mauve
tropic pawn
#

Then try to scroll down or something

#

That error id basically useless

desert mauve
#

Im using LGPIO because it is a pi5

#

I believe it should be a substitute

#

at least from the docs

tropic pawn
desert mauve
tropic pawn
#

Please send a screenshot of your terminal

desert mauve
tropic pawn
#

What Pi is that?

#

The post of p1r473 claims to got an in-place replacement package, that you could try