[split] Maintaining config.txt - Printable Version +- Moode Forum (https://moodeaudio.org/forum) +-- Forum: moOde audio player (https://moodeaudio.org/forum/forumdisplay.php?fid=3) +--- Forum: Support (https://moodeaudio.org/forum/forumdisplay.php?fid=7) +--- Thread: [split] Maintaining config.txt (/showthread.php?tid=3878) Pages:
1
2
|
[split] Maintaining config.txt - adrii - 05-28-2021 Hi Tim 1. I looked at the Raspberry Pi OS setup again and i2c-dev is loaded at boot and included in '/etc/modules' and '/etc/modules-load.d/modules.conf' (I don't think I have changed these lines manually, as I don't use an I2C screen with the machine, but I can't be sure, also Volumio loads the i2c-dev module by default). Enabling/disabling I2C in raspi-config changes the line 'dtparam=i2c_arm=on' to 'dtparam=i2c_arm=off', but the i2c-dev module is still loaded in both cases. In which case it seems that both the i2c-dev module must be specifically loaded and 'dtparam=i2c_arm=on' be set for the /dev/i2c-1 (etc) device entries to be created. On Moode... Code: pi@moode:~ $ sudo modprobe i2c-dev 2. I thought the /etc/modules file was also overwritten by the the 720 to 721 update, but I could be mistaken. 3. In worker.php, it doesn't look like i2c-dev is loaded by the ALSA loopback configuration (and it wasn't loaded when I tried it), but is loaded for 'Allo Boss 2 DAC', Besides the specific details of the I2C configuration on Moode (which are clearer to me now), I am mainly interested in a user's mpd_oled configuration being able to survive a Moode update (as it wasn't previously possible for an mpd_oled user to update Moode because of system customisations). The user has to configure their screen, and this will involve loading modules (for I2C or SPI) and adding settings to '/boot/config.txt'. It would be useful if there was a Moode recommended place for a user to load modules, that won't be overwritten by an update. Also, it would be useful if Moode could support a config.txt include file for user settings that would survive an update ( https://www.raspberrypi.org/documentation/configuration/config-txt/misc.md ), so if the user adds a setting for the i2c bus speed like 'dtparam=i2c_arm_baudrate=800000' to the include file then the setting is still present after the Moode update. I think those are all my comments. I don't want to hijack the 7.2.1 support thread! Francesco and bitlab, thank you for the suggestion to use raspi-config. I thought it was something that shouldn't be used on Moode, but I can't find a reference not to use it in the forums! I'll check out if it can make the mpd_oled instructions easier. I think 'dtparam=i2c_arm_baudrate=800000' was commented out in '/boot/config.txt' by the upgrade, and if that is the case this file would still need editing after an upgrade. Adrian. RE: Official moOde 7.2.1 support thread - Tim Curtis - 05-28-2021 To summarize: 1. Need i2c-dev loaded at boot time by default 2. Would be helpful to have the "include file" feature for config.txt Correct? RE: Official moOde 7.2.1 support thread - adrii - 05-29-2021 Hi Tim 1. Yes, load i2c-dev at boot. 2. Yes, and if the include statement comes last in /boot/config.txt then user settings can override the Moode settings (e.g. to turn I2C off) . However, I notice in testing that raspi-config is adding statements at the end of config.txt, in which case, maybe Moode settings coulld be in a separate file that is included first in config.txt, and everything that follows in config.txt is user settings, and raspi-config changes are then user settings. But, I don't know enough about this to say what the downsides of any approach could be. My other suggestion was that it would be useful if a user could list modules to load in a file (which could be /etc/modules) and they wouldn't be overwriten by a Moode upgrade, but on further investigation the only module I needed this for was i2c-dev. Unlike with I2C, the SPI module is loaded by the corresponding SPI setting in config.txt Code: pi@moode:~ $ lsmod | grep spidev Similarly, my radio project uses the ti_ads1015 module, but this is loaded by a setting in config.txt. Adrian. RE: Official moOde 7.2.1 support thread - Tim Curtis - 05-29-2021 I'm a bit confused on #2. What is raspi-config being used for? RE: Official moOde 7.2.1 support thread - adrii - 05-29-2021 Hi Tim raspi-config is being used to enable/re-enable I2C on Moode. It also might be used to enable SPI, which would append a line to the end of /boot/config.txt. Adrian. RE: Official moOde 7.2.1 support thread - Tim Curtis - 05-29-2021 Below is i2c section of raspi-config script. It looks like its doing the following: 1. Adding "dtparam=i2c_arm=on" to /boot/config.txt 2. Adding "i2c-dev' to /etc/modules 3. Manually loading i2c-dev module via "modprobe i2c-dev" moOde already includes "dtparam=i2c_arm=on" in /boot/config.txt so if I add "i2c-dev' to /etc/modules" as the default it will get loaded automatically at boot by Linux. There wouldn't be a need to use raspi-config at this point correct? What is SPI used for? Code: do_i2c() { RE: Official moOde 7.2.1 support thread - TheOldPresbyope - 05-29-2021 (05-29-2021, 01:18 PM)adrii Wrote: Hi Tim Wish I had time to concentrate on moOde stuff...but I don't if I want to preserve domestic tranquility raspi-config is a 2900-line shell script and the I2C and SPI subroutines (ca lines 850-935) are only several percent of it. Seems like some economy is possible here. Regards, Kent RE: Official moOde 7.2.1 support thread - adrii - 05-29-2021 Hi Tim Some screens use SPI. If you load i2c-dev with the current /boot/config.txt then I2C should be available through the normal devices and there is no reason to run raspi-config, but other I2C settings might be needed in /boot/config.txt, e.g. for bus speed. Adrian. RE: Official moOde 7.2.1 support thread - Tim Curtis - 05-29-2021 Ok that explains it. I'll test the include feature of config.txt. You recommend placing it first rather than last correct? RE: Official moOde 7.2.1 support thread - adrii - 05-29-2021 Hi Tim In config.txt, if user settings come after Moode settings then they can override them. It seems like the options are:
Adrian. |