-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A few suggestions for improvements #2
Comments
@geerlingguy |
@arducamStephen - Thanks for the responses! When I run
So for some reason it seems like it's not picking up an IP address, even though there is one on the Pi. I checked on the other four Pis and they all have 10.0.100.x addresses assigned on |
@geerlingguy |
Hi Jeff - I had same issue as you, I did not move dtparam, but split the two directives and that seemed to work for me |
None of the above Using |
Thanks for the thread guys! I had the same "Device I2C-1 failed to initialize" error when following the README guide and the tips in this thread all collectively solved the issue - uncommenting dtparam=i2c_arm=on, adding dtparam=i2c_arm_baudrate=400000 on it's own line, and using sudo raspi-config to enable i2c-dev. I would also love to see @geerlingguy's suggestion #3 above implemented. |
This thread helped clarify the instructions that are bundled with the hardware and resolved my issue |
Thanks y'all for the extremely helpful discussion and workarounds. I was able to get my Pi Rack PRO OLEDs displaying Pi information. ::thumbsup:: After getting the first Pi OLED up and running, I hacked together an Ansible script to make installing the rest foolproof and repeatable (relatively). Here it is for anybody else who wanders this way: |
Can I suggest that it is not necessary to compile the display binary on every boot? Just compile it once, move it to |
I am not sure if this is a dead thread or not. But I thought I would update with my configs and tools. The reason being is that recently I got the Pi Rack and still could not get the screens to work even with the above. So I took apart the raspi-config script for i2c and built a bash script and an ansible playbook to get it all to work. For reference, you can run raspi-config from the command line (soft of) because if you are like me, you live in CLI and rarely use a GUI. The following will enable i2c within sudo raspi-config nonint do_i2c 0 That being said I went ahead and overkilled it by also manually making sure things are set in the script and the playbook. I have also included the change to stop compiling on boot and rather move the binary to The boot config I have below also disables Bluetooth and Wi-Fi, as I am using a PoE HAT. BASH SCRIPT### REPLACE /boot/config.txt with ../configs/boot.conf ###
sudo sed -i 's/#dtparam=i2c_arm=on/dtparam=i2c_arm=on/g' /boot/config.txt
sudo sed -i '/dtparam=i2c_arm=on/a\dtparam=i2c_arm_baudrate=400000' /boot/config.txt
sudo sed -i '/#dtparam=spi=on/a\dtoverlay=gpio-shutdown,gpio_pin=4,active_low=1,gpio_pull=up' /boot/config.txt
### ENABLE i2c IN FIRMWARE ###
sudo sed -i 's/#dtparam=i2c_arm=on/dtparam=i2c_arm=on/g' /boot/firmware/config.txt
### RASPI ENABLE i2c ###
sudo raspi-config nonint do_i2c 0
### ADD i2c TO /etc/modules ###
sudo echo "i2c-dev" | sudo tee -a /etc/modules >/dev/null
### MAKE SKU_RM0004 ###
git clone https://github.com/UCTRONICS/SKU_RM0004.git
cd SKU_RM0004
make clean
make
### MOVE display TO /usr/local/bin ###
sudo cp display /usr/local/bin
### REMOVE SKU_RM0004 ###
cd ..
sudo rm -rf SKU_RM0004
### ADD TO /etc/rc.local ###
sudo sed -i '/exit 0/i\/usr/local/bin/display &' /etc/rc.local
### REBOOT ###
sudo reboot ANSIBLE PLAYBOOK- name: Install SKU_RM0004
hosts: pis
become: yes
tasks:
- name: Replace /boot/config.txt with ../configs/boot.conf
copy:
src: ../configs/boot.conf
dest: /boot/config.txt
- name: Enable i2c_arm in /boot/firmware/config.txt
lineinfile:
path: /boot/firmware/config.txt
regexp: '^#dtparam=i2c_arm=on'
line: 'dtparam=i2c_arm=on'
- name: Add to /etc/modules
lineinfile:
path: /etc/modules
line: 'i2c-dev'
create: yes
- name: Enable I2C
command: raspi-config nonint do_i2c 0
- name: Remove existing SKU_RM0004 library
file:
path: '/home/pi/SKU_RM0004'
state: absent
- name: Clone SKU_RM0004 library
git:
repo: 'https://github.com/UCTRONICS/SKU_RM0004.git'
dest: '/home/pi/SKU_RM0004'
- name: Clean SKU_RM0004
make:
chdir: '/home/pi/SKU_RM0004'
target: clean
- name: Make SKU_RM0004
make:
chdir: '/home/pi/SKU_RM0004'
- name: Move display to /usr/local/bin
copy:
src: '/home/pi/SKU_RM0004/display'
dest: '/usr/local/bin/display'
remote_src: yes
mode: '0755'
- name: Remove SKU_RM0004 directory
file:
path: '/home/pi/SKU_RM0004'
state: absent
- name: Remove existing exit 0 from /etc/rc.local
lineinfile:
path: /etc/rc.local
line: 'exit 0'
state: absent
- name: Add to /etc/rc.local
blockinfile:
path: /etc/rc.local
block: |
/usr/local/bin/display &
exit 0
insertafter: EOF
- name: Reboot
reboot: BOOT CONFIG# For more options and information see
# http://rptl.io/configtxt
# Additional overlays and parameters are documented
# /boot/firmware/overlays/README
# Uncomment some or all of these to enable the optional hardware interfaces
dtparam=i2c_arm=on
dtparam=i2c_arm_baudrate=400000
#dtparam=i2s=on
#dtparam=spi=on
# Enable shutdown button
dtoverlay=gpio-shutdown,gpio_pin=4,active_low=1,gpio_pull=up
# Disable WiFi and Bluetooth
dtoverlay=disable-wifi
dtoverlay=disable-bt
# Enable audio (loads snd_bcm2835)
dtparam=audio=on
# Automatically load overlays for detected cameras
camera_auto_detect=1
# Automatically load overlays for detected DSI displays
display_auto_detect=1
# Automatically load initramfs files, if found
auto_initramfs=1
# Enable DRM VC4 V3D driver
dtoverlay=vc4-kms-v3d
max_framebuffers=2
# Don't have the firmware create an initial video= setting in cmdline.txt.
# Use the kernel's default instead.
disable_fw_kms_setup=1
# Run in 64-bit mode
arm_64bit=1
# Disable compensation for displays with overscan
disable_overscan=1
# Run as fast as firmware / board allows
arm_boost=1
# Enable host mode on the 2711 built-in XHCI USB controller.
[cm4]
otg_mode=1 |
just purchased one of these racks and the code to get this up and running just isn't working. How has there not been any clear solution on the UCTRONICS installation page |
For those trying this out on a Pi 5, you should know that the following setting auto-triggers a safe shutdown as soon as booting has completed.
Commenting that out fixed the issue entirely. I haven't had the time to look into why, but hopefully if anyone else is seeing issues, this should sort it out. Thanks to everyone above for all the great tips! A bit of a shame it required this much effort to get the rack up and running. |
I had a few issues with my initial setup of the LCD for my rack unit, and not all of these are problems, but a few suggestions too:
1. Enabling I2C didn't work
Using the provided instructions, when I tried running the display, I got the following error:
Indeed, even with
dtparam=i2c_arm=on,i2c_arm_baudrate=400000
appended to my boot config and after a restart, I would keep getting that error.I found out after a bit of debugging I had to put the
dtparam=i2c_arm=on
line earlier in my/boot/config.txt
file. I was putting it near the end but for some reason that wasn't working. There was a commented line earlier in the file, and I uncommented that line, and everything works.When I ran
sudo raspi-config
and enabled the I2C interface via that CLI interface, it also seemed to work, whereas manually enabling it by uncommenting the line didn't always. Not sure why, and I tried on both Buster and Bullseye.So maybe updating the statement in the README to uncomment the existing line, and add on the
i2c_arm_baudrate
at the end, would be less prone to failure.2. IP address always displayed as xxx.xxx.xxx.xxx(see #4)My Pis are all plugged in via Ethernet, and if I run
ip a
I see something like:But the IP address is never shown on the LCD. It looks like
lcd_display_cpuLoad
callsget_ip_address
(though the comment there mentions wireless... it looks like the code looks for eth0...), but for some reason it never gets the IP for my Pis.3. Simpler display preferred
The default settings make a display that refreshes parts and has four different displays cycling at all times. For my purposes, I would just like the IP address, and maybe the CPU temperature displayed (or something similarly simple, like hostname and IP). It would be great if this script could be customized to just display one thing and refresh every 5 seconds or something... or just display a text string on the screen.
I can see how to do that in the C, but having a little more flexibility could be nice. Otherwise, maybe someone in the community has a nice library that can do it separately... I noticed that the default setup would cause 3-5% CPU load every five seconds or so. Nothing crazy, but it is a lot of load just to update an informational display (which will not be looked at 99% of the time).
The text was updated successfully, but these errors were encountered: