Start a new topic

Having trouble with Mega Serials

 I have Nextion NX8048k050_11 and Arduino mega. I am trying to run examples given in library. I have Nextion editor 0.47. I followed all steps but I am not getting anything on serial port on touching the button.

for example I am trying CompNumber Example

It is showing something like this on serial

recvRetCommandFinished err
recvRetCommandFinished err
setup done



11th biblical commandement : THOU SHALT NOT DOUBLE POST !!! ;-) 

What shalt the post topic be renamed too.  Suggestions?

Example works fine

 - prerequisite of Mega/Arduino setup required knowledge

 - one must know their MCU

     - they chose their MCU of the 10,000+ that can work with Nextion

     - they chose their programming language of the 100+ that can be used

     - they chose their compiler and development environment

But example indeed works with Nextion device, Mega and Arduino C++

Topic changed to more accurately reflect nature of thread

  - decapitalization

Having trouble with Mega Serials

You can probably use the Mega as a gateway, but not as configured with the default MySensors SPI pinout.

And this has what? to do with Nextion  please?

The Mega can be used as a doorstop,

   even when configured with a default Samsung Cell Phone.

If you can tell me what MySensors SPI pinout has to do with

   this user's issue that started the thread,

   I might award you with two points if you can explain.

Very simple

recvRetCommandFinished err

generated from NexHardware.cpp nexInit();

 - serial communications has not been established.

How do you trace where this error comes from ?  the guy programming my Nextion 7" resistive with a Mega has no errors but I get them

 recvRetCommandFinished err

I have tried connecting both grounds , used an external power supply , He sends me the HNI and INO files along with .h and .cpp files ( I copy those into the libraries folder ) 

still have this error , could it be in the HMI File ? 

I am not getting good replies on how to fix this from him I think he does not know ? 

any trace program ? 

How do you trace ...
How to trace where the error comes from - read the code.

recvRetCommandFinished err
is Receive Return Command Finished
  - result of last command

Two possibilities

  1 Serial communications is not being established.
      Mega has 3 Serials, library is default 2 on RT2/TX2
  2 He is ignoring such returns in which I say good luck.

So if he also has the Nextion device and Mega - then prob #1

the only difference is the IDE I have rev 1.8.2 and they are using 1.6.8 would that make a difference ?  he does not get this error on his setup 

Not necessarily, how wired or miswired can already cause such.
When the MCU sends a command to Nextion

   Nextion should be sending a Return Code back

   MCU then reports to Serial Monitor recvRetCommandFinished <result: ok or err>

Such reporting to Serial Monitor is via USB

  - But Nextion should be on a Hardware Serial Port.
    two wires NOT USB.

err says to me you have not established hardware serial communication.

- broken, fractured wire

- incorrect non matching baud rate

- etc, etc, etc.

Thanks Patrick I now understand the flow control ! I am hard wired not USB maybe bad wires ? the pins suck on the Arduinos should just solder them 

describe for me

  - all of your wiring

  - NexConfig.h

  - inside NexHardware.h nexInit() function
  - setup();
  - Nextion's first page PreInitialization Event in HMI file

Wiring ; RX2/TX2 from Nextion to Arduino Mega 2560 , 5 vdc from USB cable to Nextion ( modified cable to only bring 5vdc to Nextion no serial ) Mega is usb direct cable , grounds connected together 

Nexcofig.h nexhardware.h,  attached 

What exactly do you mean by setup() ?? 

Preint first page , this can be removed , I will try it 



(1.46 KB)
(1.27 KB)
Login or Signup to post a comment