Skip to content
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

OpenVFD: Failed to verify VFD config file, attempt using device tree #13

Closed
Jeebus678 opened this issue Dec 26, 2021 · 25 comments
Closed

Comments

@Jeebus678
Copy link

Jeebus678 commented Dec 26, 2021

I have already viewed issue #3 and unfortunately did not find a solution there. Keep in mind I added some variables to the DTB as an attempt to go around using the config file, but to no avail. Here is my dmesg after modprobe openvfd:

[   35.008376] openvfd: loading out-of-tree module taints kernel.
[   35.013056] OpenVFD: Version: V1.4.0
[   35.013075] OpenVFD: vfd_gpio_clk:           Empty.
[   35.013081] OpenVFD: vfd_gpio_dat:           Empty.
[   35.013087] OpenVFD: vfd_gpio_stb:           Empty.
[   35.013101] OpenVFD: vfd_gpio0:              #0 = 0x00; #1 = 0x00; #2 = 0xFF;
[   35.013113] OpenVFD: vfd_gpio1:              #0 = 0x00; #1 = 0x00; #2 = 0xFF;
[   35.013124] OpenVFD: vfd_gpio2:              #0 = 0x00; #1 = 0x00; #2 = 0xFF;
[   35.013135] OpenVFD: vfd_gpio3:              #0 = 0x00; #1 = 0x00; #2 = 0xFF;
[   35.013145] OpenVFD: vfd_gpio_protocol:      #0 = 0x00; #1 = 0x00;
[   35.013151] OpenVFD: vfd_chars:              Empty.
[   35.013157] OpenVFD: vfd_dot_bits:           Empty.
[   35.013163] OpenVFD: vfd_display_type:       Empty.
[   35.013175] OpenVFD: Detected gpio chips:    periphs-banks, aobus-banks.
[   35.013181] OpenVFD: Failed to verify VFD configuration file, attempt using device tree as fallback.
[   35.027411] OF: /openvfd: could not find phandle
[   35.027434] OpenVFD: openvfd_gpio_clk: pin = -22, flags = 0x00
[   35.027694] OF: /openvfd: could not find phandle
[   35.027718] OpenVFD: openvfd_gpio_dat: pin = -22, flags = 0x00
[   35.027831] OF: /openvfd: could not find phandle
[   35.027858] OpenVFD: openvfd_gpio_stb: pin = -22, flags = 0x00
[   35.027867] OpenVFD: openvfd_gpio0 pin entry not found
[   35.027874] OpenVFD: openvfd_gpio1 pin entry not found
[   35.027880] OpenVFD: openvfd_gpio2 pin entry not found
[   35.027896] OpenVFD: openvfd_gpio3 pin entry not found
[   35.027916] OpenVFD: chars_prop = 000000003a704ee5
[   35.027932] OpenVFD: chars_prop->length = 10
[   35.027948] OpenVFD: char #0: 50
[   35.027960] OpenVFD: char #1: 44
[   35.027965] OpenVFD: char #2: 49
[   35.027970] OpenVFD: char #3: 44
[   35.027975] OpenVFD: char #4: 50
[   35.027980] OpenVFD: char #5: 44
[   35.027985] OpenVFD: char #6: 51
[   35.027993] OpenVFD: dot_bits_prop = 000000003c43f2ae
[   35.027998] OpenVFD: dot_bits_prop->length = 14
[   35.028004] OpenVFD: dot_bit #0: 48
[   35.028009] OpenVFD: dot_bit #1: 44
[   35.028014] OpenVFD: dot_bit #2: 49
[   35.028019] OpenVFD: dot_bit #3: 44
[   35.028024] OpenVFD: dot_bit #4: 51
[   35.028029] OpenVFD: dot_bit #5: 44
[   35.028034] OpenVFD: dot_bit #6: 50
[   35.028039] OpenVFD: dot_bit #7: 44
[   35.028044] OpenVFD: dot_bit #8: 52
[   35.028050] OpenVFD: dot_bit #9: 44
[   35.028055] OpenVFD: dot_bit #10: 53
[   35.028060] OpenVFD: dot_bit #11: 44
[   35.028065] OpenVFD: dot_bit #12: 54
[   35.028070] OpenVFD: dot_bit #13: 0
[   35.028082] OpenVFD: display.type = 51, display.controller = 48, pdata->dev->dtb_active.display.flags = 0x78
[   35.028088] OpenVFD: can't request gpio of gpio_clk
[   35.028139] openvfd: probe of openvfd failed with error -22

DTB looks like this:

openvfd {
                compatible = "open,vfd";
                dev_name = "openvfd";
                status = "okay";
                openvfd_gpio_clk = "0,76,0";
                openvfd_gpio_dat = "0,75,0";
                openvfd_gpio_stb = "0,0,0xFF";
                openvfd_chars = "2,1,2,3,4";
                openvfd_dot_bits = "0,1,3,2,4,5,6";
                openvfd_display_type = "0x03,0x00,0x00,0x03";
        };

When starting openvfd the first time:

root@arm-64:~# systemctl status openvfd
● openvfd.service - openvfd
     Loaded: loaded (/etc/systemd/system/openvfd.service; disabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Sun 2021-12-26 02:16:44 IST; 3s ago
    Process: 1770 ExecStartPre=/bin/sh -c ./root/.config/vfd.conf; /sbin/modprobe openvfd vfd_gpio_clk=$vfd_gpio_clk vfd_gpio_dat=$vfd_gpio_dat vfd_gpio_stb=$vfd_gpio_stb vfd_chars=$vfd_chars vfd_dot_bits=$vfd_dot_bits v>
    Process: 1773 ExecStart=/root/linux_openvfd/OpenVFDService $OPTS & (code=exited, status=1/FAILURE)
    Process: 1774 ExecStopPost=/sbin/rmmod openvfd (code=exited, status=0/SUCCESS)
   Main PID: 1773 (code=exited, status=1/FAILURE)
        CPU: 48ms

Dec 26 02:16:44 arm-64 systemd[1]: Starting openvfd...
Dec 26 02:16:44 arm-64 sh[1771]: /bin/sh: 1: ./root/.config/vfd.conf: Permission denied
Dec 26 02:16:44 arm-64 systemd[1]: Started openvfd.
Dec 26 02:16:44 arm-64 OpenVFDService[1773]: Open device failed.
Dec 26 02:16:44 arm-64 OpenVFDService[1773]: : No such file or directory
Dec 26 02:16:44 arm-64 systemd[1]: openvfd.service: Main process exited, code=exited, status=1/FAILURE
Dec 26 02:16:44 arm-64 systemd[1]: openvfd.service: Failed with result 'exit-code'.
lines 1-16/16 (END)

If I start openvfd again right after, it somehow manages to run. If I try running the demo, it freezes here:

root@arm-64:~/linux_openvfd# ./OpenVFDService -t -dt 1
Display type 0x00000001
Initializing...
Process ID = 1862

dmesg:

[  234.656983] openvfd: `' invalid for parameter `vfd_gpio_clk'
[  234.657004] openvfd: `' invalid for parameter `vfd_gpio_dat'
[  234.657015] openvfd: `' invalid for parameter `vfd_gpio_stb'
[  234.657023] openvfd: `' invalid for parameter `vfd_chars'
[  234.657031] openvfd: `' invalid for parameter `vfd_dot_bits'
[  234.657039] openvfd: `' invalid for parameter `vfd_display_type'
[  261.862175] openvfd: `' invalid for parameter `vfd_gpio_clk'
[  261.862195] openvfd: `' invalid for parameter `vfd_gpio_dat'
[  261.862205] openvfd: `' invalid for parameter `vfd_gpio_stb'
[  261.862213] openvfd: `' invalid for parameter `vfd_chars'
[  261.862221] openvfd: `' invalid for parameter `vfd_dot_bits'
[  261.862229] openvfd: `' invalid for parameter `vfd_display_type'
[  314.384819] openvfd: `' invalid for parameter `vfd_gpio_clk'
[  314.384840] openvfd: `' invalid for parameter `vfd_gpio_dat'
[  314.384851] openvfd: `' invalid for parameter `vfd_gpio_stb'
[  314.384859] openvfd: `' invalid for parameter `vfd_chars'
[  314.384867] openvfd: `' invalid for parameter `vfd_dot_bits'
[  314.384875] openvfd: `' invalid for parameter `vfd_display_type'
[  323.782887] OpenVFD: Version: V1.4.0
[  323.782911] OpenVFD: vfd_gpio_clk:           #0 = 0x00; #1 = 0x4C; #2 = 0x00;
[  323.782923] OpenVFD: vfd_gpio_dat:           #0 = 0x00; #1 = 0x4B; #2 = 0x00;
[  323.782934] OpenVFD: vfd_gpio_stb:           #0 = 0x00; #1 = 0x00; #2 = 0xFF;
[  323.782946] OpenVFD: vfd_gpio0:              #0 = 0x00; #1 = 0x00; #2 = 0xFF;
[  323.782958] OpenVFD: vfd_gpio1:              #0 = 0x00; #1 = 0x00; #2 = 0xFF;
[  323.782969] OpenVFD: vfd_gpio2:              #0 = 0x00; #1 = 0x00; #2 = 0xFF;
[  323.782980] OpenVFD: vfd_gpio3:              #0 = 0x00; #1 = 0x00; #2 = 0xFF;
[  323.782990] OpenVFD: vfd_gpio_protocol:      #0 = 0x00; #1 = 0x00;
[  323.783005] OpenVFD: vfd_chars:              #0 = 0x02; #1 = 0x01; #2 = 0x02; #3 = 0x03; #4 = 0x04;
[  323.783025] OpenVFD: vfd_dot_bits:           #0 = 0x00; #1 = 0x01; #2 = 0x02; #3 = 0x03; #4 = 0x04; #5 = 0x05; #6 = 0x06;
[  323.783038] OpenVFD: vfd_display_type:       #0 = 0x03; #1 = 0x00; #2 = 0x00; #3 = 0x03;
[  323.783050] OpenVFD: Detected gpio chips:    periphs-banks, aobus-banks.
[  323.783063] OpenVFD: "periphs-banks" chip found.     base = 401, pin count = 100, pin = 76, offset = 477
[  323.783072] OpenVFD: "periphs-banks" chip found.     base = 401, pin count = 100, pin = 75, offset = 476
[  323.783078] OpenVFD: Skipping vfd_gpio_stb evaluation (0xFF)
[  323.783083] OpenVFD: Skipping vfd_gpio0 evaluation (0xFF)
[  323.783088] OpenVFD: Skipping vfd_gpio1 evaluation (0xFF)
[  323.783093] OpenVFD: Skipping vfd_gpio2 evaluation (0xFF)
[  323.783098] OpenVFD: Skipping vfd_gpio3 evaluation (0xFF)
[  323.783753] OpenVFD: Select FD650 controller
[  323.783844] OpenVFD: SW I2C interface intialized (address = 0x0000 (N/A), MSB mode, pull-ups off)
[  434.394024] OpenVFD: Select FD628 controller
[  434.394434] OpenVFD: SW SPI 3-wire interface failed to intialize. Invalid CLK (477), DAT (476) or STB (-2) pins
[  434.394440] OpenVFD: Failed to initialize the controller, reverting to Dummy controller
[  434.395056] OpenVFD: openvfd_dev_write: count = 14, sizeof(data) = 660
[  442.953527] OpenVFD: openvfd_dev_write: count = 14, sizeof(data) = 660
[  444.026300] OpenVFD: openvfd_dev_write: count = 10, sizeof(data) = 660
[  444.562713] OpenVFD: openvfd_dev_write: count = 10, sizeof(data) = 660
[  445.099077] OpenVFD: openvfd_dev_write: count = 10, sizeof(data) = 660
[  445.635504] OpenVFD: openvfd_dev_write: count = 10, sizeof(data) = 660
[  446.172069] OpenVFD: openvfd_dev_write: count = 10, sizeof(data) = 660
[  446.708701] OpenVFD: openvfd_dev_write: count = 10, sizeof(data) = 660
[  447.245232] OpenVFD: openvfd_dev_write: count = 10, sizeof(data) = 660
[  447.783569] OpenVFD: openvfd_dev_write: count = 10, sizeof(data) = 660

Understandably, it's writing but nothing actually writes to the LCD. I've tried changing the config file location, changing its permissions, moving the config to the dtb, but not luck.

@arthur-liberman
Copy link
Owner

Very hard for me to understand what you were trying to do, but in the last dmest output, you can see that it successfully started the driver.
Do you have the OpenVFD Kodi addon installed? Make sure to disable the "Advanced" section, and then try again.
You can see at 434s it tries to replace the controller with a FD628 and that fails.

@Jeebus678
Copy link
Author

Jeebus678 commented Dec 26, 2021

I am unaware of the addon, so i’ll try it when I get the chance. In the example though I am only trying to set up the module with modprobe, and then I try running the service. The services manages to run successfully the second time (even though it fails and errors out the first time), and it seems like the biggest issue at hand is failure to read vfd.conf parameters.

Some background on my system since I forgot to mention… im running armbian on a tx mini 3 box with a S905W chip and an FD6551 controller. I’ve noticed other people succeeded in controlling the LCD with the same model so I should be able to do the same.

@arthur-liberman
Copy link
Owner

Ah sorry, I reread what you did.
At second 323 the driver was started successfully.
At second 434 you started the test patterns, but with the wrong display type.
With that said, the FD6551 controller is not the same as the FD650 or FD655. You need to set the display type to 6, your vfd.conf has it set to FD650 (3), which is wrong.

@Jeebus678
Copy link
Author

Jeebus678 commented Dec 26, 2021

Regardless of how I declare the display type, it still has issues with vfd.conf. Here's after changing the conf file, modprobe, and starting the openvfd service :

root@arm-64:~# systemctl start openvfd.service
root@arm-64:~# systemctl status openvfd.service
● openvfd.service - openvfd
     Loaded: loaded (/etc/systemd/system/openvfd.service; disabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Sun 2021-12-26 09:47:06 IST; 3s ago
    Process: 1637 ExecStartPre=/bin/sh -c . /root/.config/vfd.conf; /sbin/modprobe openvfd vfd_gpio_clk=$vfd_gpio_clk vfd_gpio_dat=$vfd_gpio_dat vfd_gpio_stb=$vfd_gpio_stb vfd_chars=$vfd_chars vfd_dot_bits=$vfd_dot_bits >
    Process: 1639 ExecStart=/root/linux_openvfd/OpenVFDService $OPTS & (code=exited, status=1/FAILURE)
    Process: 1640 ExecStopPost=/sbin/rmmod openvfd (code=exited, status=0/SUCCESS)
   Main PID: 1639 (code=exited, status=1/FAILURE)
        CPU: 34ms

Dec 26 09:47:06 arm-64 sh[1637]: [49B blob data]
Dec 26 09:47:06 arm-64 sh[1637]: [49B blob data]
Dec 26 09:47:06 arm-64 sh[1637]: [49B blob data]
Dec 26 09:47:06 arm-64 sh[1637]: [49B blob data]
Dec 26 09:47:06 arm-64 sh[1637]: [49B blob data]
Dec 26 09:47:06 arm-64 systemd[1]: Started openvfd.
Dec 26 09:47:06 arm-64 OpenVFDService[1639]: Open device failed.
Dec 26 09:47:06 arm-64 OpenVFDService[1639]: : No such file or directory
Dec 26 09:47:06 arm-64 systemd[1]: openvfd.service: Main process exited, code=exited, status=1/FAILURE
Dec 26 09:47:06 arm-64 systemd[1]: openvfd.service: Failed with result 'exit-code'.

[1]+  Stopped                 systemctl status openvfd.service
root@arm-64:~# systemctl start openvfd.service
root@arm-64:~# systemctl status openvfd.service
● openvfd.service - openvfd
     Loaded: loaded (/etc/systemd/system/openvfd.service; disabled; vendor preset: enabled)
     Active: active (running) since Sun 2021-12-26 09:48:13 IST; 1s ago
    Process: 1656 ExecStartPre=/bin/sh -c . /root/.config/vfd.conf; /sbin/modprobe openvfd vfd_gpio_clk=$vfd_gpio_clk vfd_gpio_dat=$vfd_gpio_dat vfd_gpio_stb=$vfd_gpio_stb vfd_chars=$vfd_chars vfd_dot_bits=$vfd_dot_bits >
   Main PID: 1662 (OpenVFDService)
      Tasks: 3 (limit: 787)
     Memory: 232.0K
        CPU: 50ms
     CGroup: /system.slice/openvfd.service
             └─1662 /root/linux_openvfd/OpenVFDService -12h &

Dec 26 09:48:13 arm-64 systemd[1]: Starting openvfd...
Dec 26 09:48:13 arm-64 sh[1656]: [48B blob data]
Dec 26 09:48:13 arm-64 sh[1656]: [49B blob data]
Dec 26 09:48:13 arm-64 sh[1656]: [49B blob data]
Dec 26 09:48:13 arm-64 sh[1656]: [49B blob data]
Dec 26 09:48:13 arm-64 sh[1656]: [49B blob data]
Dec 26 09:48:13 arm-64 sh[1656]: [49B blob data]
Dec 26 09:48:13 arm-64 sh[1656]: [49B blob data]
Dec 26 09:48:13 arm-64 systemd[1]: Started openvfd.
lines 1-20/20 (END)

Notice if I run systemctl start openvfd.service right after, it magically succeeds and starts the service. This time I set it to the right controller, but it still bugs out and refuses to actually do anything when I run the demo code:

root@arm-64:~/linux_openvfd# ./OpenVFDService -t -dt 1
Display type 0x00000001
Initializing...
Process ID = 1702

dmesg:

[  138.859789] OpenVFD: Version: V1.4.0
[  138.859814] OpenVFD: vfd_gpio_clk:           #0 = 0x00; #1 = 0x4C; #2 = 0x00;
[  138.859827] OpenVFD: vfd_gpio_dat:           #0 = 0x00; #1 = 0x4B; #2 = 0x00;
[  138.859838] OpenVFD: vfd_gpio_stb:           #0 = 0x00; #1 = 0x00; #2 = 0xFF;
[  138.859849] OpenVFD: vfd_gpio0:              #0 = 0x00; #1 = 0x00; #2 = 0xFF;
[  138.859861] OpenVFD: vfd_gpio1:              #0 = 0x00; #1 = 0x00; #2 = 0xFF;
[  138.859872] OpenVFD: vfd_gpio2:              #0 = 0x00; #1 = 0x00; #2 = 0xFF;
[  138.859883] OpenVFD: vfd_gpio3:              #0 = 0x00; #1 = 0x00; #2 = 0xFF;
[  138.859893] OpenVFD: vfd_gpio_protocol:      #0 = 0x00; #1 = 0x00;
[  138.859908] OpenVFD: vfd_chars:              #0 = 0x02; #1 = 0x01; #2 = 0x02; #3 = 0x03; #4 = 0x04;
[  138.859927] OpenVFD: vfd_dot_bits:           #0 = 0x00; #1 = 0x01; #2 = 0x02; #3 = 0x03; #4 = 0x04; #5 = 0x05; #6 = 0x06;
[  138.859940] OpenVFD: vfd_display_type:       #0 = 0x06; #1 = 0x00; #2 = 0x00; #3 = 0x06;
[  138.859952] OpenVFD: Detected gpio chips:    periphs-banks, aobus-banks.
[  138.859965] OpenVFD: "periphs-banks" chip found.     base = 401, pin count = 100, pin = 76, offset = 477
[  138.859975] OpenVFD: "periphs-banks" chip found.     base = 401, pin count = 100, pin = 75, offset = 476
[  138.859981] OpenVFD: Skipping vfd_gpio_stb evaluation (0xFF)
[  138.859986] OpenVFD: Skipping vfd_gpio0 evaluation (0xFF)
[  138.859991] OpenVFD: Skipping vfd_gpio1 evaluation (0xFF)
[  138.859996] OpenVFD: Skipping vfd_gpio2 evaluation (0xFF)
[  138.860001] OpenVFD: Skipping vfd_gpio3 evaluation (0xFF)
[  138.860836] OpenVFD: Select FD6551 controller
[  138.860932] OpenVFD: SW I2C interface intialized (address = 0x0000 (N/A), MSB mode, pull-ups off)
[  215.273857] OpenVFD: Select FD628 controller
[  215.274178] OpenVFD: SW SPI 3-wire interface failed to intialize. Invalid CLK (477), DAT (476) or STB (-2) pins
[  215.274182] OpenVFD: Failed to initialize the controller, reverting to Dummy controller
[  215.274515] OpenVFD: openvfd_dev_write: count = 14, sizeof(data) = 660
[  223.857358] OpenVFD: openvfd_dev_write: count = 14, sizeof(data) = 660

It seems you're right about the conf file in that it does get passed the second time around. Executing the test demo however always results in this:

[   39.901090] OpenVFD: Select FD6551 controller
[   39.901163] OpenVFD: SW I2C interface intialized (address = 0x0000 (N/A), MSB mode, pull-ups off)
[   87.701927] OpenVFD: Select FD628 controller
[   87.702363] OpenVFD: SW SPI 3-wire interface failed to intialize. Invalid CLK (477), DAT (476) or STB (-2) pins
[   87.702369] OpenVFD: Failed to initialize the controller, reverting to Dummy controller
[   87.702977] OpenVFD: openvfd_dev_write: count = 14, sizeof(data) = 660
[   96.267371] OpenVFD: openvfd_dev_write: count = 14, sizeof(data) = 660

At 87 I ran the demo script and it instantly changed the controller.

@Jeebus678
Copy link
Author

Update:

I enabled openvfd.service with systemctl so it starts on boot. It got rid of the error modprobe throws me, and it seems that the module + service are working fine. When I run the demo, however, I get the exact same issue as #6.

@arthur-liberman
Copy link
Owner

  1. If you don't get anything on the display after startup when the driver first loads, it means that your configuration is incorrect. Most likely the pins used.
  2. -dt 1 is not the correct configuration to use. You only really need to run the test mode if you get something on the screen but the numbers are garbled. You need to construct the -dt numeric value as a hexadecimal uint32 value. ie: -dt 0x06000002 is the equivalent of what you've posted in Auto switch to wrong controller #6 about what's in your DTB.

@Jeebus678
Copy link
Author

@arthur-liberman

That seems to be the case. I have a TX 3 mini yet the vfd.conf file from this library, as well as the one from this library don't seem to work. Service runs properly and identifies the FD6551 controller- just no output.

@Jeebus678
Copy link
Author

After executing cat /sys/kernel/debug/gpio on the working Android build:

GPIOs 145-154, platform/c1109880.pinmux, ao-banks:
gpio-147 (gpio_key          ) in  hi

GPIOs 155-255, platform/c1109880.pinmux, banks:
gpio-178 (fd655_dev        ) out hi
gpio-180 (fd655_dev        ) out hi
(more unrelated gpio pins) 

So it seems that my LCD is connected through GPIO 178 and 180, with 147 being the stb pin?

@arthur-liberman
Copy link
Owner

arthur-liberman commented Jan 3, 2022

FD65xx series use I2C-type of protocol, only pins 178 and 180 are used.
That translates to pins (178-155) = 23 and (180-155) = 25 (10 base) in the configuration

@Jeebus678
Copy link
Author

Jeebus678 commented Jan 3, 2022 via email

@Jeebus678
Copy link
Author

Figured it out. I set my clock and data pins as follows (for the FD6551 controller):

vfd_gpio_clk='0,0x17,0'
vfd_gpio_dat='0,0x19,0'
vfd_gpio_stb='0,0,0'

and ran
./OpenVFDService -t -dt 0x06000002

@arthur-liberman
Copy link
Owner

So does that work now?

@Jeebus678
Copy link
Author

It displays stuff but irregularly. I’m playing around with the display type and vfd chars setting but no luck so far. Running a tx3 mini with a FD6551 controller. Setting the last display type variable to 0x06 successfully selects the controller, but the display still makes little sense and i’m unsure how to assign ‘vfd_chars’

@arthur-liberman
Copy link
Owner

Try different combinations of 0x0600000x.
From 0x06000000 to 0x06000009, one should work and display readable numbers/ascii chars.
Once you got that down, you'll need to figure out the order of chars. It's either 0 1 2 3 4 or 4 3 2 1 0 in most cases, but not all.
The test patterns should help you figure out the correct order, although it can be confusing a bit sometimes.

@arthur-liberman
Copy link
Owner

And also, the unused (stb) pin should be 0, 0, 0xFF

@Jeebus678
Copy link
Author

Jeebus678 commented Jan 3, 2022

@arthur-liberman I will try it out tomorrow. Also, shouldn’t the last value be 06, as in 0x00000006 since the last value represents the controller? Can you provide a list of displays corresponding to their values?

@arthur-liberman
Copy link
Owner

arthur-liberman commented Jan 3, 2022

No. The MSB represents the controller, the LSB represents the display type.
In the vfd.conf, the first number is the LSB.

@Jeebus678
Copy link
Author

Jeebus678 commented Jan 4, 2022

My stb pin was indeed set to 0, 0, 0xFF as you stated. It seems like my display type is most likely 0x0600002 as it succeeded in displaying all the numbers and letters in test mode. I've properly configured display_type and vfd_chars, so far the demo seems to be working flawlessly. I've also tested test_led commands and 6-11 all work.

Now I'm curious how I can make it display custom messages instead of just time.

@arthur-liberman
Copy link
Owner

arthur-liberman commented Jan 4, 2022

Take a look at this repo for more info:
https://github.com/arthur-liberman/service.openvfd
I don't remember whether I exposed writing custom text to the driver, but I think I did. It's probably not part of the service.openvfd, but should be accessible in a similar fashion.

@Jeebus678
Copy link
Author

Entirely unsure what to do with that repo- it's a kodi addon and I'm on armbian. I'll go over the source code to see what I can do.

@arthur-liberman
Copy link
Owner

It's python, and you basically write to a sysfs file.

@Jeebus678
Copy link
Author

root@arm-64:~/service.openvfd# python3 service.py Traceback (most recent call last): File "/root/service.openvfd/service.py", line 18, in <module> import xbmcaddon ModuleNotFoundError: No module named 'xbmcaddon'

Seems like im missing a kodi library

@arthur-liberman
Copy link
Owner

What I meant is that the code is in python, you can read it to understand what to do.

@hqctfl
Copy link

hqctfl commented Apr 13, 2022

Hello arthur, the similar issue with this topic on my tanix tx6 box which is allwinner H6 SOC based, I am running on android, the LED controller is FD650 and no indication on the LED. The dmesg copied below, I used the contents from vfd.conf and phased in sysconfig.fex (device tree for android) for android rom pack. The dmesg always show "OpenVFD: Select Dummy controller" and I cannot switch to controller FD650. Can you please have a look? Thank you.

vfd.conf:
;This file must be renamed to vfd.conf and placed in the /storage/.config/ folder.
;
; Tanix TX6 - Allwinner H6 configuration
;--------------------
;gpio_xxx:
; [0] 0 = &gpiochip0, 1 = &gpiochip1.
; [1] pin number
; [0] Reserved - must be 0.

vfd_gpio_clk='1,229,0'
vfd_gpio_dat='1,230,0'
vfd_gpio_stb='0,0,0xFF'
vfd_gpio_chip_name='300b000.pinctrl'

;chars:
; < DHHMM > Order of display chars (D=dots, represented by a single char)

vfd_chars='2,4,3,2,1'

;dot_bits:
; Order of dot bits. Typical configurations:
; Display Type 0, 1 usually has Alarm, USB, Play, Pause, Col, Ethernet, Wifi dots
; Alarm = 0, USB = 1, Play = 2, Pause = 3, Col = 4, Eth = 5, Wifi = 6
; Display Type 2 usually has APPS, USB, SETUP, CARD, Col, HDMI, CVBS dots
; APPS = 0, USB = 1, SETUP = 2, CARD = 3, Col = 4, HDMI = 5, CVBS = 6
; Display Type 3 Power, LAN, Col, Low Wifi, High Wifi
; N/A = 0, N/A = 1, Power = 2, LAN = 3, Col = 4, Low Wifi = 5, High Wifi = 6

vfd_dot_bits='0,1,2,3,4,5,6'

;display_type:
; [0] - Display type.
; [1] - Reserved - must be 0..
; [2] - Flags. (bit 0 = '1' - Common Anode display)
; [3] - Controller.

vfd_display_type='0x01,0x00,0x00,0x03'

dmesg:
[ 7.830385] OpenVFD: Version: V1.4.1
[ 7.834328] OpenVFD: vfd_gpio_clk: Empty.
[ 7.838838] OpenVFD: vfd_gpio_dat: Empty.
[ 7.843617] OpenVFD: vfd_gpio_stb: Empty.
[ 7.848119] OpenVFD: vfd_gpio0: #0 = 0x00; #1 = 0x00; #2 = 0xFF;
[ 7.857572] OpenVFD: vfd_gpio1: #0 = 0x00; #1 = 0x00; #2 = 0xFF;
[ 7.864588] OpenVFD: vfd_gpio2: #0 = 0x00; #1 = 0x00; #2 = 0xFF;
[ 7.873018] OpenVFD: vfd_gpio3: #0 = 0x00; #1 = 0x00; #2 = 0xFF;
[ 7.880416] OpenVFD: vfd_gpio_protocol: #0 = 0x00; #1 = 0x00;
[ 7.887442] OpenVFD: vfd_chars: Empty.
[ 7.892095] OpenVFD: vfd_dot_bits: Empty.
[ 7.896809] OpenVFD: vfd_display_type: Empty.
[ 7.902171] OpenVFD: Detected gpio chips: pio, r_pio.
[ 7.910410] OpenVFD: Failed to verify VFD configuration file, attempt using device tree as fallback.
[ 7.921209] OpenVFD: openvfd_gpio_clk: pin = 229, flags = 0xE5
[ 7.927650] OpenVFD: openvfd_gpio_dat: pin = 230, flags = 0xE6
[ 7.934653] OpenVFD: openvfd_gpio_stb pin entry not found
[ 7.940929] OpenVFD: openvfd_gpio0 pin entry not found
[ 7.946594] OpenVFD: openvfd_gpio1 pin entry not found
[ 7.983617] OpenVFD: openvfd_gpio2 pin entry not found
[ 7.989587] OpenVFD: openvfd_gpio3 pin entry not found
[ 7.995901] OpenVFD: chars_prop = ffffffc0bbfde618
[ 8.001867] OpenVFD: chars_prop->length = 11
[ 8.006567] OpenVFD: char #0: 50
[ 8.010277] OpenVFD: char #1: 44
[ 8.014072] OpenVFD: char #2: 52
[ 8.017606] OpenVFD: char #3: 44
[ 8.021380] OpenVFD: char #4: 51
[ 8.025367] OpenVFD: char #5: 44
[ 8.028878] OpenVFD: char #6: 50
[ 8.032686] OpenVFD: dot_bits_prop = ffffffc0bbfde648
[ 8.038266] OpenVFD: dot_bits_prop->length = 15
[ 8.043504] OpenVFD: dot_bit #0: 48
[ 8.047344] OpenVFD: dot_bit #1: 44
[ 8.051350] OpenVFD: dot_bit #2: 49
[ 8.055198] OpenVFD: dot_bit #3: 44
[ 8.059047] OpenVFD: dot_bit #4: 50
[ 8.063124] OpenVFD: dot_bit #5: 44
[ 8.066964] OpenVFD: dot_bit #6: 51
[ 8.070958] OpenVFD: dot_bit #7: 44
[ 8.074799] OpenVFD: dot_bit #8: 52
[ 8.078640] OpenVFD: dot_bit #9: 44
[ 8.082776] OpenVFD: dot_bit #10: 53
[ 8.086766] OpenVFD: dot_bit #11: 44
[ 8.090862] OpenVFD: dot_bit #12: 54
[ 8.094806] OpenVFD: dot_bit #13: 39
[ 8.098755] OpenVFD: dot_bit #14: 0
[ 8.102850] OpenVFD: display.type = 51, display.controller = 48, pdata->dev->dtb_active.display.flags = 0x78
[ 8.115436] OpenVFD: Select Dummy controller
[ 8.143211] no ioctl found(cmd:0x13) in disp_unregister_compat_ioctl_func
[ 8.143423] init: Starting service 'openvfd'...

@arthur-liberman
Copy link
Owner

Closing due to lack of activity. Please let me know if you still have an issue with the latest commits pushed recently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants