diff --git a/MMDVMHost.cpp b/MMDVMHost.cpp index 96abb8e..edd8800 100644 --- a/MMDVMHost.cpp +++ b/MMDVMHost.cpp @@ -1117,6 +1117,12 @@ void CMMDVMHost::createDisplay() case 2U: LogInfo(" Screen Layout: ON7LDS"); break; + case 3U: + LogInfo(" Screen Layout: DIY by ON7LDS"); + break; + case 4U: + LogInfo(" Screen Layout: DIY by ON7LDS (High speed)"); + break; default: LogInfo(" Screen Layout: %u (Unknown)", screenLayout); break; @@ -1129,7 +1135,10 @@ void CMMDVMHost::createDisplay() if (m_ump != NULL) m_display = new CNextion(m_callsign, dmrid, m_ump, brightness, displayClock, utc, idleBrightness, screenLayout); } else { - ISerialPort* serial = new CSerialController(port, SERIAL_9600); + SERIAL_SPEED baudrate = SERIAL_9600; + if (screenLayout==4U) + baudrate = SERIAL_115200; + ISerialPort* serial = new CSerialController(port, baudrate); m_display = new CNextion(m_callsign, dmrid, serial, brightness, displayClock, utc, idleBrightness, screenLayout); } } else if (type == "LCDproc") { diff --git a/Nextion.cpp b/Nextion.cpp index 8ada02f..587d6a3 100644 --- a/Nextion.cpp +++ b/Nextion.cpp @@ -84,6 +84,7 @@ bool CNextion::open() m_ipaddress = (char*)info; sendCommand("bkcmd=0"); + sendCommandAction(0); setIdle(); @@ -94,6 +95,7 @@ bool CNextion::open() void CNextion::setIdleInt() { sendCommand("page MMDVM"); + sendCommandAction(1U); char command[30U]; ::sprintf(command, "dim=%u", m_idleBrightness); @@ -101,11 +103,20 @@ void CNextion::setIdleInt() ::sprintf(command, "t0.txt=\"%s/%u\"", m_callsign.c_str(), m_dmrid); sendCommand(command); + if (m_screenLayout > 2U) { + ::sprintf(command, "t4.txt=\"%s\"", m_callsign.c_str()); + sendCommand(command); + ::sprintf(command, "t5.txt=\"%u\"", m_dmrid); + sendCommand(command); + } + sendCommandAction(17U); sendCommand("t1.txt=\"MMDVM IDLE\""); + sendCommandAction(11U); ::sprintf(command, "t3.txt=\"%s\"", m_ipaddress.c_str()); sendCommand(command); + sendCommandAction(16U); m_clockDisplayTimer.start(); @@ -117,15 +128,18 @@ void CNextion::setErrorInt(const char* text) assert(text != NULL); sendCommand("page MMDVM"); + sendCommandAction(1U); char command[20]; ::sprintf(command, "dim=%u", m_brightness); sendCommand(command); ::sprintf(command, "t0.txt=\"%s\"", text); + sendCommandAction(13U); sendCommand(command); sendCommand("t1.txt=\"ERROR\""); + sendCommandAction(14U); m_clockDisplayTimer.stop(); @@ -135,12 +149,14 @@ void CNextion::setErrorInt(const char* text) void CNextion::setLockoutInt() { sendCommand("page MMDVM"); + sendCommandAction(1U); char command[20]; ::sprintf(command, "dim=%u", m_brightness); sendCommand(command); sendCommand("t0.txt=\"LOCKOUT\""); + sendCommandAction(15U); m_clockDisplayTimer.stop(); @@ -155,8 +171,10 @@ void CNextion::writeDStarInt(const char* my1, const char* my2, const char* your, assert(type != NULL); assert(reflector != NULL); - if (m_mode != MODE_DSTAR) + if (m_mode != MODE_DSTAR) { sendCommand("page DStar"); + sendCommandAction(2U); + } char text[30U]; ::sprintf(text, "dim=%u", m_brightness); @@ -164,13 +182,16 @@ void CNextion::writeDStarInt(const char* my1, const char* my2, const char* your, ::sprintf(text, "t0.txt=\"%s %.8s/%4.4s\"", type, my1, my2); sendCommand(text); + sendCommandAction(42U); ::sprintf(text, "t1.txt=\"%.8s\"", your); sendCommand(text); + sendCommandAction(45U); if (::strcmp(reflector, " ") != 0) { ::sprintf(text, "t2.txt=\"via %.8s\"", reflector); sendCommand(text); + sendCommandAction(46U); } m_clockDisplayTimer.stop(); @@ -188,6 +209,7 @@ void CNextion::writeDStarRSSIInt(unsigned char rssi) char text[20U]; ::sprintf(text, "t3.txt=\"-%udBm\"", rssi); sendCommand(text); + sendCommandAction(47U); m_rssiCount1 = 1U; return; } @@ -199,6 +221,7 @@ void CNextion::writeDStarRSSIInt(unsigned char rssi) char text[20U]; ::sprintf(text, "t3.txt=\"-%udBm\"", m_rssiAccum1 / DSTAR_RSSI_COUNT); sendCommand(text); + sendCommandAction(47U); m_rssiAccum1 = 0U; m_rssiCount1 = 1U; } @@ -210,6 +233,7 @@ void CNextion::writeDStarBERInt(float ber) char text[20U]; ::sprintf(text, "t4.txt=\"%.1f%%\"", ber); sendCommand(text); + sendCommandAction(48U); m_berCount1 = 1U; return; } @@ -221,6 +245,7 @@ void CNextion::writeDStarBERInt(float ber) char text[20U]; ::sprintf(text, "t4.txt=\"%.1f%%\"", m_berAccum1 / float(DSTAR_BER_COUNT)); sendCommand(text); + sendCommandAction(48U); m_berAccum1 = 0.0F; m_berCount1 = 1U; } @@ -229,6 +254,7 @@ void CNextion::writeDStarBERInt(float ber) void CNextion::clearDStarInt() { sendCommand("t0.txt=\"Listening\""); + sendCommandAction(41U); sendCommand("t1.txt=\"\""); sendCommand("t2.txt=\"\""); sendCommand("t3.txt=\"\""); @@ -241,6 +267,8 @@ void CNextion::writeDMRInt(unsigned int slotNo, const std::string& src, bool gro if (m_mode != MODE_DMR) { sendCommand("page DMR"); + sendCommandAction(3U); + if (slotNo == 1U) { if (m_screenLayout == 2U) { @@ -249,6 +277,7 @@ void CNextion::writeDMRInt(unsigned int slotNo, const std::string& src, bool gro } sendCommand("t2.txt=\"2 Listening\""); + sendCommandAction(69U); } else { if (m_screenLayout == 2U) { sendCommand("t0.pco=0"); @@ -256,6 +285,7 @@ void CNextion::writeDMRInt(unsigned int slotNo, const std::string& src, bool gro } sendCommand("t0.txt=\"1 Listening\""); + sendCommandAction(61U); } } @@ -272,9 +302,11 @@ void CNextion::writeDMRInt(unsigned int slotNo, const std::string& src, bool gro } sendCommand(text); + sendCommandAction(62U); ::sprintf(text, "t1.txt=\"%s%s\"", group ? "TG" : "", dst.c_str()); sendCommand(text); + sendCommandAction(65U); } else { ::sprintf(text, "t2.txt=\"2 %s %s\"", type, src.c_str()); @@ -284,9 +316,11 @@ void CNextion::writeDMRInt(unsigned int slotNo, const std::string& src, bool gro } sendCommand(text); + sendCommandAction(70U); ::sprintf(text, "t3.txt=\"%s%s\"", group ? "TG" : "", dst.c_str()); sendCommand(text); + sendCommandAction(73U); } m_clockDisplayTimer.stop(); @@ -309,6 +343,7 @@ void CNextion::writeDMRRSSIInt(unsigned int slotNo, unsigned char rssi) char text[20U]; ::sprintf(text, "t4.txt=\"-%udBm\"", rssi); sendCommand(text); + sendCommandAction(66U); m_rssiCount1 = 1U; return; } @@ -320,6 +355,7 @@ void CNextion::writeDMRRSSIInt(unsigned int slotNo, unsigned char rssi) char text[20U]; ::sprintf(text, "t4.txt=\"-%udBm\"", m_rssiAccum1 / DMR_RSSI_COUNT); sendCommand(text); + sendCommandAction(66U); m_rssiAccum1 = 0U; m_rssiCount1 = 1U; } @@ -327,6 +363,7 @@ void CNextion::writeDMRRSSIInt(unsigned int slotNo, unsigned char rssi) if (m_rssiCount2 == 0U) { char text[20U]; ::sprintf(text, "t5.txt=\"-%udBm\"", rssi); + sendCommandAction(74U); sendCommand(text); m_rssiCount2 = 1U; return; @@ -339,6 +376,7 @@ void CNextion::writeDMRRSSIInt(unsigned int slotNo, unsigned char rssi) char text[20U]; ::sprintf(text, "t5.txt=\"-%udBm\"", m_rssiAccum2 / DMR_RSSI_COUNT); sendCommand(text); + sendCommandAction(74U); m_rssiAccum2 = 0U; m_rssiCount2 = 1U; } @@ -351,12 +389,15 @@ void CNextion::writeDMRTAInt(unsigned int slotNo, unsigned char* talkerAlias, co return; if (type[0] == ' ') { - if (slotNo == 1U) - sendCommand("t0.pco=33808"); - else - sendCommand("t2.pco=33808"); + if (slotNo == 1U) { + if (m_screenLayout == 2U) sendCommand("t0.pco=33808"); + sendCommandAction(64U); + } else { + if (m_screenLayout == 2U) sendCommand("t2.pco=33808"); + sendCommandAction(72U); + } return; - } + } if (slotNo == 1U) { char text[40U]; @@ -369,10 +410,11 @@ void CNextion::writeDMRTAInt(unsigned int slotNo, unsigned char* talkerAlias, co sendCommand("t0.font=2"); if (::strlen((char*)talkerAlias) > (24U-4U)) sendCommand("t0.font=1"); - } - sendCommand("t0.pco=1024"); + sendCommand("t0.pco=1024"); + } sendCommand(text); + sendCommandAction(63U); } else { char text[40U]; ::sprintf(text, "t2.txt=\"2 %s %s\"", type, talkerAlias); @@ -384,11 +426,12 @@ void CNextion::writeDMRTAInt(unsigned int slotNo, unsigned char* talkerAlias, co sendCommand("t2.font=2"); if (::strlen((char*)talkerAlias) > (24U-4U)) sendCommand("t2.font=1"); - } - sendCommand("t2.pco=1024"); + sendCommand("t2.pco=1024"); + } sendCommand(text); - } + sendCommandAction(71U); + } } void CNextion::writeDMRBERInt(unsigned int slotNo, float ber) @@ -398,6 +441,7 @@ void CNextion::writeDMRBERInt(unsigned int slotNo, float ber) char text[20U]; ::sprintf(text, "t6.txt=\"%.1f%%\"", ber); sendCommand(text); + sendCommandAction(67U); m_berCount1 = 1U; return; } @@ -409,6 +453,7 @@ void CNextion::writeDMRBERInt(unsigned int slotNo, float ber) char text[20U]; ::sprintf(text, "t6.txt=\"%.1f%%\"", m_berAccum1 / DMR_BER_COUNT); sendCommand(text); + sendCommandAction(67U); m_berAccum1 = 0U; m_berCount1 = 1U; } @@ -417,6 +462,7 @@ void CNextion::writeDMRBERInt(unsigned int slotNo, float ber) char text[20U]; ::sprintf(text, "t7.txt=\"%.1f%%\"", ber); sendCommand(text); + sendCommandAction(75U); m_berCount2 = 1U; return; } @@ -428,6 +474,7 @@ void CNextion::writeDMRBERInt(unsigned int slotNo, float ber) char text[20U]; ::sprintf(text, "t7.txt=\"%.1f%%\"", m_berAccum2 / DMR_BER_COUNT); sendCommand(text); + sendCommandAction(75U); m_berAccum2 = 0U; m_berCount2 = 1U; } @@ -438,6 +485,7 @@ void CNextion::clearDMRInt(unsigned int slotNo) { if (slotNo == 1U) { sendCommand("t0.txt=\"1 Listening\""); + sendCommandAction(61U); if (m_screenLayout == 2U) { sendCommand("t0.pco=0"); @@ -449,6 +497,7 @@ void CNextion::clearDMRInt(unsigned int slotNo) sendCommand("t6.txt=\"\""); } else { sendCommand("t2.txt=\"2 Listening\""); + sendCommandAction(69U); if (m_screenLayout == 2U) { sendCommand("t2.pco=0"); @@ -468,8 +517,11 @@ void CNextion::writeFusionInt(const char* source, const char* dest, const char* assert(type != NULL); assert(origin != NULL); - if (m_mode != MODE_YSF) + if (m_mode != MODE_YSF) { sendCommand("page YSF"); + sendCommandAction(4U); + } + char text[30U]; ::sprintf(text, "dim=%u", m_brightness); @@ -477,12 +529,15 @@ void CNextion::writeFusionInt(const char* source, const char* dest, const char* ::sprintf(text, "t0.txt=\"%s %.10s\"", type, source); sendCommand(text); + sendCommandAction(82U); ::sprintf(text, "t1.txt=\"%.10s\"", dest); sendCommand(text); + sendCommandAction(83U); if (::strcmp(origin, " ") != 0) { ::sprintf(text, "t2.txt=\"at %.10s\"", origin); sendCommand(text); + sendCommandAction(84U); } m_clockDisplayTimer.stop(); @@ -500,6 +555,7 @@ void CNextion::writeFusionRSSIInt(unsigned char rssi) char text[20U]; ::sprintf(text, "t3.txt=\"-%udBm\"", rssi); sendCommand(text); + sendCommandAction(85U); m_rssiCount1 = 1U; return; } @@ -511,6 +567,7 @@ void CNextion::writeFusionRSSIInt(unsigned char rssi) char text[20U]; ::sprintf(text, "t3.txt=\"-%udBm\"", m_rssiAccum1 / YSF_RSSI_COUNT); sendCommand(text); + sendCommandAction(85U); m_rssiAccum1 = 0U; m_rssiCount1 = 1U; } @@ -522,6 +579,7 @@ void CNextion::writeFusionBERInt(float ber) char text[20U]; ::sprintf(text, "t4.txt=\"%.1f%%\"", ber); sendCommand(text); + sendCommandAction(86U); m_berCount1 = 1U; return; } @@ -533,6 +591,7 @@ void CNextion::writeFusionBERInt(float ber) char text[20U]; ::sprintf(text, "t4.txt=\"%.1f%%\"", m_berAccum1 / float(YSF_BER_COUNT)); sendCommand(text); + sendCommandAction(86U); m_berAccum1 = 0.0F; m_berCount1 = 1U; } @@ -541,6 +600,7 @@ void CNextion::writeFusionBERInt(float ber) void CNextion::clearFusionInt() { sendCommand("t0.txt=\"Listening\""); + sendCommandAction(81U); sendCommand("t1.txt=\"\""); sendCommand("t2.txt=\"\""); sendCommand("t3.txt=\"\""); @@ -552,8 +612,10 @@ void CNextion::writeP25Int(const char* source, bool group, unsigned int dest, co assert(source != NULL); assert(type != NULL); - if (m_mode != MODE_P25) + if (m_mode != MODE_P25) { sendCommand("page P25"); + sendCommandAction(5U); + } char text[30U]; ::sprintf(text, "dim=%u", m_brightness); @@ -561,9 +623,11 @@ void CNextion::writeP25Int(const char* source, bool group, unsigned int dest, co ::sprintf(text, "t0.txt=\"%s %.10s\"", type, source); sendCommand(text); + sendCommandAction(102U); ::sprintf(text, "t1.txt=\"%s%u\"", group ? "TG" : "", dest); sendCommand(text); + sendCommandAction(103U); m_clockDisplayTimer.stop(); @@ -580,6 +644,7 @@ void CNextion::writeP25RSSIInt(unsigned char rssi) char text[20U]; ::sprintf(text, "t2.txt=\"-%udBm\"", rssi); sendCommand(text); + sendCommandAction(104U); m_rssiCount1 = 1U; return; } @@ -591,6 +656,7 @@ void CNextion::writeP25RSSIInt(unsigned char rssi) char text[20U]; ::sprintf(text, "t2.txt=\"-%udBm\"", m_rssiAccum1 / P25_RSSI_COUNT); sendCommand(text); + sendCommandAction(104U); m_rssiAccum1 = 0U; m_rssiCount1 = 1U; } @@ -602,6 +668,7 @@ void CNextion::writeP25BERInt(float ber) char text[20U]; ::sprintf(text, "t3.txt=\"%.1f%%\"", ber); sendCommand(text); + sendCommandAction(105U); m_berCount1 = 1U; return; } @@ -613,6 +680,7 @@ void CNextion::writeP25BERInt(float ber) char text[20U]; ::sprintf(text, "t3.txt=\"%.1f%%\"", m_berAccum1 / float(P25_BER_COUNT)); sendCommand(text); + sendCommandAction(105U); m_berAccum1 = 0.0F; m_berCount1 = 1U; } @@ -621,6 +689,7 @@ void CNextion::writeP25BERInt(float ber) void CNextion::clearP25Int() { sendCommand("t0.txt=\"Listening\""); + sendCommandAction(101U); sendCommand("t1.txt=\"\""); sendCommand("t2.txt=\"\""); sendCommand("t3.txt=\"\""); @@ -629,7 +698,7 @@ void CNextion::clearP25Int() void CNextion::writeCWInt() { sendCommand("t1.txt=\"Sending CW Ident\""); - + sendCommandAction(12U); m_clockDisplayTimer.start(); m_mode = MODE_CW; @@ -638,6 +707,7 @@ void CNextion::writeCWInt() void CNextion::clearCWInt() { sendCommand("t1.txt=\"MMDVM IDLE\""); + sendCommandAction(11U); } void CNextion::clockInt(unsigned int ms) @@ -666,11 +736,24 @@ void CNextion::clockInt(unsigned int ms) void CNextion::close() { sendCommand("page MMDVM"); + sendCommandAction(1U); sendCommand("t1.txt=\"MMDVM STOPPED\""); + sendCommandAction(19U); m_serial->close(); delete m_serial; } +void CNextion::sendCommandAction(unsigned int status) +{ + if (m_screenLayout<3U) return; + + char text[30U]; + ::sprintf(text, "MMDVM.status.val=%d", status); + sendCommand(text); + sendCommand("click S0,1"); +} + + void CNextion::sendCommand(const char* command) { assert(command != NULL); diff --git a/Nextion.h b/Nextion.h index bde7c5d..8235867 100644 --- a/Nextion.h +++ b/Nextion.h @@ -49,6 +49,7 @@ protected: virtual void writeDMRInt(unsigned int slotNo, const std::string& src, bool group, const std::string& dst, const char* type); virtual void writeDMRRSSIInt(unsigned int slotNo, unsigned char rssi); virtual void writeDMRTAInt(unsigned int slotNo, unsigned char* talkerAlias, const char* type); + virtual void writeDMRBERInt(unsigned int slotNo, float ber); virtual void clearDMRInt(unsigned int slotNo); @@ -89,6 +90,7 @@ private: unsigned int m_berCount2; void sendCommand(const char* command); + void sendCommandAction(unsigned int status); }; #endif diff --git a/Nextion_ON7LDS/NX3224T024-L3.HMI b/Nextion_ON7LDS/NX3224T024-L3.HMI new file mode 100644 index 0000000..454590a Binary files /dev/null and b/Nextion_ON7LDS/NX3224T024-L3.HMI differ diff --git a/Nextion_ON7LDS/NX3224T024-L3.tft b/Nextion_ON7LDS/NX3224T024-L3.tft new file mode 100644 index 0000000..500e9f1 Binary files /dev/null and b/Nextion_ON7LDS/NX3224T024-L3.tft differ diff --git a/Nextion_ON7LDS/NX3224T028-L3.HMI b/Nextion_ON7LDS/NX3224T028-L3.HMI new file mode 100644 index 0000000..72d743d Binary files /dev/null and b/Nextion_ON7LDS/NX3224T028-L3.HMI differ diff --git a/Nextion_ON7LDS/NX3224T028-L3.tft b/Nextion_ON7LDS/NX3224T028-L3.tft new file mode 100644 index 0000000..1bd978c Binary files /dev/null and b/Nextion_ON7LDS/NX3224T028-L3.tft differ diff --git a/Nextion_ON7LDS/NX4832T035-L3.HMI b/Nextion_ON7LDS/NX4832T035-L3.HMI new file mode 100644 index 0000000..4070e5c Binary files /dev/null and b/Nextion_ON7LDS/NX4832T035-L3.HMI differ diff --git a/Nextion_ON7LDS/NX4832T035-L3.tft b/Nextion_ON7LDS/NX4832T035-L3.tft new file mode 100644 index 0000000..479b42b Binary files /dev/null and b/Nextion_ON7LDS/NX4832T035-L3.tft differ diff --git a/Nextion_ON7LDS/README b/Nextion_ON7LDS/README-L2 similarity index 66% rename from Nextion_ON7LDS/README rename to Nextion_ON7LDS/README-L2 index 25542b9..d3b4a48 100644 --- a/Nextion_ON7LDS/README +++ b/Nextion_ON7LDS/README-L2 @@ -1,5 +1,14 @@ -The files in this directory are Nextion screen layouts with better fonts than - the(rather ugly) standard Nextion fonts +Nextion Display Layouts by ON7LDS (for MMDVMHost) +================================================= + + ################################ + # # + # screenLayout 2 files (-L2) # + # # + ################################ + +The -L2 files in this directory are Nextion screen layouts with better + fonts than the (rather ugly) standard Nextion fonts There are some other changes: @@ -20,10 +29,13 @@ There are some other changes: must copy this font to the lesser ('smaller') fonts. i.e. : the 3.2" the display can show more than 31 characters (the maximum TA length) in font 2, so this font is also copied to font 1. +* If you want more control about what and how it is displayed, you better + select Layout 3 or 4 (see README-L3) * The screenlayout has to be selected with the parameter ScreenLayout in the MMDVM.ini file under the Nextion section. This way, the extra function to automatically change the font size, is activated. 0 = auto (future use, for now it's G4KLX layout) 1 = G4KLX layout - 2 = ON7LDS layout - + 2 = ON7LDS layout (this README file) + 3 = DIY by ON7LDS layout (see README-L3) + 4 = DIY by ON7LDS layout Hig Speed (see README-L3) diff --git a/Nextion_ON7LDS/README-L3 b/Nextion_ON7LDS/README-L3 new file mode 100644 index 0000000..16e391e --- /dev/null +++ b/Nextion_ON7LDS/README-L3 @@ -0,0 +1,200 @@ +Nextion Display Layouts by ON7LDS (for MMDVMHost) +================================================= + + #################################### + # # + # screenLayout 3 & 4 files (-L3) # + # # + # DIY layouts # + # # + #################################### + +The screenlayout has to be selected with the parameter ScreenLayout in the +MMDVM.ini file under the Nextion section. This way, the extra functions +are activated. + 0 = auto (future use, for now it's G4KLX layout) + 1 = G4KLX layout + 2 = ON7LDS layout (see README-L2) + 3 = ON7LDS DIY layout (this README file) + 4 = ON7LDS DIY layout Hig Speed (this README file) + +screenLayout 3 and 4 are the same, but selecting 3, MMDVMHost wil communicate +at 9600bps with the display and selecting 4 will set the baudrate to 115200. +If you select 4 (115200bps) *you* have to program your Nextion to default to +that baudrate. + +How to set the default Nextion Display baudrate ? +You could use the Nextion editor, connect to your display with the debug + tool (do not forget to select your display and not the simulator) and + give the command 'bauds=115200'. +Another option is to set the command above in the Preinitialization Event + of the first page. Nextion recommends to do the latter in any case, + because 'on rare occasions bauds has become lost' + + +DIY layouts +----------- +When selecting this layout, all processing can and should be done in the +Nextion display itself. +Whenever MMDVMHost sends new data to the screen, it also sends information +about what was sent as a number in global variable MMDVM.status. +(see further in this document for a table of numbers and their events) + +Then MMDVMHost activates the Touch Press Event of object 'S0' of the +active page. +In this event procedure, all processing can be done. + +Check the Touch Press Event of object 'S0' of the DMR page of the example +HMI file. As a straightforward example, the code there will show you how +to do some tasks when receiving data from MMDVMHost or NextionDriver: +- change colors and fonts of the TA on the DMR page when it arrives. + (TA length calculation is done in the display itsself !) +- remove the slot number from t2.txt (since it's always 2) +- in the middle of the DMR screen, the previous user is displayed + for each slot (S1 at the left, S2 at the right) + This is done by copying the data from the ID/TA field to these + fields at call end. + +The examples are there to give you an idea of what can be done. +It is up to your imagination to go even further. +When, for example, you want to change the text 'listening' to some +other text, like 'RX', you just have to monitor the event status and +take action in the Touch Event of S0 of the corresponding page. +Or you could hide/show pictures, switch to other pages, etc. + +Check the NextionDriver program and the display layouts there to see + some other examples of what can be done by programming in the + display. (https://github.com/on7lds/NextionDriver) + + +NOTE: it might be good to *not* remove fields from the display when you do not + need them, but make them small (i.e. 10 x 10 pixels) and put them aside: + Give them the same font color and background color as where you put them + OR + Put them behind some picture: put them on top of the picture, then select the + picture and click the 'Bring Top' button to put it on top of all those fields + OR + set them invisible when the page is selected (with the 'vis' command) in the + preinitialize event of the page + + This way, you can use the data from the fields to process them + as is done with the GPS data in the example. + + + + +Status codes that will be sent: +------------------------------- +The status code gives more information about what was sent in the +changed field. + + 1 : page MMDVM + 2 : page D-Star + 3 : page DMR + 4 : page YSF + 5 : page P25 + +11 : IDLE +12 : CW +13 : ERROR text +14 : ERROR +15 : LOCKOUT +16 : IPaddress +17 : ID/Call (t0 and t4,t5 are sent) +19 : END + +41 : D-Star listening +42 : type/my1/my2 +45 : your +46 : reflector +47 : RSSI +48 : ber + +61 : DMR listening1 +62 : ID1 +63 : TA1 +64 : Call end1 +65 : TG1 +66 : RSSI1 +67 : ber1 +69 : DMR listening2 +70 : ID2 +71 : TA2 +72 : Call end2 +73 : TG2 +74 : RSSI2 +75 : ber2 +76 : GPS1 (t8,t9,t12) +77 : GPS2 (t10,t11,t13) + +81 : YSF listening +82 : src +83 : dest +84 : origin +85 : RSSI +86 : ber + +101 : P25 listening +102 : source +103 : dest +104 : RSSI +105 : ber + + + +Fields (and their numbers) on the pages, used by MMDVMHost +---------------------------------------------------------- + +MMDVM +t0 : owner call & ID / errortext LOCKOUT +t1 : status / ERROR +t2 : date & time + +screenLayout >1 : +t3 : ip address +t4 : owner call +t5 : owner ID + + +D-Star +t0 : type my1 my2 +t1 : your +t2 : reflector +t3 : rssi +t4 : ber + + +DMR +t0 : src1 id / call / TA +t1 : dst +t2 : src2 id / call / TA +t3 : dst +t4 : rssi1 +t5 : rssi2 +t6 : ber1 +t7 : ber2 + +screenLayout >2 : +t8 : GPS1 dec +t9 : GPS1 DMS +t10: GPS2 dec +t11: GPS2 DMS +t12: GPS1 err +t13: GPS2 err + + +YSF +t0 : type,source +t1 : dst +t2 : src +t3 : rssi +t4 : ber + + +P25 +t0 : type,source +t1 : dst +t2 : rssi +t3 : ber + + diff --git a/Nextion_ON7LDS/README.md b/Nextion_ON7LDS/README.md new file mode 100644 index 0000000..de739f6 --- /dev/null +++ b/Nextion_ON7LDS/README.md @@ -0,0 +1,25 @@ +Nextion Display Layouts by ON7LDS (for MMDVMHost) +================================================= + +The screenlayout has to be selected with the parameter ScreenLayout in the +MMDVM.ini file under the Nextion section. This way, the extra functions +are activated. + + 0 = auto (future use, for now it's G4KLX layout) + 1 = G4KLX layout + 2 = ON7LDS layout (see README-L2) + 3 = DIY layout + 4 = DIY layout High Speed + +Layout 2 is a no-nonsense layout. It is the original (G4KLX) layout with the Talker Alias added. TA color and fonts size can not be changed. At least not easily. + +Layout 3 (as is 4) is a layout without any predefined layout options (color, fonts). It sends the fields *and* information about what was sent to the display, so all layout processing can and should be done in the display itself. + +More information about the layouts can be found in + * README-L2 for the screenLayout 2 setting + * README-L2 for the screenLayout 3 and 4 settings + + +When you want extra control over what has to be sent to the Nextion display, you could consider the program 'NextionDriver' at https://github.com/on7lds/NextionDriver as a companion to MMDVMHost. +This program sends extra information about the host to the display, can do callsign lookup with extended information (name, city, country) and can do more processing which would not be the task of MMDVMHost (for example: with the help of this program, it is possible to use buttons on the display). +In verbose mode, this program shows you all communication between MMDVMHost and the display.