Start a new topic

Interference between serial port definition for Nextion display and HC12 module?

I want to realize a remote control via the following route
 Nextion display -> Mega2560 MCU->HC12 module->HC12 module->Mega2560 MCU->relay card.
In the moment I am stuck with the execution of AT commands towards the HC12 module. For testing the communication between MCU and HC12 module I uploaded the HC12.ino file to the MCU. The communication to the HC12 module is done via the Serial monitor. If I for example enter AT+C001 the HC12 returns OK+C001. So in this case it works. So I have integrated the code lines into VSRRemoteControlRev0.ino. Additionally, the Nextion.h is included in this program and the definition of MCU commands related to the received info by the display. If I test again the communication between HC12 and MCU the HC12 does not respond via serial monitor. The HC12 is communicating with the MCUs via Softwareserial. So I cannot see an interference between the hardware based serial communication (serial2) or the debugserial communication(serial1). If I press the Set button on the Nextion display the content of a Textbox is received by the MCU and a message is generated by adding the content, i.e. "001", to "AT+C". The serial monitor shows AT+C001 but the HC12 does not respond with OK+C001 either. Where can I find the interference and achieve a response from the HC12 module?
(5.68 KB)
Login or Signup to post a comment