0

I have developed a remotely controlled messaging device based on the Raspberry Pi. This device is located in public space, connects to the institution's WiFi and works autonomously for months.

However, it is very difficult to troubleshoot the device, especially when it loses the WiFi connection for an unknown reason. The most obvious solution is to connect a HDMI monitor or even better an HDMI capture card and see what is going on.

In particular, I want to connect the HDMI input of the capture card to the HDMI output of the Raspberry Pi, the USB output of the capture card to the PC and then open the USB camera software on the PC:

Raspberry Pi -------> HDMI capture card -------> PC

See also: https://andyfelong.com/2020/07/hdmi-video-capture-via-usb-adapter/

However, if the HDMI capture card (or HDMI monitor) is not connected during the power-on process, HDMI will not work.

After this answer I tried to add the following

hdmi_force_hotplug=1
hdmi_drive=2

to /boot/config.txt. However, this does not work.

If the Raspberry Pi is connected to the HDMI capture card during the power-on process, the connection information is:

xrandr
Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 7680 x 7680
HDMI-1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 477mm x 268mm
1920x1080     60.00*+  50.00    59.94    30.00    25.00    24.00    29.97    23.98

kmsprint Connector 0 (32) HDMI-A-1 (connected) Encoder 0 (31) TMDS Crtc 3 (96) 1920x1080@60.00 148.500 1920/88/44/148/+ 1080/4/5/36/+ 60 (60.00)
Plane 3 (86) fb-id: 339 (crtcs: 3) 0,0 1920x1080 -> 0,0 1920x1080 (XR24 AR24 AB24 XB24 RG16 BG16 AR15 XR15 RG24 BG24 YU16 YV16 YU24 YV24 YU12 YV12 NV12 NV21 NV16 NV61 P030 XR30 AR30 AB30 XB30 RGB8 BGR8 XR12 AR12 XB12 AB12 BX12 BA12 RX12 RA12) FB 339 1920x1080 XR24 Plane 25 (309) fb-id: 342 (crtcs: 3) 0,0 64x64 -> 459,107 64x64 (XR24 AR24 AB24 XB24 RG16 BG16 AR15 XR15 RG24 BG24 YU16 YV16 YU24 YV24 YU12 YV12 NV12 NV21 NV16 NV61 P030 XR30 AR30 AB30 XB30 RGB8 BGR8 XR12 AR12 XB12 AB12 BX12 BA12 RX12 RA12) FB 342 64x64 AR24

Is there a way to force HDMI functionality even if the HDMI capture card is not connected during the power-on process?

Model: Raspberry Pi 4
Operating System: Debian GNU/Linux 11 (bullseye)
Kernel: Linux 6.1.21-v8+
Pygmalion
  • 458
  • 2
  • 7
  • 25

2 Answers2

2

Have you considered using the serial console instead of HDMI? You can log in and examine the system via the serial console, even if the Pi has no network connectivity.

You would of course need to somehow get the serial console accessible remotely. For that you can use something like an Elfin EW42B to make the 3.3V TTL signal available via WiFi.

This would give you two IP addresses on the network - one for the Pi itself, and one for the serial console. If the Pi drops off the network, you can log in to it via the serial console to see what happened.

I also had problems getting the Pi to stay connected to WiFi over multiple days, so to solve that I got a cheap WiFi router, and set it up in client mode, so it's the router that joins the WiFi network instead of the Pi. It then bridges WiFi with its wired ports, and the Pi plugs into the router via a short Ethernet cable.

I found this way to be much more reliable as the router does a very good job of reconnecting to the WiFi if it drops out for any reason, and the Pi has no problems maintaining a stable wired Ethernet connection to the router.

Malvineous
  • 2,109
  • 15
  • 25
0

After an extended search, I finally came across this document Troubleshooting KMS HDMI output:

The solution can be found on pages 8 and 9. I first connected the HDMI capture card before switching on the Raspberry Pi so that the connection could be established correctly. I then created an EDID file by

sudo cp /sys/class/drm/card?-HDMI-A-1/edid /lib/firmware/myedid.dat

Finally, I instructed KMS to use this EDID data by adding the following

drm.edid_firmware=myedid.dat

to /boot/firmwire/cmdline.txt.

This works for bookworm, the correct solution for bullseye is provided by Answer Bot.

Pygmalion
  • 458
  • 2
  • 7
  • 25