I have this method:
void MainWindow::shutdown()
{
//::gpioWrite(ENA_12V,PI_LOW);
qDebug() << "Powering down the rpi" ;
process.startDetached("sudo systemctl poweroff --no-block");
}
void MainWindow::shutdown()
{
//::gpioWrite(ENA_12V,PI_LOW);
QProcess process;
qDebug() << "Powering down the rpi" ;
process.startDetached("sudo systemctl poweroff --no-block");
}
To copy to clipboard, switch view to plain text mode
It's running on an RPI (Bookworm 64 bit OS). The pi doesn't shutdown.
If I run
sudo systemctl poweroff --no-block
sudo systemctl poweroff --no-block
To copy to clipboard, switch view to plain text mode
the rpi shuts down as expected.
Why doesn't it work as a QProcess?
Bookmarks