Start a new topic

Initialize nexNumber from EEPROM


MCU: Arduino Mega 2560

Display: Nextion NX8048K070_11

Nextion arduino lib: v0.90

In my HMI file i have a settingspage, with the arduino sketch i am able to write the value of a NexNumber to the Arduino EEPROM. This works. But when i power up the display and mcu, i want to set the NexNumber value with the value of the EEPROM. When i power up the screen it shows the home page and not the settings page.
So when i put n4_possnel.setValue(settings.possnel) [this is a NexNumber on the settings page]  in the setup it doesn't work because i'm not on the settings page. Is there a way i can use the .setValue for a NexNumber that is not on the current page?

method to use NexNumber when current page (or not)

 - covered in depth many times already

must only pick one of the presented strategies and implement.

Re-read your description of question.

 - what is your missing step?  implement this missing step in code.

Take a moment to breathe, because you nearly stated your own solution

1 person likes this
Thanks for your quick reply!

I couldn't found any other thread about that.
But now i foud this:
NexNumber myNumber = NexNumber(0,3,"page0.n0");
So by naming the page before the id name the problem is solved for now.


Other threads - any dealing with scope and globals

other method is sendme and 0x66

can change page then update just as easily without extra sram use on Mega

Now i'm having another trouble.
I have in my HMI file a nexnumber with objname= n4_conversie
If i use the function .setValue(...) it does nothing.
If i change the name to n4_conv  it works perfectly.
Can you explain why?


Sorry, not enough info given to solve.

- perhaps watch for case sensitivity.

- follow Nextion Return Data

- use debugging methods

Perhaps someone can attempt to replicate

- case sensitivity was checked  and OK
- the serial of the arduino did not show a "recvRetCommandFinished err"
 but the value was always 0


I was just curious why this happened.

Take this as a special bonus and not the norm.

 - created an HMI for 7.0" enhanced

   Number component n4_conversie

MCU can send 32-bit number to set n4_conversie to device.

- so error is either not as described or glitch is your MCU side.

So this isn't a Nextion firmware issue.

But as told, not enough information given to solve

 - maybe your objname contained a trailing space when named

Login or Signup to post a comment