yozik04 / nextion

Nextion serial client
GNU Lesser General Public License v3.0
25 stars 10 forks source link

Reading with python, username and password text data from Nextion #13

Closed javed222 closed 3 years ago

javed222 commented 3 years ago

Hello! I am trying to read in python, text data from nextion for validate user and password information. Pressing button b0.txt, send from t0.txt “hello”

Captura

In raspberry pi can see two messages:

  1. Touch event
  2. Message of data text from Nextion

How I can retrieve data text message in a variable with your python client? Thanks Javier

yozik04 commented 3 years ago

Hello. Simple. You register an event handler on a button. When the button is touched you do ‘val = await nextion.get(“t0.txt”)’

javed222 commented 3 years ago

Hello!! Thanks

if I do this:

Captura

have this error: Captura

please tell me what i have to do

thank you very much!! Javier

javed222 commented 3 years ago

also try this:

Captura

and have this error:

Captura

i am lost with this Thanks Javier

yozik04 commented 3 years ago

Second approach is right. One mistake: not ‘nextion’ but ‘client’ in your case and define it somewhere in the module level.

Jevgeni

15 сент. 2020 г., в 16:32, javed222 notifications@github.com написал(а):

 also try this:

and have this error:

i am lost with this Thanks Javier

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

javed222 commented 3 years ago

Thanks Jevgeni!! just one doubt

I rename "nextion" to "client", but client is not declared yet... Please where i must declare client?

Thank you so much for everything Javier

yozik04 commented 3 years ago

Make this variable global. A search engine will help 😅

Jevgeni

15 сент. 2020 г., в 18:18, javed222 notifications@github.com написал(а):

 Thanks Jevgeni!! just one doubt

I rename "nextion" to "client", but client is not declared yet... Please where i must declare client?

Thank you so much for everything Javier

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

javed222 commented 3 years ago

you are right sorry

javed222 commented 3 years ago

Thank you Jevgeni!! All is right now Javier