odwdinc / DWIN_T5UIC1_LCD

Python class for the Ender 3 V2 LCD
GNU General Public License v3.0
176 stars 73 forks source link

'DWIN_LCD' object has no attribute 'checkkey' #1

Closed Samu1808 closed 2 years ago

Samu1808 commented 3 years ago

I made everything of the setup and connected the Display properly to the Raspberry Pi.

The Display doesnt show anything (but the Backlight is on) and when i spin or push the button this is the output of run.py:

DWIN handshake Traceback (most recent call last): File "/home/pi/DWIN_T5UIC1_LCD/encoder.py", line 47, in transitionOccurred self.callback(self.value) File "/home/pi/DWIN_T5UIC1_LCD/dwinlcd.py", line 2252, in encoder_has_data if self.checkkey == self.MainMenu: AttributeError: 'DWIN_LCD' object has no attribute 'checkkey' Traceback (most recent call last): File "/home/pi/DWIN_T5UIC1_LCD/encoder.py", line 38, in transitionOccurred self.callback(self.value) File "/home/pi/DWIN_T5UIC1_LCD/dwinlcd.py", line 2252, in encoder_has_data if self.checkkey == self.MainMenu: AttributeError: 'DWIN_LCD' object has no attribute 'checkkey' Traceback (most recent call last): File "/home/pi/DWIN_T5UIC1_LCD/dwinlcd.py", line 2252, in encoder_has_data if self.checkkey == self.MainMenu: AttributeError: 'DWIN_LCD' object has no attribute 'checkkey'

My setup: Raspberry Pi 3 Octoprint Version 1.5.3 Klipper v0.9.1

odwdinc commented 3 years ago

Looks like it not finding the display aka DWIN handshake, but no DWIN OK

May need to change your serial port for Raspberry Pi 3 as this was tested on Raspberry Pi zero W.

looking at https://www.electronicwings.com/raspberry-pi/raspberry-pi-uart-communication-using-python-and-c

"Hardware UART port i.e. GPIO14(TXD) and GPIO15 (RXD) is also known as serial0"

try changing line

LCD_COM_Port = '/dev/ttyAMA0'

To:

LCD_COM_Port = '/dev/serial0'

Samu1808 commented 3 years ago

Ah this might be the problem, but your suggesstion doesnt fix it:

image

As far as I can tell, it also dont make a difference bc serial0 points also to ttyAMA0

I also found out that on rpi3 you have to add 'dtoverlay=pi3-disable-bt' to /boot/config.txt but this also wasn't the problem. Sadly I'm not very familiar with these basic hardware things as Serial connection and so on. Do you have any suggestion to find the problem, maybe some tests?

I also tried using ttyS0 and serial1, bc the ports seemes changed on my Pi, but in this case this error show up:

Traceback (most recent call last): File "/usr/lib/python3/dist-packages/serial/serialposix.py", line 323, in _reconfigure_port orig_attr = termios.tcgetattr(self.fd) termios.error: (5, 'Input/output error')

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "run.py", line 13, in API_Key File "/home/pi/DWIN_T5UIC1_LCD/dwinlcd.py", line 316, in init self.lcd = T5UIC1_LCD(USARTx) File "/home/pi/DWIN_T5UIC1_LCD/DWIN_Screen.py", line 59, in init self.MYSERIAL1 = serial.Serial(USARTx, 115200, timeout=1) File "/usr/lib/python3/dist-packages/serial/serialutil.py", line 240, in init self.open() File "/usr/lib/python3/dist-packages/serial/serialposix.py", line 272, in open self._reconfigure_port(force_update=True) File "/usr/lib/python3/dist-packages/serial/serialposix.py", line 326, in _reconfigure_port raise SerialException("Could not configure port: {}".format(msg)) serial.serialutil.SerialException: Could not configure port: (5, 'Input/output error')

It is maybe also important that i run the Jyers Firmware before and therefore changed the LCD firmware.

Hajto commented 3 years ago

Having the same issue. Has anyone found a solution? I also had been running Jyers firmware before.

Hajto commented 3 years ago

Flashed original firmware and no luck.

sdavis175 commented 3 years ago

Running into same issue, RPi 4 and went straight from stock to Klipper. Only see DWIN handshake in start, whenever I rotate the knob I get:

Traceback (most recent call last): File "/home/pi/DWIN_T5UIC1_LCD/encoder.py", line 47, in transitionOccurred self.callback(self.value) File "/home/pi/DWIN_T5UIC1_LCD/dwinlcd.py", line 2252, in encoder_has_data if self.checkkey == self.MainMenu: AttributeError: 'DWIN_LCD' object has no attribute 'checkkey' Traceback (most recent call last): File "/home/pi/DWIN_T5UIC1_LCD/encoder.py", line 38, in transitionOccurred self.callback(self.value) File "/home/pi/DWIN_T5UIC1_LCD/dwinlcd.py", line 2252, in encoder_has_data if self.checkkey == self.MainMenu: AttributeError: 'DWIN_LCD' object has no attribute 'checkkey' Traceback (most recent call last): File "/home/pi/DWIN_T5UIC1_LCD/encoder.py", line 38, in transitionOccurred self.callback(self.value) File "/home/pi/DWIN_T5UIC1_LCD/dwinlcd.py", line 2252, in encoder_has_data if self.checkkey == self.MainMenu: AttributeError: 'DWIN_LCD' object has no attribute 'checkkey'

Also using fluidd instead of octoprint, but I don't believe that is the issue since the LCD cannot connect. The LCD is receiving power.

jacrify commented 2 years ago

I have the same issue. I get DWIN handshake, but no DWIN OK. Looking at the code this means it's getting no response from the lcd board over serial. However moving the encoder wheel registers events and I get the error the OP quoted.

I've triple checked all my wiring and tested my cable. If any of the original posters found a solution to this, I'd love to hear it.

Samu1808 commented 2 years ago

Hey together, I found a fork https://github.com/bustedlogic/DWIN_T5UIC1_LCD which worked for me, I hope for you too. Enjoy!

sdavis175 commented 2 years ago

I tested with that fork and I am still getting the same checkkey error. LCD has power, what should I be looking to test?

EDIT: This fix did the trick:

Looks like it not finding the display aka DWIN handshake, but no DWIN OK

May need to change your serial port for Raspberry Pi 3 as this was tested on Raspberry Pi zero W.

looking at https://www.electronicwings.com/raspberry-pi/raspberry-pi-uart-communication-using-python-and-c

"Hardware UART port i.e. GPIO14(TXD) and GPIO15 (RXD) is also known as serial0"

try changing line

LCD_COM_Port = '/dev/ttyAMA0'

To:

LCD_COM_Port = '/dev/serial0'

jacrify commented 2 years ago

Check that the pins on your pi haven’t been shorted. That was the problem with mine: somehow I blew the pins.

On Sat, 19 Mar 2022 at 2:16 am, sdavis175 @.***> wrote:

I tested with that fork and I am still getting the same checkkey error. LCD has power, what should I be looking to test?

— Reply to this email directly, view it on GitHub https://github.com/odwdinc/DWIN_T5UIC1_LCD/issues/1#issuecomment-1072509617, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACIV6E6PNQOVKNV5CVJRXITVASM3RANCNFSM42WY4SAA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you commented.Message ID: @.***>

Felos9001 commented 9 months ago

I tested with that fork and I am still getting the same checkkey error. LCD has power, what should I be looking to test?

EDIT: This fix did the trick:

Looks like it not finding the display aka DWIN handshake, but no DWIN OK May need to change your serial port for Raspberry Pi 3 as this was tested on Raspberry Pi zero W. looking at https://www.electronicwings.com/raspberry-pi/raspberry-pi-uart-communication-using-python-and-c "Hardware UART port i.e. GPIO14(TXD) and GPIO15 (RXD) is also known as serial0" try changing line LCD_COM_Port = '/dev/ttyAMA0' To: LCD_COM_Port = '/dev/serial0'

Didnt work sadly. I am having the same issue.

janders13 commented 4 months ago

I had this issue because I followed a tutorial on reddit with wiring diagram that was wrong for me. Look at the markings on the display PCB directly and make sure they go to the right GPIO pins. Or try running it without ENT, A, and B connected.