G7OMN wrote: ↑Wed May 29, 2024 2:39 pm
For a bit of clarity - where Pistar is should be writing the screenlayout >2 t8 : talkgroup name TS2 field, it is actually writing the values for DMR t0 : src1 id / call / TA
Where it should be writing the t9 : talkgroup name TS1 value, it writes the t2 : src2 id / call / TA value
So it writes the currently transmitting user on one time slot into the TG name of the other slot.
This incorrect value on the "other slot" gets over written with the correct TG description if a user transmits on the "other slot" e.g user Rx on S1. The t0 value (src1 id / call / TA) is written to the top banner in slot 1 and to the TG description field of Slot 2
As soon as another user is received on Slot 2 (while Slot 1 is still in Tx), the TG description field is overwritten correctly in Slot 2
The same happens in reverse on Slot 2.
You are essentially correct here.
Some samples from tracing/analysis of the logs coming out of the Nextion Driver (loglevel=4 in the config):
Code: Select all
64350 │ Jun 2 15:36:26 pi-star-test NextionDriver: Received 36 bytes from host
64351 │ Jun 2 15:36:26 pi-star-test NextionDriver: RX: dim=50
64352 │ Jun 2 15:36:26 pi-star-test NextionDriver: NET: dim=50
64353 │ Jun 2 15:36:26 pi-star-test NextionDriver: LH: check [dim=50] on page 2
64354 │ Jun 2 15:36:26 pi-star-test NextionDriver: RX: t0.txt="1 N VO1JGN John"
64355 │ Jun 2 15:36:26 pi-star-test NextionDriver: NET: t0.txt="1 N VO1JGN John"
64356 │ Jun 2 15:36:26 pi-star-test NextionDriver: LH: check [t0.txt="1 N VO1JGN John"] on page 2
64357 │ Jun 2 15:36:26 pi-star-test NextionDriver: LH: page 2 field 0 is [txt="1 N VO1JGN John"]
64358 │ Jun 2 15:36:26 pi-star-test NextionDriver: LH: statusval 64
64359 │ Jun 2 15:36:26 pi-star-test NextionDriver: LH Inhibit#012
64360 │ Jun 2 15:36:26 pi-star-test NextionDriver: --- User index search for call VO1JGN (0 [] - 249999 [ZZ1Z] )
64361 │ Jun 2 15:36:26 pi-star-test NextionDriver: --- User index search for call VO1JGN (124999 [KG4AUB] - 249999 [ZZ1Z] )
: : :
64377 │ Jun 2 15:36:26 pi-star-test NextionDriver: --- User index search for call VO1JGN (222993 [VO1JEF] - 222995 [VO1JQB] )
64378 │ Jun 2 15:36:26 pi-star-test NextionDriver: NET: t18.txt="VO1JGN"
64379 │ Jun 2 15:36:26 pi-star-test NextionDriver: LH: check [t18.txt="VO1JGN"] on page 2
64380 │ Jun 2 15:36:26 pi-star-test NextionDriver: LH: page 2 field 18 is [txt="VO1JGN"]
64381 │ Jun 2 15:36:26 pi-star-test NextionDriver: LH: statusval 64
64382 │ Jun 2 15:36:26 pi-star-test NextionDriver: LH Inhibit#012
64383 │ Jun 2 15:36:26 pi-star-test NextionDriver: NET: t19.txt="John G Noseworthy"
64384 │ Jun 2 15:36:26 pi-star-test NextionDriver: LH: check [t19.txt="John G Noseworthy"] on page 2
64385 │ Jun 2 15:36:26 pi-star-test NextionDriver: LH: page 2 field 19 is [txt="John G Noseworthy"]
64386 │ Jun 2 15:36:26 pi-star-test NextionDriver: LH: statusval 64
64387 │ Jun 2 15:36:26 pi-star-test NextionDriver: LH Inhibit#012
64388 │ Jun 2 15:36:26 pi-star-test NextionDriver: NET: t20.txt="St Johns"
64389 │ Jun 2 15:36:26 pi-star-test NextionDriver: LH: check [t20.txt="St Johns"] on page 2
64390 │ Jun 2 15:36:26 pi-star-test NextionDriver: LH: page 2 field 20 is [txt="St Johns"]
64391 │ Jun 2 15:36:26 pi-star-test NextionDriver: LH: statusval 64
64392 │ Jun 2 15:36:26 pi-star-test NextionDriver: LH Inhibit#012
64393 │ Jun 2 15:36:26 pi-star-test NextionDriver: NET: t21.txt="Newfoundland"
64394 │ Jun 2 15:36:26 pi-star-test NextionDriver: LH: check [t21.txt="Newfoundland"] on page 2
64395 │ Jun 2 15:36:26 pi-star-test NextionDriver: LH: page 2 field 21 is [txt="Newfoundland"]
64396 │ Jun 2 15:36:26 pi-star-test NextionDriver: LH: statusval 64
64397 │ Jun 2 15:36:26 pi-star-test NextionDriver: LH Inhibit#012
64398 │ Jun 2 15:36:26 pi-star-test NextionDriver: NET: t22.txt="Canada"
64399 │ Jun 2 15:36:26 pi-star-test NextionDriver: LH: check [t22.txt="Canada"] on page 2
64400 │ Jun 2 15:36:26 pi-star-test NextionDriver: LH: page 2 field 22 is [txt="Canada"]
64401 │ Jun 2 15:36:26 pi-star-test NextionDriver: LH: statusval 64
64402 │ Jun 2 15:36:26 pi-star-test NextionDriver: LH Inhibit#012
64403 │ Jun 2 15:36:26 pi-star-test NextionDriver: NET: MMDVM.status.val=68
64404 │ Jun 2 15:36:26 pi-star-test NextionDriver: LH: check [MMDVM.status.val=68] on page 2
64405 │ Jun 2 15:36:26 pi-star-test NextionDriver: NET: click S0,1
64406 │ Jun 2 15:36:26 pi-star-test NextionDriver: LH: check [click S0,1] on page 2
64407 │ Jun 2 15:36:26 pi-star-test NextionDriver: NET: t22.txt="Canada"
64408 │ Jun 2 15:36:26 pi-star-test NextionDriver: LH: check [t22.txt="Canada"] on page 2
64409 │ Jun 2 15:36:26 pi-star-test NextionDriver: LH: page 2 field 22 is [txt="Canada"]
64410 │ Jun 2 15:36:26 pi-star-test NextionDriver: LH: statusval 68
64411 │ Jun 2 15:36:26 pi-star-test NextionDriver: LH Inhibit#012
64412 │ Jun 2 15:36:26 pi-star-test NextionDriver: Received 86 bytes from host
64413 │ Jun 2 15:36:26 pi-star-test NextionDriver: RX: MMDVM.status.val=62
64414 │ Jun 2 15:36:26 pi-star-test NextionDriver: NET: MMDVM.status.val=62
64415 │ Jun 2 15:36:26 pi-star-test NextionDriver: LH: check [MMDVM.status.val=62] on page 2
64416 │ Jun 2 15:36:26 pi-star-test NextionDriver: RX: click S0,1
64417 │ Jun 2 15:36:26 pi-star-test NextionDriver: NET: click S0,1
64418 │ Jun 2 15:36:26 pi-star-test NextionDriver: LH: check [click S0,1] on page 2
64419 │ Jun 2 15:36:26 pi-star-test NextionDriver: RX: t1.txt="TG91"
64420 │ Jun 2 15:36:26 pi-star-test NextionDriver: NET: t1.txt="TG91"
64421 │ Jun 2 15:36:26 pi-star-test NextionDriver: LH: check [t1.txt="TG91"] on page 2
64422 │ Jun 2 15:36:26 pi-star-test NextionDriver: LH: page 2 field 1 is [txt="TG91"]
64423 │ Jun 2 15:36:26 pi-star-test NextionDriver: LH: statusval 62
64424 │ Jun 2 15:36:26 pi-star-test NextionDriver: NO LH Inhibit#012
64425 │ Jun 2 15:36:26 pi-star-test NextionDriver: --- Group search for ID 91 (0 - 1522)
64426 │ Jun 2 15:36:26 pi-star-test NextionDriver: --- Group search for ID 91 (0 - 761)
64427 │ Jun 2 15:36:26 pi-star-test NextionDriver: --- Group search for ID 91 (0 - 380)
64428 │ Jun 2 15:36:26 pi-star-test NextionDriver: --- Group search for ID 91 (0 - 190)
64429 │ Jun 2 15:36:26 pi-star-test NextionDriver: --- Group search for ID 91 (0 - 95)
64430 │ Jun 2 15:36:26 pi-star-test NextionDriver: --- Group search for ID 91 (0 - 47)
64431 │ Jun 2 15:36:26 pi-star-test NextionDriver: --- Group search for ID 91 (0 - 23)
64432 │ Jun 2 15:36:26 pi-star-test NextionDriver: --- Group search for ID 91 (0 - 11)
64433 │ Jun 2 15:36:26 pi-star-test NextionDriver: NET: t9.txt="World-wide"
64434 │ Jun 2 15:36:26 pi-star-test NextionDriver: LH: check [t9.txt="World-wide"] on page 2
64435 │ Jun 2 15:36:26 pi-star-test NextionDriver: LH: page 2 field 9 is [txt="World-wide"]
64436 │ Jun 2 15:36:26 pi-star-test NextionDriver: LH: statusval 0 <-----
64437 │ Jun 2 15:36:26 pi-star-test NextionDriver: NET: t9.txt="World-wide"
64438 │ Jun 2 15:36:26 pi-star-test NextionDriver: LH: check [t9.txt="World-wide"] on page 2
64439 │ Jun 2 15:36:26 pi-star-test NextionDriver: LH: page 2 field 9 is [txt="World-wide"]
64440 │ Jun 2 15:36:26 pi-star-test NextionDriver: LH: statusval 0 <-----
64441 │ Jun 2 15:36:26 pi-star-test NextionDriver: RX: MMDVM.status.val=65
64442 │ Jun 2 15:36:26 pi-star-test NextionDriver: NET: MMDVM.status.val=65
64443 │ Jun 2 15:36:26 pi-star-test NextionDriver: LH: check [MMDVM.status.val=65] on page 2
64444 │ Jun 2 15:36:26 pi-star-test NextionDriver: RX: click S0,1
64445 │ Jun 2 15:36:26 pi-star-test NextionDriver: NET: click S0,1
64446 │ Jun 2 15:36:26 pi-star-test NextionDriver: LH: check [click S0,1] on page 2
64447 │ Jun 2 15:36:27 pi-star-test NextionDriver: Received 35 bytes from host
64448 │ Jun 2 15:36:27 pi-star-test NextionDriver: RX: MMDVM.status.val=64
64449 │ Jun 2 15:36:27 pi-star-test NextionDriver: NET: MMDVM.status.val=64
64450 │ Jun 2 15:36:27 pi-star-test NextionDriver: LH: check [MMDVM.status.val=64] on page 2
64451 │ Jun 2 15:36:27 pi-star-test NextionDriver: RX: click S0,1
64452 │ Jun 2 15:36:27 pi-star-test NextionDriver: NET: click S0,1
64453 │ Jun 2 15:36:27 pi-star-test NextionDriver: LH: check [click S0,1] on page 2
64454 │ Jun 2 15:36:35 pi-star-test NextionDriver: Received 23 bytes from host
64455 │ Jun 2 15:36:35 pi-star-test NextionDriver: RX: t0.txt="1 Listening"
64456 │ Jun 2 15:36:35 pi-star-test NextionDriver: NET: t0.txt="1 Listening"
64457 │ Jun 2 15:36:35 pi-star-test NextionDriver: LH: check [t0.txt="1 Listening"] on page 2
64458 │ Jun 2 15:36:35 pi-star-test NextionDriver: LH: page 2 field 0 is [txt="1 Listening"]
64459 │ Jun 2 15:36:35 pi-star-test NextionDriver: LH: statusval 64
Code: Select all
1420 │ Jun 2 14:17:29 pi-star-test NextionDriver: NET: click S0,1
1421 │ Jun 2 14:17:29 pi-star-test NextionDriver: LH: check [click S0,1] on page 2
1422 │ Jun 2 14:17:29 pi-star-test NextionDriver: RX: t1.txt="TG91"
1423 │ Jun 2 14:17:29 pi-star-test NextionDriver: NET: t1.txt="TG91"
1424 │ Jun 2 14:17:29 pi-star-test NextionDriver: LH: check [t1.txt="TG91"] on page 2
1425 │ Jun 2 14:17:29 pi-star-test NextionDriver: LH: page 2 field 1 is [txt="TG91"]
1426 │ Jun 2 14:17:29 pi-star-test NextionDriver: LH: statusval 62 <------
1427 │ Jun 2 14:17:29 pi-star-test NextionDriver: NO LH Inhibit#012
1428 │ Jun 2 14:17:29 pi-star-test NextionDriver: --- Group search for ID 91 (0 - 1522)
1429 │ Jun 2 14:17:29 pi-star-test NextionDriver: --- Group search for ID 91 (0 - 761)
1430 │ Jun 2 14:17:29 pi-star-test NextionDriver: --- Group search for ID 91 (0 - 380)
1431 │ Jun 2 14:17:29 pi-star-test NextionDriver: --- Group search for ID 91 (0 - 190)
1432 │ Jun 2 14:17:29 pi-star-test NextionDriver: --- Group search for ID 91 (0 - 95)
1433 │ Jun 2 14:17:29 pi-star-test NextionDriver: --- Group search for ID 91 (0 - 47)
1434 │ Jun 2 14:17:29 pi-star-test NextionDriver: --- Group search for ID 91 (0 - 23)
1435 │ Jun 2 14:17:29 pi-star-test NextionDriver: --- Group search for ID 91 (0 - 11)
1436 │ Jun 2 14:17:29 pi-star-test NextionDriver: NET: t9.txt="World-wide"
1437 │ Jun 2 14:17:29 pi-star-test NextionDriver: LH: check [t9.txt="World-wide"] on page 2
1438 │ Jun 2 14:17:29 pi-star-test NextionDriver: LH: page 2 field 9 is [txt="World-wide"]
1439 │ Jun 2 14:17:29 pi-star-test NextionDriver: LH: statusval 0 <----- 62?
1440 │ Jun 2 14:17:29 pi-star-test NextionDriver: NET: t9.txt="World-wide"
1441 │ Jun 2 14:17:29 pi-star-test NextionDriver: LH: check [t9.txt="World-wide"] on page 2
1442 │ Jun 2 14:17:29 pi-star-test NextionDriver: LH: page 2 field 9 is [txt="World-wide"]
1443 │ Jun 2 14:17:29 pi-star-test NextionDriver: LH: statusval 0 <----- 62?
1444 │ Jun 2 14:17:29 pi-star-test NextionDriver: RX: MMDVM.status.val=65
1445 │ Jun 2 14:17:29 pi-star-test NextionDriver: NET: MMDVM.status.val=65
1446 │ Jun 2 14:17:29 pi-star-test NextionDriver: LH: check [MMDVM.status.val=65] on page 2
1447 │ Jun 2 14:17:30 pi-star-test NextionDriver: RX: click S0,1
1448 │ Jun 2 14:17:30 pi-star-test NextionDriver: NET: click S0,1
1449 │ Jun 2 14:17:30 pi-star-test NextionDriver: LH: check [click S0,1] on page 2
1450 │ Jun 2 14:17:30 pi-star-test NextionDriver: Received 90 bytes from host
1451 │ Jun 2 14:17:30 pi-star-test NextionDriver: RX: t8.txt="N TA3AUP"
1452 │ Jun 2 14:17:30 pi-star-test NextionDriver: NET: t8.txt="N TA3AUP"
1453 │ Jun 2 14:17:30 pi-star-test NextionDriver: LH: check [t8.txt="N TA3AUP"] on page 2
1454 │ Jun 2 14:17:30 pi-star-test NextionDriver: LH: page 2 field 8 is [txt="N TA3AUP"]
1455 │ Jun 2 14:17:30 pi-star-test NextionDriver: LH: statusval 65 <------ 70!
1456 │ Jun 2 14:17:30 pi-star-test NextionDriver: RX: MMDVM.status.val=63
1457 │ Jun 2 14:17:30 pi-star-test NextionDriver: NET: MMDVM.status.val=63
1458 │ Jun 2 14:17:30 pi-star-test NextionDriver: LH: check [MMDVM.status.val=63] on page 2
1459 │ Jun 2 14:17:30 pi-star-test NextionDriver: RX: click S0,1
1460 │ Jun 2 14:17:30 pi-star-test NextionDriver: NET: click S0,1
1461 │ Jun 2 14:17:30 pi-star-test NextionDriver: LH: check [click S0,1] on page 2
1462 │ Jun 2 14:17:30 pi-star-test NextionDriver: RX: MMDVM.status.val=64
1463 │ Jun 2 14:17:30 pi-star-test NextionDriver: NET: MMDVM.status.val=64
1464 │ Jun 2 14:17:30 pi-star-test NextionDriver: LH: check [MMDVM.status.val=64] on page 2
1465 │ Jun 2 14:17:30 pi-star-test NextionDriver: RX: click S0,1
1466 │ Jun 2 14:17:30 pi-star-test NextionDriver: NET: click S0,1
1467 │ Jun 2 14:17:30 pi-star-test NextionDriver: LH: check [click S0,1] on page 2
1468 │ Jun 2 14:17:37 pi-star-test NextionDriver: Received 70 bytes from host
Ok, so I'm asking you to trust my analysis here: the logs are difficult to shift through and you have to have a good sense of how the data streams are being constructed and sent to the Nextion display and interactions of the variables and status codes therein.
The basic concept is that a buffer is constructed with a command and some status information and variables to be set, and then sent out to the display. For our particular case (the subject of this thread), it is obvious that the "status" information associated with some variables are either incorrect (set to zero) or held over from a previous command (with an improper status code being sent).
I believe the problem is in the Nextion Driver code - as noted elsewhere, specifically the "basicFunctions.c" section of code, wherein, three send commands should be invoked instead of just one as is the case currently:
Code: Select all
//send TG name if found (Slot 1)
if ((page==2)&&(strstr(TXbuffer,"t1.txt")!=NULL)&&(TXbuffer[8]!='"')) {
char *TGname;
int nr,TGindex;
sendCommand(TXbuffer);
if ((TXbuffer[8]>='0')&&(TXbuffer[8]<='9'))
nr=atoi(&TXbuffer[8]);
else
nr=atoi(&TXbuffer[10]);
TGindex=search_group(nr,groups,0,nmbr_groups-1);
writelog(LOG_INFO,"Search group %d (index %d)",nr,TGindex);
if (TGindex>=0) {
TGname=groups[TGindex].name;
writelog(LOG_INFO,"Found %s",TGname);
sprintf(TXbuffer,"t9.txt=\"%s\"",TGname);
} else if (TGindex<0) {
//is it maybe a user private call ?
TGindex=search_user_index_for_ID(nr,users,0,nmbr_users-1);
writelog(LOG_INFO,"- Found [%s] for ID %d",users[TGindex].data1,nr);
if (TGindex>=0) sprintf(TXbuffer,"t9.txt=\"Private %s\"",users[TGindex].data1);
} else {
sprintf(TXbuffer,"t9.txt=\"TG%d name not found\"",nr);
}
sendCommand(TXbuffer);
sprintf(text, "MMDVM.status.val=62"); <----
sendCommand(text); <----
sendCommand("click S0,1"); <----
}
//send TG name if found (Slot 2)
if ((page==2)&&(strstr(TXbuffer,"t3.txt")!=NULL)&&(TXbuffer[8]!='"')) {
char *TGname;
int nr,TGindex;
sendCommand(TXbuffer);
if ((TXbuffer[8]>='0')&&(TXbuffer[8]<='9'))
nr=atoi(&TXbuffer[8]);
else
nr=atoi(&TXbuffer[10]);
TGindex=search_group(nr,groups,0,nmbr_groups-1);
writelog(LOG_INFO,"Search group %d (index %d)",nr,TGindex);
if (TGindex>=0) {
TGname=groups[TGindex].name;
writelog(LOG_INFO,"Found %s",TGname);
sprintf(TXbuffer,"t8.txt=\"%s\"",TGname);
} else if (TGindex<0) {
//is it maybe a user private call ?
TGindex=search_user_index_for_ID(nr,users,0,nmbr_users-1);
writelog(LOG_INFO,"- Found [%s] for ID %d",users[TGindex].data1,nr);
if (TGindex>=0) sprintf(TXbuffer,"t8.txt=\"Private %s\"",users[TGindex].data1);
} else {
sprintf(TXbuffer,"t8.txt=\"TG%d name not found\"",nr);
}
sendCommand(TXbuffer);
sprintf(text, "MMDVM.status.val=70"); <----
sendCommand(text); <----
sendCommand("click S0,1"); <----
}
I'm not an expert on this but that's my analysis and I'm sticking with it (until further notice).
Check it out and let me know: comments? questions?
-----
Changing (compiling) the Nextion Driver is an involved process, for me anyway: haven't quite got the hang of all the in's and out's of the process, so if you've got a better handle on this aspect of things, I'd appreciate the help, your thoughts.
In the meantime, I thought of a way to get around the problem, to "correct" the data after it gets to the Nextion display, on the fly:
In the HMI code, specifically in the DMR screen, code could be added to save/restore the t8/t9 values across screen refreshes, accounting for the proper assignments of the fields and the faulty status codes being passed:
Code: Select all
//Variables
t30.txt=MMDVM.va1.txt
t32.txt=MMDVM.va0.txt
t50.txt=MMDVM.va2.txt
t51.txt=MMDVM.va4.txt
t52.txt=MMDVM.va3.txt
t53.txt=MMDVM.va5.txt
t500.txt=MMDVM.va7.txt
//************************************************************
// Copyright 2018-2021 by PD0DIB | Rob van Rheenen
// SET SCREENLAYOUT TO TYPE 3 - Pi-Star to ON7LDS L3
// the DMRID/TA field will be processed - Code partly by ON7LDS
// depending on type (ID, TA, call end) color and font size are set
//choose font size
t0.font=3
t2.font=3
strlen t0.txt,tmp0.val
strlen t2.txt,tmp1.val
if(tmp0.val>22)
{
t0.font=2
}
if(tmp1.val>22)
{
t2.font=2
}
if(tmp0.val>31)
{
t0.font=1
}
if(tmp1.val>31)
{
t2.font=1
}
if(tmp0.val>35)
{
t0.font=0
}
if(tmp1.val>35)
{
t2.font=0
}
//text color (for slot 1)
if(MMDVM.status.val>60)
{
if(MMDVM.status.val<65)
{
//status 61=listening, 62=ID, 63=TA, 64=call end
if(MMDVM.status.val==61)
{
t0.pco=0
}
//ID
if(MMDVM.status.val==62)
{
t0.pco=31
}
//TA
if(MMDVM.status.val==63)
{
t0.pco=1024
}
//Call end
if(MMDVM.status.val==64)
{
t0.pco=33808
}
}
}
//text color (for slot 2)
if(MMDVM.status.val>68)
{
if(MMDVM.status.val<73)
{
//status 69=listening, 70=ID, 71=TA, 72=call end
if(MMDVM.status.val==69)
{
t2.pco=0
}
//ID
if(MMDVM.status.val==70)
{
t2.pco=31
}
//TA
if(MMDVM.status.val==71)
{
t2.pco=1024
}
//Call end
if(MMDVM.status.val==72)
{
t2.pco=33808
}
}
}
//last heard & talkgroup LH
//timeslot 1
if(MMDVM.status.val==64)
{
if(g0bis.txt!=t0.txt)
{
g0bis.txt=t0.txt
}
if(t1bis.txt!=t1.txt)
{
t1bis.txt=t1.txt
}
}
//restore previous ts2 tgname
if(MMDVM.status.val==64)
{
t8.txt=MMDVM.va9.txt
}
//timeslot 2
if(MMDVM.status.val==72)
{
if(g2bis.txt!=t2.txt)
{
g2bis.txt=t2.txt
}
if(t3bis.txt!=t3.txt)
{
t3bis.txt=t3.txt
}
}
if(MMDVM.status.val==72)
{
//restore previous ts1 tgame
t9.txt=MMDVM.va10.txt
}
//save ts1(t9) and ts2(t8) for next time
MMDVM.va9.txt=t9.txt
MMDVM.v10.txt=t8.txt
Note: for this to work, va9.txt and va10.txt need to be declared as global variables under "page 0" (the initial screen).
More on this approach later.
(BTW: Does anyone know how to get the nextion.py routine to work? It can't seem to determine a workable baudrate)