Page 1 of 1

small bug in HD44780 driver

Posted: Sun Sep 26, 2021 2:22 pm
by PD9MWO
Can someone help me with this . I am running Pi-Star:4.1.5 / Dashboard:20210721
currently with an i2c HD44780 20x4 screen but...
I am currently waiting on my HD44780 16x2 order but I had a 20x4 screen available.

In the 16x2 version there is a small problem. See Attached picture.
The error with pocsag messages on the display .

In the code i found at : https://github.com/MW0MWZ/MMDVMHost/blo ... D44780.cpp
At line 1055 & 1061 these lines have to change:
So - 5 into - 9 because it will not fit on the screen , it will go to the 1st line ( see picture )

1053 void CHD44780::writePOCSAGInt(uint32_t ric, const std::string& message)
1054 {
1055 ::lcdPosition(m_fd, m_cols - 9, m_rows - 1);
1056 ::lcdPuts(m_fd, "POCSAG TX");
1057 }
1058
1059 void CHD44780::clearPOCSAGInt()
1060 {
1061 ::lcdPosition(m_fd, m_cols - 9, m_rows - 1);
1062 ::lcdPuts(m_fd, " Idle");
1063 }

Can some one help me ???
Many many thanks in advance

Re: small bug in HD44780 driver

Posted: Wed Sep 29, 2021 2:43 pm
by PD9MWO
Fixed it ( see attached picture ) and contacted Andy to make the change in the code.
i use the I2C connectors on my MMDVM_HS

Tested it with DMR , Pocsag and YSF , looks fine

the actions i did :
  • rpi-rw
    mkdir /testing
    cd testing
    git clone https://github.com/g4klx/MMDVMHost.git
    cd MMDVMHost/
    make clean
    make -f Makefile.Pi.PCF8574
    systemctl stop mmdvmhost.timer;systemctl stop mmdvmhost.service
    cp /usr/local/bin/MMDVMHost /usr/local/bin/MMDVMHost.OLD
    cp MMDVMHost /usr/local/bin/MMDVMHost
    systemctl start mmdvmhost.timer;systemctl start mmdvmhost.service
so far so good !

Re: small bug in HD44780 driver

Posted: Fri Oct 01, 2021 9:00 am
by PD9MWO
yes i read your comment but that was after i changed the code.

the code is working perfectly and no issues with shifted words/letters.
And tested with several modes.

In this case the POCSAG TX is perfectly positioned in the right bottom side of the 16x2 i2c display
the word Idle is also positioned in the right spot , i dont see any issues

m

Re: small bug in HD44780 driver

Posted: Sat Oct 02, 2021 12:29 pm
by PD9MWO
Again , in my case its working perfectly .
Running it now for a couple of days with DMR , Pocsac and YSF , NO issues found on my screen.
m

Re: small bug in HD44780 driver

Posted: Sun Oct 03, 2021 8:52 am
by PD9MWO
Hi Jason ( KE7FNS )
Sorry to say but i stop this nonsense.

Again and Again i told you in my case everything is working perfect. !
NO issues on my screen.

If you want to change the code be my guest.
( https://github.com/g4klx/MMDVMHost/blob ... D44780.cpp )
Just make changes to my last code change if you want. Its fine by me !

From now on I stop comments in this thread.
Bye

Re: small bug in HD44780 driver

Posted: Sun Oct 03, 2021 2:12 pm
by f1rmb
Hi,
PD9MWO wrote: Sun Oct 03, 2021 8:52 am Hi Jason ( KE7FNS )
Sorry to say but i stop this nonsense.

Again and Again i told you in my case everything is working perfect. !
NO issues on my screen.

If you want to change the code be my guest.
( https://github.com/g4klx/MMDVMHost/blob ... D44780.cpp )
Just make changes to my last code change if you want. Its fine by me !

From now on I stop comments in this thread.
Bye
And you have made Jonathan to merge a bug:

Code: Select all

void CHD44780::clearPOCSAGInt()
{
	::lcdPosition(m_fd, m_cols - 9, m_rows - 1);
	::lcdPuts(m_fd, " Idle");
}
the string is 5 characters long, NOT 9.

Since you've increased the length of that field to 9, all string have to match that length.

EDIT: BTW, since it has to work on a 16x2, 8 have to be the maximum length for any field.

Cheers.
---
Daniel

Re: small bug in HD44780 driver

Posted: Thu Oct 07, 2021 4:01 am
by f1rmb
Hi,

FYI, I just saw the broken patch has been reverted on Jonathan's repo, also the "POCSAG TX" string was shortened to "POCSAG".

Way better ;-)


Cheers.
---
Daniel

Re: small bug in HD44780 driver

Posted: Thu Oct 07, 2021 6:45 am
by f1rmb
KE7FNS wrote: Thu Oct 07, 2021 6:22 am
Hrmm, you got me thinking is it better? or is it still broken... I just realized "POCSAG" is 6 characters, when it should only be 5 according to the string size limitations. So I wonder if the G is going to wrap to the next line or top in the case of a 16x2.

I guess I'll have to do some testing tomorrow when I get some free time.

I had hoped that G4KLX would of just completely reverted that guys code after the comments made him aware of the issue, but he asked me to do a pull request instead.

Its a shame he wouldn't fix his own code, if I would of screwed it up and someone pointed it out to me, I would of fixed it right away.
Well, in fact it's just a revert in the end (made by someone else), as the 'G' will still be missing. I quickly checked the code, but the POCSAG don't clear the whole LCD screen, but just overriding the field location.

Increasing the size of this field will require more changes to the code (it's 5 char long for info), and of course real testing ;)

Cheers.
---
Daniel