Page 1 of 1

Error trying to get the NEO3-LTS and I2C LCD1602 to work

Posted: Sun Oct 23, 2022 12:08 pm
by vlx
I am getting an error trying to get the NEO3-LTS and I2C LCD1602 to work. After successfully getting the I2C LCD1602 connected to the NEO3-LTS and following the instructions posted at https://wiki.friendlyelec.com/wiki/inde ... 2C_LCD1602.

$ sudo apt-get update && sudo apt-get install git
$ sudo git clone https://github.com/friendlyarm/matrix.git
$ cd matrix
$ sudo make && sudo make install

I am getting an error when running the command: $ matrix-lcd1602

Hardware:NANOPI-R2
Revision:0002
BoardType:-1
FAHW-Lib: Fail to initPinGPIO
FAHW-Lib: Fail to initPwmGPIO
Fail to init board

So, I decided to follow the instructions for matrix-adruino, but I got an error also:
$ sudo git clone git://github.com/friendlyarm/matrix-arduino.git
fatal: unable to connect to github.com:
github.com[0: 140.82.112.3]: errno=Connection timed out

It seems matrix-arduino.git is not available on github.com

Any assistance would be grateful. I am working on a massive project that could involve purchasing 100 or more of the NEO3 and I2C LCD1602, but I have to make sure I can display the IP address of the NEO3 once it is powered on. We are selecting the NEO3-LTS mainly because of the two available USB headers on the board to connect to other devices; therefore, we cannot use the LCD2USB instead of the I2C LCD1602.

Thank you

Re: Error trying to get the NEO3-LTS and I2C LCD1602 to work

Posted: Tue Oct 25, 2022 6:02 pm
by usual user
Any assistance would be grateful.
The kernel has been supporting such devices for quite some time. If properly wired up in devicetree, the following control codes are supported for /dev/lcd:

Code: Select all

 HEX  | ASCII        | \-ESC /* description */

 0x08 | <BS>         | \b    /* go back one char and clear it */
 0x0A | <LF>         | \n    /*
                              * flush the remainder of the current line and
                              * go to the beginning of the next line
                              */
 0x0C | <FF>         | \f    /* quickly clear the display */
 0x0D | <CR>         | \r    /* go to the beginning of the same line */
 0x09 | <HT>         | \t    /* print a space instead of the tab */
 0x1B | <ESC>        | \E    /* Escape sequence begin

 0x1B 0x5B 0x48      | \E[H  /* cursor to home */

 0x1B 0x5B 0x32 0x4A | \E[2J /* clear the display */

 0x1B 0x5B 0x4C 0x2A | \E[L* /* Flash back light */
 0x1B 0x5B 0x4C 0x2B | \E[L+ /* Back light ON */
 0x1B 0x5B 0x4C 0x2D | \E[L- /* Back light OFF */
 0x1B 0x5B 0x4C 0x42 | \E[LB /* Blink ON */
 0x1B 0x5B 0x4C 0x62 | \E[Lb /* Blink OFF */
 0x1B 0x5B 0x4C 0x43 | \E[LC /* Cursor ON */
 0x1B 0x5B 0x4C 0x63 | \E[Lc /* Cursor OFF */
 0x1B 0x5B 0x4C 0x44 | \E[LD /* Display ON */
 0x1B 0x5B 0x4C 0x64 | \E[Ld /* Display OFF */
 0x1B 0x5B 0x4C 0x46 | \E[LF /* Large Font */
 0x1B 0x5B 0x4C 0x66 | \E[Lf /* Small Font */
 0x1B 0x5B 0x4C 0x47 | \E[LG /* Generator : LGcxxxxx...xx; must have <c> between '0'
                              * and '7', representing the numerical ASCII code of the
                              * redefined character, and <xx...xx> a sequence of 16
                              * hex digits representing 8 bytes for each character.
                              * Most LCDs will only use 5 lower bits of the 7 first
                              * bytes.
                              */
 0x1B 0x5B 0x4C 0x49 | \E[LI /* reinitialize display */
 0x1B 0x5B 0x4C 0x6B | \E[Lk /* kill end of line */
 0x1B 0x5B 0x4C 0x4C | \E[LL /* shift display left */
 0x1B 0x5B 0x4C 0x6C | \E[Ll /* Shift Cursor Left */
 0x1B 0x5B 0x4C 0x4E | \E[LN /* Two Lines */
 0x1B 0x5B 0x4C 0x6E | \E[Ln /* One Line */
 0x1B 0x5B 0x4C 0x52 | \E[LR /* shift display right */
 0x1B 0x5B 0x4C 0x72 | \E[Lr /* shift cursor right */
 0x1B 0x5B 0x4C 0x78 | \E[Lx /* gotoxy : LxXXX[yYYY]; */
 0x1B 0x5B 0x4C 0x79 | \E[Ly /* gotoxy : LyYYY[xXXX]; */

And can be used like this:

Code: Select all

printf %b "\fBy Your\nCommand\E[Lc\E[Lb\E[L+" > /dev/lcd
printf %b "\fHello World\n$(date +"%F %T")\E[L+" > /dev/lcd

Re: Error trying to get the NEO3-LTS and I2C LCD1602 to work

Posted: Tue Dec 27, 2022 4:49 pm
by techkev99
I have the same issue with the LCD 1602. In the Matrix codes, it seems like the board name is not listed. Perhaps this is the reason why it not initializing.