jjg / recon-sentinel-hacking

6 stars 2 forks source link

Thanks! #1

Open clach04 opened 3 years ago

clach04 commented 3 years ago

Quick thank you and feedback :)

You can avoid sudo by using (existing) i2c user group, if your installation is missing that check out https://lexruee.ch/setting-i2c-permissions-for-non-root-users.html

I'm using https://minio.k-space.ee/armbian/dl/rock64/archive/Armbian_20.11.10_Rock64_focal_current_5.9.14.img.xz:

Armbian 20.11.6 Focal with Linux 5.9.14-rockchip64

and I only had to add my (current) user to the i2c group via:

sudo usermod -aG i2c $USER

I tried a few other Python scripts/libs for LCD and I've decided I like https://github.com/dbrgn/RPLCD (note my i2c address is different to yours):

from RPLCD.i2c import CharLCD

lcd = CharLCD('PCF8574', 0x27)  # determine address via "i2cdetect -y 1"

lcd.clear()
lcd.write_string('The quick brown fox jumps over the lazy dog')

I had success with:

Did not end up trying:

jjg commented 3 years ago

Thanks for the feedback! I will give this a shot next time I get a chance to play with the board and update the docs accordingly.

I have a few more ideas for example scripts (including a basic system resource display) so I’m looking forward to playing with it again soon.

clach04 commented 3 years ago

@jjg I had a quick play with lcdproc and that's a no-go out of the box unless hacking (e.g. using something like https://github.com/wilberforce/lcdproc) I've not made the proper time to complete checking this out. But I was at least able to get (headrevs) built:

/configure  --disable-libftdi --disable-libusb       --disable-libusb-1-0  --enable-drivers=curses,hd44780,text ; make

You may find lcdproc a good solution for basic system resource display if you can get the wiring updated (again, check out wilberforce's changes but they will need to be patched in, that or hard coding constants in the upstream C code 🤮 )

I created https://github.com/clach04/lcd_hack which I'm using to show the hostname + IP on boot and a shutdown message on shutdown. Its been helpful to me so far but its a little rough and ready. It looks like network-online.target is not implemented with Armbian (I'm too lazy to look into it, I currently sleep and retry for IP address which I'm happy with as it means I get display even before the network is up which I like).

clach04 commented 3 years ago

If you do install https://github.com/dbrgn/RPLCD the show charmap test works great:

    $ rplcd-tests i2c show_charmap expander=PCF8574 addr=0x27 port=1 cols=16 rows=2
This tool shows the character map of your LCD on the display.
Press ctrl+c at any time to abort.

Displaying page 1 (characters 0-31). Press <ENTER> to continue.
Displaying page 2 (characters 32-63). Press <ENTER> to continue.
Displaying page 3 (characters 64-95). Press <ENTER> to continue.
Displaying page 4 (characters 96-127). Press <ENTER> to continue.
Displaying page 5 (characters 128-159). Press <ENTER> to continue.
Displaying page 6 (characters 160-191). Press <ENTER> to continue.
Displaying page 7 (characters 192-223). Press <ENTER> to continue.
Displaying page 8 (characters 224-255). Press <ENTER> to continue.^CAborting.
Test done. If you have a programmable backlight, it should now be off.
kemenril commented 2 years ago

Not to revive an issue you may not have looked at for ages, but it's probably better that than adding a new one just to get in touch. I am interested in this project because I've been working with these systems myself, since they were originally fire-sale-ing them. I have a rather different solution I threw together for the LCD control, which involves a different Python library, (which may not be as good as the one you've been using), a client/server architecture, and communication between the two by named pipe.

Anyway, perhaps you can also benefit in some way from looking my work over. Feel free, if you're so inclined. https://github.com/kemenril/i2c-lcd