Using sprintf and nextion display

Just exchange mySerial by Serial2, that should work.

You need a Serial2.begin() in setup too.

You are aware that Serial2 is the third serial port, not the second?

So the Nextion is connected to pins 16 and 17?