Start a new topic

Bait for the adventurous :-)

We don't mind this discussion, but the users need to beware that this thread will be at the user's own risk.  Some commands can permanently damaged the Nextion device.

[Edited by the Itead Nextion Technical Support Advisors]



I examined the binaries of the Nextion editor and came across a list of key words, that names all the known commands and variables for the editor, but has some more in the list, that obviously are supported, but are not documented.


For instance this code snippet compiles without errors - although I have no idea what it may do:


sya1=123
ifvis b0.id,1
nstr va0.txt,2


The key words not known to me are the following - perhaps someone feels tempted to find out their usage? ;-)


sya0

sya1

crcf

runmod

comok

ifvis

draw3d

ifload

draw_h

showqq

strsize

lcd_dev

lhmi_cle

whmi_cle

setbrush

timerset

getpassw

lcd_refx

setbaudz

I (capital 'i')

load

nstr

zstr

init

rfpt

wfpt


I am looking forward to your findings!


 I tried to compile with different parameter numbers - these are those compiling nicely:


sya1=123
sya0=364586
ifvis b0.id,1
comok 2,2,2,2,2,2,2
crcf=4
runmod=4
draw3d 3,3,3,3,3,3,3
ifload 4,4
draw_h 1,1,1,1,1,1
showqq
strsize va0.txt,2,2
lcd_dev 4
lhmi_cle
whmi_cle 5,5
setbrush 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6
timerset 7,7,7
getpassw
lcd_refx
setbaudz 8
I 1,1,1,1
load 2
nstr va0.txt,2
zstr 1,1,1,1,1
init 3
rfpt 4,4,4
wfpt 5,5,5


Please note that this only gives the number of expected parameters, but leaves completely open what kind of parameters one should supply to the unknown commands!

I have always loved the penguins


there are surely many internal functions, which are not accessible for public use in general.

Even if you find them, be aware improper use may damage your Nextion permanently, and that's surely no warranty issue ... so, all up to this is on your own risk ...

@Patrick: sorry,  I do not get the point of your comment - what penguins?

 

Hey Michael - love a good discussion. Tagged the top of the thread as At own risk.

So we can continue the discussions


There is a funny insert by the firmware dev team that displays a screen full of penguins

- I guess they were having some fun to see who would catch this.


The capital I is the interpreted form of the if statement subroutines.


The sya0 and sya1 are integer variables like sys0,sys1,and sys2

  - the syaX pair is used by the scrolling text component

    - so if your project does not have a scrolling text component, two usable sys variables

    - sysX and syaX have a performance increase as they do not need to be looked up in a table

       - but they have the downfall of you never know where a user may have deployed them


It is assumed crcf is a filecrc check when writing TFTs via serial, but not sure if it is really used


comok is a response to the connect command if Nextion is ready to receive the TFT


ifvis is an internal, simple Boolean to check a component to decide if to draw on refresh

   - very simple, if the user toggled the component with the vis command - should not display it


draw3d is an internal for creating the 3d boarding on several components


load, ifload is internal to internal subroutines


setbrush needed for font rendering and pixel colours for lines etc


timerset is internal to the timer subroutines


getpassw is for the Text Component .pw ... if set displays *** if not displays .txt


strsize is part of .txt rendering in order to align Up, Center, Down, left, center, right


nstr, zstr is again font rendering


init - internal probably during TFT transfer, or after, best not attempt ?


setbaudz is a typo as far as I can determine, or used deeper down ?


lcd_dev lhmi_cle whmi_cle lcd_refx - and these may destroy your Nextion


rfpt, wfpt may be future floating point - or not sure

    

It is my belief that the blue commands/variables most likely are safe

The remainder is very mush risky to get params correct.


But any commands issued without the exacting and correct parameters can be harmful

So what I know is that your list came from examining one of the editor files that is used to colorize the enduser event code.  This shows me, the coders working on beautifying the code have made some typos, but it doesn't say anything deeper about the firmware or how they should be used.

Whoa! Kudos to you for being so open! I appreciate the colorful answers ;-)

I will not attempt to dig in deeper, as you did explain more than I ever could think to reveal myself.

Thanks a lot again!

 

Debug your nextion via serial so you can send commands directly to Nextion

then in the Instruction Input Area put showqq and enter - penguins

There is also no mention of the b component array discovered by Steve (user indev2).

with the b array, all components on a page are listed by their .id attribute number

so b[1] references the first component added to a page, the Page Component is always 0


With this one can also access the attributes of the referenced components

b[1].txt will lookup the .txt attribute for the first component

 -- if such attribute exists, it works, and if it doesn't exist - potential melt down of your HMI.


So when used exacting on a strategic manner, it is very powerful and a mass code shortener.

For example my Analog Clock for Nextion where three overlaying gauges are not possible.


BMhLE3hqzxlG4AqTAk8W92GqkAKiohc0cA.png


Or addressing keys on a full ascii (32 to 126) keyboard, would be a pain in the arse to have a nearly endless if() { }else { } series of statements can now be accessed by a value.


evC2qWHMKu2g8FVcW7dLspL8Vy_6Xplitw.png


Information such as this list could be discovered by anyone who looks

My answers are based on what I learned as a user because I dug in.


But a command without any other information in the wrong hands will be painful when they brick their fav Nextion device and the warranty has been cancelled.  The flow of information in an age of internet is probably not preventable as this is now being shipped out with the Nextion Editor - so maybe some understanding is best so users don't damage their displays.


If a hot stove is never explained, more people than necessary will learn by burns.

And perhaps an explanation and a warning may save more Nextions from the perilous and unnecessary tortures of their unknowing masters.


But also remember ... 

without adventure and risk, life would be stagnant and nothing new would ever be made



Login or Signup to post a comment