davethomaspilot
28th January 2024, 01:35
I have this method:
void MainWindow::shutdown()
{
//::gpioWrite(ENA_12V,PI_LOW);
QProcess process;
qDebug() << "Powering down the rpi" ;
process.startDetached("sudo systemctl poweroff --no-block");
}
It's running on an RPI (Bookworm 64 bit OS). The pi doesn't shutdown.
If I run
sudo systemctl poweroff --no-block
the rpi shuts down as expected.
Why doesn't it work as a QProcess?
void MainWindow::shutdown()
{
//::gpioWrite(ENA_12V,PI_LOW);
QProcess process;
qDebug() << "Powering down the rpi" ;
process.startDetached("sudo systemctl poweroff --no-block");
}
It's running on an RPI (Bookworm 64 bit OS). The pi doesn't shutdown.
If I run
sudo systemctl poweroff --no-block
the rpi shuts down as expected.
Why doesn't it work as a QProcess?