I use in my config.txt file
dtoverlay=mcp23017
Is possible to disable that dtoverlay from the command line?
I know that I can remove this line from config.txt but I need to disable it from the command line during test procedure and keep original config.txt
- DougieLawson
- Posts: 40582
- Joined: Sun Jun 16, 2013 11:19 pm
- Location: A small cave in deepest darkest Basingstoke, UK
- Contact: Website Twitter
Re: dtoverlay disable from command line
You can't do that.
The way to disable it is edit /boot/config.txt and change to then reboot. To re-enable it reverse that change.
The way to disable it is edit /boot/config.txt and change
Code: Select all
dtoverlay=mcp23017
Code: Select all
#dtoverlay=mcp23017
Last edited by DougieLawson on Sat Sep 21, 2019 6:33 pm, edited 1 time in total.
Any language using left-hand whitespace for syntax is ridiculous
Any DMs sent on Twitter will be answered next month.
Fake doctors - are all on my foes list.
Any requirement to use a crystal ball or mind reading will result in me ignoring your question.
Any DMs sent on Twitter will be answered next month.
Fake doctors - are all on my foes list.
Any requirement to use a crystal ball or mind reading will result in me ignoring your question.
-
- Raspberry Pi Engineer & Forum Moderator
- Posts: 3608
- Joined: Mon Sep 29, 2014 1:07 pm
- Location: Cambridge
Re: dtoverlay disable from command line
Either my eyesight is failing or the after looks a lot like the before - should there have been a # comment character at the start of the edited version?
- DougieLawson
- Posts: 40582
- Joined: Sun Jun 16, 2013 11:19 pm
- Location: A small cave in deepest darkest Basingstoke, UK
- Contact: Website Twitter
Re: dtoverlay disable from command line
The postie delivered my new glasses this afternoon.
Any language using left-hand whitespace for syntax is ridiculous
Any DMs sent on Twitter will be answered next month.
Fake doctors - are all on my foes list.
Any requirement to use a crystal ball or mind reading will result in me ignoring your question.
Any DMs sent on Twitter will be answered next month.
Fake doctors - are all on my foes list.
Any requirement to use a crystal ball or mind reading will result in me ignoring your question.
-
- Raspberry Pi Engineer & Forum Moderator
- Posts: 3608
- Joined: Mon Sep 29, 2014 1:07 pm
- Location: Cambridge
Re: dtoverlay disable from command line
Although you can't remove an overlay applied from config.txt, you could apply it at runtime instead which would then allow you to subsequently remove it.
Try the following:
1. Comment out the line in the config file and reboot.
2. Run "sudo dtoverlay mcp23017"
3. Verify that it works.
4. Run "sudo dtoverlay -r" to remove the most recent overlay.
5. Confirm that the functionality has been disabled.
N.B. Some subsystems don't react to runtime overlays being applied, but SPI and I2C should be okay.
Try the following:
1. Comment out the line in the config file and reboot.
2. Run "sudo dtoverlay mcp23017"
3. Verify that it works.
4. Run "sudo dtoverlay -r" to remove the most recent overlay.
5. Confirm that the functionality has been disabled.
N.B. Some subsystems don't react to runtime overlays being applied, but SPI and I2C should be okay.