This article is for my entry to Pi Zero contest 2016.
https://hackaday.io/project/9526-bring-your-own-pizero-byop
File Messenger
Auto File Copy
Related
directory and data file format
Steps to use
When the program is running,
- Prepare the USB flash having
name.txtandsend.txt - Connect the USB flash to the PiZero
- File Messenger will overwrite the
name.txtin the PiZero - File Messenger will overwrite the
send.txtin the PiZero - File Messenger will overwrite the
rcvd.txtin the USB Flash
- File Messenger will overwrite the
No need for HDMI monitor, nor to ssh to the PiZero in order to change files in the PiZero.
Copy source and destination
| file | source | destination |
|---|---|---|
| name.txt | USB flash | PiZero |
| send.txt | USB flash | PiZero |
| rcvd.txt | PiZero | USB flash |
Volume name of USB flash: BYOP
Use BYOP for the volume name of the USB flash.
(or modify the code accordingly)
Trigger of the copy
The os.path.isdir(usbpath) is checked every 0.5 second.
Likewise the button push check to avoid chattering, the isdir is checked in sequence three times.
The combination of (False, False, True) for the isidr() is the trigger to copy files.