0

I would like to transfer files from Raspberry Pi Zero W to PC over USB interface. Is it possible? My idea is to first use Pi Zero standalone to run an application, which generates some files on the microSD card. Later, I want to be able to transfer those files to the PC without taking out the micro SD card on sending a command from PC, perhaps through a custom GUI on Qt or VB.

P.S. I am aware of WinSCP program, that can serve this purpose. But, the IP changes every time Pi is connected. I find it a bit cumbersome to everytime scan for the IP and use it in the WinSCP program.

Raghavan K
  • 51
  • 1
  • 9

2 Answers2

3

Here's how I do it:

  1. Configure your network services properly. You're using your PiZero as a server of sorts, so you'll want to set your PiZero's IP address to a fixed value. Once you've accomplished this, and assuming you have a DHCP server + router combo box on your network that you control: update your DHCP server (and local network DNS server) to reflect the fixed IP assignment on your PiZero. Of course you'll need to follow the procedures outlined for your DHCP/DNS software as this is not a Raspberry Pi issue. Once completed correctly, this network configuration will ensure that: a) your PiZero is always at the same IP address, and b) your DNS knows where that is. You'll be able to find your PiZero easily from your PC afterwards.

  2. Install Samba on your PiZero, and configure your SD card as a "share" (alternatively, use a separate USB drive of some type in lieu of your SD card). There are many guides available to help you do this if you don't already know how. Here's one I prepared on my GitHub site that may be of some use to you.

  3. You can now write files to the Samba share using the standalone programs you referenced in your question, and once your PiZero is connected to the network you configured in Step 1, these files will be available for use/transfer on your PC.

Seamus
  • 23,558
  • 5
  • 42
  • 83
0

Trying to use USB is possible, but overly complex. Use your network!

There is NO NEED to know the IP, you can address the Pi with hostname.local See Connecting a Computer to the Pi in How to set up networking/WiFi

Milliways
  • 62,573
  • 32
  • 113
  • 225