11-29-2020, 04:21 PM
Hi Tim
Thanks for your answer!
I modified worker.php by adding a single command which starts a script. This is used (by setting a GPIO port) to inform my underlaying microcontroller that the raspi has booted and moOde is ready. Modified snipped of my worker.php:
My script "gpio_set.sh" is as follows:
So, I don't expect any issues by this... Or am I wrong?
Thanks!
Thanks for your answer!
I modified worker.php by adding a single command which starts a script. This is used (by setting a GPIO port) to inform my underlaying microcontroller that the raspi has booted and moOde is ready. Modified snipped of my worker.php:
Code:
// Auto-configure if indicated
// NOTE: This is done near the end of startup because autoConfig() uses the wpa_passphrase utility which requires
// sufficient kernel entropy in order to generate the PSK. If there is not enough entropy, wpa_passphrase returns
// the input password instead of a PSK.
if (file_exists('/boot/moodecfg.txt')) {
sysCmd('truncate ' . AUTOCFG_LOG . ' --size 0');
autoConfig('/boot/moodecfg.txt');
sysCmd('sync');
autoCfgLog('autocfg: System restarted');
sysCmd('reboot');
}
// Script to indicate the PIC that the raspi has booted and is running
sysCmd('sudo bash /var/local/www/commandw/gpio_set.sh');
// Start watchdog monitor
sysCmd('/var/www/command/watchdog.sh > /dev/null 2>&1 &');
workerLog('worker: Watchdog started');
//
workerLog('worker: Ready');
$result = sdbquery("UPDATE cfg_system SET value='1' WHERE param='wrkready'", $dbh);
//
//
// BEGIN WORKER JOB LOOP
//
My script "gpio_set.sh" is as follows:
Code:
#!/bin/bash
#
# Set GPIO11 to indicate the PIC that the raspi has booted and is running.
echo 11 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio11/direction
echo 1 > /sys/class/gpio/gpio11/value
So, I don't expect any issues by this... Or am I wrong?
Thanks!