It seems that autostart.sh only triggers when /wifi/ pinctrl-names is set to default? yet /dev-bt is removed in the process? Is that correct? What if the dtb file contains no /wifi/ pinctrl-names?
Why is the /flash filesystem remounted? The manpage of ftdput is very brief, but to my understanding this changes the DeviceTree at runtime and not the dtb.img file itself ?
Ah ftdput does indeed change the dtb file when I look at these examples.
One off-topic question, according to the Device Trees page all devices running the S905W soc use some version of the gxl_p281_xx file. Since my Z69 Pro uses the S905W instead of the S905X as the Z69 (without pro) does. Shouldn’t I be really using the gxl_p281_2g instead?
Edit: I’ve tried your file, but I think dev-bt should be bt-dev?
coreelec:/flash # fdtput -r -t s /flash/dtb.img /dev-bt
Error at '/dev-bt': FDT_ERR_NOTFOUND
coreelec:/flash # fdtput -r -t s /flash/dtb.img /bt-dev
Edit2: I’ve changed the autostart.sh to:
if [ "$(fdtget -t s /flash/dtb.img /wifi/ pinctrl-names 2> /dev/null)" == "default" ]; then
echo "DTB file incorrect, patching now..."
mount -o remount,rw /flash
fdtput -r -t s /flash/dtb.img /bt-dev
fdtput -d -t s /flash/dtb.img /wifi/ pinctrl-names
fdtput -d -t s /flash/dtb.img /wifi/ pinctrl-0
mount -o remount,ro /flash
echo "DTB file correct, no patching required"
This will redirect stderr so the 2nd time the script runs it won’t output:
coreelec:~/.config # ./autostart.sh
Error at 'pinctrl-names': FDT_ERR_NOTFOUND
And I added some echo statements for user feedback.
Edit3: I’ve now installed gxl_p281_2g.dtb instead of gxl_p212_2g.dtb and applied your script and the LCD screen is working. Am I correct to assume that 281 is a better fit for my mediabox than 212?
Edit4: Correct me if I’m wrong but the sync command is not actually required here? since re-mounting the fs should already trigger a sync operation?
mount -o remount,ro /flash
Edit5: Hopefully my last edit , but don’t forget to add instructions to make the script executable with chmod +x /storage/.config/autorun.sh otherwise people not so familiar with Linux will probably forget such a step.
Yes, if this entry exists, it’ll run the script and delete the entries we don’t need.
As long as everything works ok, I don’t think it matters which one you use.
Yes, that was a wrong copy-paste. Fixed now.
This script runs without any kind of user output, we don’t need prints.
I added your correction to dump the error to /dev/null, but it shouldn’t be a big deal as the user will not see this during normal boot.
These entries are the same in p212 and p281, so the script should work regardless of which device is used.
I’m not sure, better safe than sorry, as it can’t hurt. And it’s only executed once or after an update.
I installed a coreelec update yesterday, and the commend you added: reboot after an update if the VFD screen is blank.
Is indeed correct, the reboot was required after the update.
The screen is still working to this day, so once again thanks for the help
PS. I just noticed, why are some of my post marked as spam?
Here is the information requested for my HK1 RBOX S905X4 with no VFD
gpiochip0: GPIOs 425-511, parent: platform/pinctrl@0xfe004000, periphs-banks:
gpio-439 ( |amlsd ) out hi
gpio-449 ( |amlsd ) in lo
gpio-456 ( |amlsd ) out lo
gpio-457 ( |key ) in hi
gpio-465 ( |? ) out hi
gpio-471 ( |avout_mute ) out hi
gpio-481 ( |sdio_wifi ) out hi
gpio-482 ( |sdio_wifi ) in hi
gpio-492 ( |bt_rfkill ) out hi
gpio-494 ( |bt_rfkill ) out hi
Was that taken in Android? Because you need to take this info in Android, not from CoreELEC.
Was there no gpiochip1 output? There are two GPIO banks on Amlogic SoCs.
The output you posted doesn’t contain the information about which pins are used by the display.
And the vfd file you selected will not work with your box, as there are conflicting pins.