Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Problem: Autoplay after start
#3
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:

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!
Reply


Messages In This Thread
Autoplay after start - by fiorello - 11-29-2020, 03:07 PM
RE: Autoplay after start - by Tim Curtis - 11-29-2020, 03:58 PM
RE: Autoplay after start - by fiorello - 11-29-2020, 04:21 PM
RE: Autoplay after start - by Tim Curtis - 11-29-2020, 05:12 PM
RE: Autoplay after start - by fiorello - 11-30-2020, 08:56 AM
RE: Autoplay after start - by Tim Curtis - 11-30-2020, 12:33 PM
RE: Autoplay after start - by fiorello - 12-01-2020, 06:08 PM
RE: Autoplay after start - by TheOldPresbyope - 12-01-2020, 06:59 PM
RE: Autoplay after start - by fiorello - 12-06-2020, 04:27 PM
RE: Autoplay after start - by TheOldPresbyope - 12-06-2020, 06:18 PM

Forum Jump: