Mikem22
Posts: 6
Joined: Sat Apr 16, 2016 12:04 pm

umount eject USB in headless mode

Tue May 17, 2016 7:27 am

I've got my Pi3 configured as a local access point and can drive it with from a web page with buttons to run the picamera using my phone or a tablet. I have a USB stick to store the images from the camera, that is all working well. What I cannot get to work is a way to safely umount and eject the USB via a 'button' on the web page.
I've tried the following:
usbeject.php containing something like this from memory (as I'm at work now)
<?php
echo exec('sudo umount /bin/sda1');
?>
This php file is then referenced from my index.html , can't remember the code, but it is the same format as the reboot button I have on the web page that works.
When I click on the USBEJECT button nothing happens apart from the web page changes to a blank page
Please can anyone offer any advice?
Thanks

Return to “Beginners”