jimsynz

jimsynz

Ash Core Team

Hi folks.

I’ve spent more than a few evenings fiddling around to get a custom system built that enables the st7789v display via the Linux fbtft driver as the console and the “hifiberry” DAC on the pirate audio board that I’m using.

Here’s a photo because it’s awesome:

The next step of the project is to start working on a Scenic based UI for the device. I’ve just tried throwing scenic_driver_nerves_rpi at it to see what happens, and while it seems to load and start correctly nothing is displayed on the console.

Currently installed is scenic 0.10.5 and scenic_driver_nerves_rpi 0.10.1.

The configuration is:

config :podbox, :viewport, %{
  name: :main_viewport,
  size: {240, 240},
  default_scene: Podbox.Scene.Main,
  drivers: [
    %{
      module: Scenic.Driver.Nerves.Rpi
    }
  ]
}

And the default scene is:

defmodule Podbox.Scenes.Main do
  use Scenic.Scene
  alias Scenic.Graph
  import Scenic.Primitives
  import Scenic.Components

  @graph Graph.build()
         |> text("Hello, World!", font_size: 22, translate: {20, 80})

  def init(_scene_args, _opts) do
    {:ok, %{graph: @graph}, push: @graph}
  end
end

Running Scenic.ViewPort.info(:main_viewport) returns:

{:ok,
 %Scenic.ViewPort.Status{
   drivers: %{
     #PID<0.2941.0> => %Scenic.ViewPort.Driver.Info{
       module: Scenic.Driver.Nerves.Rpi,
       type: "Static Monitor",
       id: nil,
       width: 1996092956,
       height: 1993753600,
       pid: #PID<0.2941.0>,
       private: nil
     }
   },
   root_config: {Podbox.Scene.Main, nil},
   root_graph: {:graph, Podbox.Scene.Main, nil},
   root_scene_pid: Podbox.Scene.Main,
   size: {240, 240},
   styles: %{},
   transforms: %{}
 }}

Does anyone have any idea what might be going wrong?

Showing Posts 1 to 8

jimsynz

jimsynz OP

Ash Core Team

I upgraded scenic to 0.11 and switched to scenic_driver_local. No luck so far.

fmn

fmn

IT IS! thanks for sharing!

jimsynz

jimsynz OP

Ash Core Team

Well I haven’t solved my scenic issue, but I wanted to share a photo of it in it’s case that I designed. so much fun in such a small package!

al2o3cr

al2o3cr

These seem extremely suspicious - do you get the same results every reboot?

The values don’t look endian-swapped (there’s too many 1s scattered around) but maybe they’re just random noise. :thinking:

jimsynz

jimsynz OP

Ash Core Team

Okay, so I’ve made some progress using Scenic 0.11.2.

The viewport is configured like this:

config :podbox, :viewport,
  name: :main_viewport,
  size: {240, 240},
  default_scene: Podbox.Scene.Main,
  drivers: [
    [
      module: Scenic.Driver.Local,
      name: :local,
      window: [resizeable: false, title: "Podbox"]
    ]
  ]

Manually starting Scenic shows the following in the console:

iex(1)> viewport = Application.get_env(:podbox, :viewport)
[
  name: :main_viewport,
  size: {240, 240},
  default_scene: Podbox.Scene.Main,
  drivers: [
    [
      module: Scenic.Driver.Local,
      name: :local,
      window: [resizeable: false, title: "Podbox"]
    ]
  ]
]
iex(2)> {:ok, pid} = Scenic.start_link([viewport])
{:ok, #PID<0.3204.0>}
scenic_driver_local error: "RPI driver error: Unable to query the default screen on HDMI"
scenic_driver_local puts: "Failed to initilize the device"
scenic_driver_local error: "RPI driver error: Unable to query the default screen on HDMI"
scenic_driver_local puts: "Failed to initilize the device"
scenic_driver_local error: "RPI driver error: Unable to query the default screen on HDMI"
scenic_driver_local puts: "Failed to initilize the device"
scenic_driver_local error: "RPI driver error: Unable to query the default screen on HDMI"
scenic_driver_local puts: "Failed to initilize the device"
scenic_driver_local error: "RPI driver error: Unable to query the default screen on HDMI"
scenic_driver_local puts: "Failed to initilize the device"
scenic_driver_local error: "RPI driver error: Unable to query the default screen on HDMI"
scenic_driver_local puts: "Failed to initilize the device"
scenic_driver_local error: "RPI driver error: Unable to query the default screen on HDMI"
scenic_driver_local puts: "Failed to initilize the device"
scenic_driver_local error: "RPI driver error: Unable to query the default screen on HDMI"
scenic_driver_local puts: "Failed to initilize the device"

Which totally makes sense, since I’m not using the default screen on HDMI. Any suggestions?

03juan

03juan

The error comes from the default bcm.c driver.

If the display is available on /dev/dri/card0 then it looks like you can use the drm.c driver.

Have you tried manually setting a custom target?

export SCENIC_LOCAL_TARGET=drm
export SCENIC_LOCAL_GL=gles3
jimsynz

jimsynz OP

Ash Core Team

Thanks for the update. Yeah, this is the direction I went down to finally get it working.

I wound up pulling scenic_driver_local from main and setting SCENIC_LOCAL_TARGET=cairo-fb. The only catch being that it expects to address the framebuffer on /dev/fb0 but my display is listed as /dev/fb1. In the mean time I have symlinked it, but I’ve also raised an issue asking for it to be made configurable. I think this means that this method will also work for any of the dozens of displays that are supported by fbtft without the need for custom scenic driver packages. Great news!

03juan

03juan

Great to hear you got it sorted and good call on the configuration request. :+1:

— All posts loaded —

Where Next? Top

Trending in Questions Top

stjefim
Hello! Suppose you are building workflow (order / task / payment) processing system with the following requirements: Each workflow con...
New
water
I’m aware of 2 such projects, are there others? git: GitHub - team-alembic/realworld: A fullstack Phoenix LiveView application with back...
New
itzmidinesh
Hi all, I’m working on a Phoenix project where I need to make external HTTP requests and I’m trying to choose between Req and HTTPoison....
New
peck
Hi everyone. My team and I have been working on a fairly modest app based around video streaming and chat, but we’ve landed a customer t...
New
leoschweizer
Hi, we run different LLM models across a cluster, with each node loading a configurable subset. Model-specific queues let nodes consume ...
New
csmr
Hi all, I’m new here and would like to hear peoples views on my Elixir/Phoenix based game-engine! :smiley: Mutonex gamedesign was finish...
New
perzanko
Do we have maintainer of absinthe-graphql/dataloader here? We have a PR that we’d like to merge to the library. Relatively small additive...
New

Other Trending Topics Top

dominicletz
Hey there, I haven’t seen a list of useful Elixir specific skills for the popular AI tools yet so I’m starting one here with my first. ...
New
mudasobwa
I fully migrated to my own harness from Anthropic/Gemini and I think it’s time to share it. Welcome DSH, the DeepSeek Harness, fully writ...
New
KristerV
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
webofbits
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself. My main conc...
#ai
New
OndrejValenta
(I just needed to vent somewhere and LinkedIn is full of hope, or hype, I’m not sure which exactly) AI dream has many faces, but general...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews