LoginSignup
0
0

More than 5 years have passed since last update.

PiZero > File Messenger (doc v0.2) > Auto File Copy

Last updated at Posted at 2016-02-27

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.txt and send.txt
  • Connect the USB flash to the PiZero
    • File Messenger will overwrite the name.txt in the PiZero
    • File Messenger will overwrite the send.txt in the PiZero
    • File Messenger will overwrite the rcvd.txt in the USB Flash

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.

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0