Open kottkrig opened 4 years ago
I’m happy to dive deeper into the code and eventually submit a PR. But I’m unsure on where to begin.
Sorry about the slow response. The GitHub notification system and I are not in agreement.
I think this could be related to some previous regression we've seen with the nerves system image missing the correct drivers that rpi_fb_capture requires to work. It was covered in this issue.
If you can give me what kind of Pi you are using and what your Nerves system version is (maybe what nerves bootstrap version you have), that'd be helpful. Also, check that thread, make sure you are on recent versions.
The fact that Inky works is reassuring. This error just means that rpi_fb_capture isn't working which we use to slurp the scenic render into Inky and onto your display. My hardware is packed for moving so I won't be able to verify the issue on my end but I'm sure we can figure it out :)
Thanks for the pointers. It looks very promising. 👍
I won't be able to test it out until sometime next week but I'll be sure to update this issue with my findings.
Unfortunately, I'm still getting the same error. I've tried my best to make sure I'm up to date by moving code from a new nerves_bootstrap project to my current project.
Link to current commit in the project in case there is some setup info I forgot to mention: kottkrig/Restidscreen.
My next step will be to see if I can replicate the issue in a minimal test case based of nerves bootstrap. But I won't be able to do that for another week. :)
10:22:32.044 [error] Jan 25 10:22:32 rpi_fb_capture: Unable to open primary display
10:22:32.046 [error] GenServer #PID<0.25990.43> terminating
** (stop) bad return value: {:stop, :port_crashed}
Last message: {#Port<0.327035>, {:exit_status, 1}}
State: %RpiFbCapture.State{backend_name: "unknown", display_height: 0, display_id: 0, display_width: 0, height: 300, port: #Port<0.327035>, request: {{#PID<0.25956.43>, #Reference<0.3707906347.809762818.188483>}, :rgb24}, width: 400}
10:22:32.047 [error] GenServer #PID<0.25956.43> terminating
** (MatchError) no match of right hand side value: {:error, :port_crashed}
(scenic_driver_inky) lib/scenic_driver_inky.ex:90: ScenicDriverInky.handle_info/2
(scenic) lib/scenic/view_port/driver.ex:215: Scenic.ViewPort.Driver.handle_info/2
(stdlib) gen_server.erl:637: :gen_server.try_dispatch/4
(stdlib) gen_server.erl:711: :gen_server.handle_msg/6
(stdlib) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
Last message: :capture
State: %{driver_module: ScenicDriverInky, driver_state: %{cap: #PID<0.25990.43>, color_affinity: :low, color_high: 180, color_low: 75, dithering: false, inky_pid: #PID<0.25979.43>, interval: 1000, last_crc: -1, size: {400, 300}, viewport: #PID<0.26004.43>}, viewport: #PID<0.26004.43>}
10:22:32.047 [error] dirty close
Hmm, I think this might be related to the graphics driver changes for the Pi4 and them not working with the rpi_fb_capture. I will check with Frank on this.
Also, I still would want to make a Scenic Driver for more primitive screens that could skip the framebuffer business. But time is a thing :P
Hmm, I think this might be related to the graphics driver changes for the Pi4 and them not working with the rpi_fb_capture. I will check with Frank on this.
Alright. A valid workaround for me might be to pick up another Pi then? :D Would a Raspberry Pi 3A+ be more reliable for this specific setup?
Also, I still would want to make a Scenic Driver for more primitive screens that could skip the framebuffer business. But time is a thing :P
It sure is. ⏳
I've run it off a Pi3 and Pi Zero W, not sure I tried it with the A+ but that one works with both pi3a system and pi3 system for nerves and is well loved and supported. It should work great.
Frank who maintains the rpi_fb_capture library figures the Pi 4 has some DRM API stuff that would prohibit us from accessing a framebuffer in the way that works on the older pis. I'll edit the issue title to match the problem.
We can't really solve this right now. I have plans for a less framebuffer reliant Scenic driver that would work on the pi4.
I can confirm that the same code works on a Raspberry Pi 3 Model A+. 👍
Expected Behavior
I'm new to Nerves and Scenic but I hoped that I could follow along the guide at An eink display with Nerves and Elixir but use an Inky wHAT instead of a pHAT.
Current Behavior
I'm unable to render the Scenic graph from the example on an Inky wHAT display. I get the error message
rpi_fb_capture: Unable to open primary display
.Failure Information
I can render a checkerboard pattern (described in the tutorial) with pure Inky but the Scenic render fails.
Hardware
Config
My scenic viewport configuration and the changes I made from the original example.
Failure Logs