I am trying to transfer files from a PC to a RPi but I can’t find a way. Please help.

Explanation: the PC is actually a Windows device on which I can’t make any installation or configuration. This device has Ethernet and can save files on the network.

I installed Samba on my RPi so that it can receive files. But I can’t find out how to get the device and the RPi connected directly with an Ethernet cable.

Moreover I need the RPi to be able to stay connected to the local Wi-Fi network at the same time. (of course the Windows device doesn't have Wi-Fi).

In the end, the device will store files on the RPi. A software on the RPi will read and parse the files. Then some data will be sent from the RPi to Internet through Wi-Fi.

Someone to help?


  • I really have to use Ethernet for file transfer
  • I really can't install any software on the Windows device
  • "But I can’t find out how to get the device and the RPi connected directly with an Ethernet cable." - please explain that in more details. What have you tried? Did you get an error? Which one? – Dmitry Grigoryev Jul 17 '18 at 9:53
  • @DmitryGrigoryev To date, I installed samba en dnsmasq on the RPi. The windows device and RPi are physically connected with an ethernet cable. The RPi is sometimes visible on the windows device "Network", but not always. Sometimes I can see the RPi, sometimes no. I need to stabilize the situation. – Thomas Jul 18 '18 at 11:33

Here is what you could try (expanding on the comment by Seamus):

  1. Connect Raspberry Pi and Windows PC by Ethernet cable

  2. Find out IP-address of Ethernet interface of the Raspberry Pi. Normally this will be a self-assigned link-local IP-address in the range of to You can find the IP-address of the RPi via ifconfig eth0 (replace eth0 with the name of your ethernet interface). I assume you will be able to carry out this command either directly on the RPi, by attaching monitor, mouse and keyboard or by connecting via ssh from another machine on your WiFi.

  3. Make sure that the ip-address of the ethernet interface of your windows machine is in the same subnet as the RPi. Run ipconfig in the command prompt of your Windows PC and look for the IP-address. If it is in the range to you are fine. Otherwise, change the ip-address of your Raspberry Pi to have both in the same subnet. (advice: in my experience you get such a link-local address on your Windows PC, if no other IP-address was assigned to the ethernet interface since rebooting, i.e. if you were not connected to a LAN before)
  4. Use the program pscp on your Windows PC to transfer data to the RPi. You need to download it, but there is no need to install it. You can run it directly from the command prompt.
    For example, you can copy the file example.txt from your Raspberry Pi's (ip-address home directory via the Windows command prompt to your current working directory like this:
    pscp pi@ .
| improve this answer | |
  • 1
    Link-local addresses are in a class B subnet that is with addresses from to – Ingo Jul 18 '18 at 10:11
  • Thank you very much for these details. I can confirm my IPs are correct. But the RPi is sometimes visible on the windows device "Network", but not always. Sometimes I can see the RPi, sometimes no. I need to stabilize the situation. I can't use a pscp because the device and a specific software is used by users who have to select a folder (on the RPi) where the program will later automatically save files. – Thomas Jul 18 '18 at 11:41
  • @Ingo: You are right of course. I mentioned the range where you can expect the link-local address to come from, because according to the RFC3927 the first and last 256 addresses in the block shall not be selected by the host. – oh.dae.su Jul 18 '18 at 19:37

I'll make some assumptions.

  • You can't install anything on the PC. You can't change anything on the PC.
  • If you connect an ethernet cable on the PC, it will request configuration from a DHCP service.
  • You want to connect the PC and the RPi through a wire directly to each other.

If that's the case, then you could set up dnsmasq on the rpi so that it can "serve" a configuration to the PC when they both connect. Then, when both computers can see each other (they can ping each other), the simplest thing would be for you to use an ftp service (there are various available on linux, AFAICT) installed on the rpi so that you can use internet explorer to connect to it. Then you can upload the files to the RPi.

| improve this answer | |
  • Your assumptions are good. Thank for your help I’ll have a look at dnsmasq. But for files transfer I can’t use FTP, I must use the only available software that can store files by selecting a directory in a traditional windows browser. – Thomas Jul 13 '18 at 21:16
  • Can you at least create a shared resource on the PC? If that's the case then I think it's simpler if you try to use smbclient on the rpi to connect from the rpi to the desktop and then pull the files from the PC. Trying to set up samba (service) on the rpi to be able to see shared resources from the PC sounds like an overkill. – eftshift0 Jul 13 '18 at 21:39
  • To connect your Windows device directly to the RPi over an ethernet cable, you must have both your RPi and your Windows device on the same subnet. If you can NOT change the network configuration of your Windows device, you'll need to approach from a different direction: You will need to determine the IP address and subnet of your Windows device, and then set up the RPi network to match that. Confirm your ability to configure the Windows device first, and we'll go from there. – Seamus Jul 13 '18 at 22:00
  • I can confirm now that I should be able to configure the windows device. But since there may be a LOT of installations of these system, it would be better if I could only ask technicians to plug the RPI to the device, and that's all. I installed dnsmasq and it seem to work, sometimes... the RPi is sometimes visible on the windows device "Network", but not always. Sometimes I can see the RPi, sometimes no. I need to stabilize the situation. – Thomas Jul 18 '18 at 11:45
  • Wish I could help you more on the smb front... It's outside of my comfort-zone. – eftshift0 Jul 18 '18 at 14:42
  1. Copy the files to the /boot directory on the Pi.
  2. switch off the Pi
  3. remove the SD card
  4. put the SD card in a card reader
  5. attach the card reader to the PC
  6. copy the files from the card reader to the PC
| improve this answer | |
  • Thank for your answer. I should have explained that I will have to manage automatic transferts for hundreds of devices. – Thomas Jul 14 '18 at 12:00
  • I edited my question. – Thomas Jul 16 '18 at 7:22

Not the answer you're looking for? Browse other questions tagged or ask your own question.