aumudin
Posts: 6
Joined: Tue May 24, 2016 9:23 pm

RPi File Transfer Solution

Tue May 24, 2016 9:31 pm

First off I am new to the forums so hopefully this is going in the correct place! I see there is a networking/server forum but couldn't decide if it fit there or not.

So to my question: I am looking for some advice on how to handle something. I have 30 rpi2s/camera setups in lets say in a 5 square mile area. I am trying to develop a solution to where I can just drive up close to one and connect to it wireless with my laptop or phone and have it download/upload a slew of files. I want to be able to download the pictures(roughly 5,000 images a month) and videos to my laptop but be able to upload new code changes to the Pis without having to take them down(they are 30' or so up in the air so quite the pain in the butt). One of the disadvantages I have is everything is being run off solar panels right now so power efficiency is key to me.

If I absolutely have to I could put lets say a 4 port Ethernet hub and just drop a cable to connect the laptop too and always have the RPi hooked up to it. But again just looking for some suggestions or maybe see what others have done. If there is any information I can provide let me know!

Right now I have looked at using BLE but I haven't ever done and programming with BT so not sure the capabilities, theres a link on how to broadcast an internet connection from your RPi and could try that, and lastly obviously just going the route of dropping a cat5 cable from the enclosure.

epoch1970
Posts: 5132
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: RPi File Transfer Solution

Tue May 24, 2016 10:04 pm

So you don't want to use wifi? I'm not sure wifi consumes much more power than BT, regular or LE, I'll leave that to others.
If you were to create a wifi access point on each Pi, then I think I would try using syncthing on each Pi (and on your laptop)
It's 2-way replication, so you have to be careful with what you do on the laptop when you're in range. Deletes are fast...
But I find syncthing is lightweight and quite resilient to network failures. It tries to connect relentlessly and usually succeeds.
With a crontab you could have both services (AP and synchting) fire up only at regular intervals in order to save power.
(actually it is n-way replication so the Pis could also sync among themselfs -themselves?- if they are in range of each other. Harvest pics or upload a dir on any of them, and the change would be propagated back.)
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

aumudin
Posts: 6
Joined: Tue May 24, 2016 9:23 pm

Re: RPi File Transfer Solution

Tue May 24, 2016 10:21 pm

Until I was reading on this forum just a bit ago I didn't know we could turn the units into access points so I was surprised when I seen that. I will definitely look into this more. Looking here: http://raspi.tv/2014/pihut-wifi-dongle- ... ower-usage it shows that it only uses 40-70mA so thats really not all that bad and my panels/battery can support that right now so that solution might just work! It might be a little higher for what im doing but it would only be once a week maybe so wouldnt break the power bank.
Last edited by aumudin on Wed May 25, 2016 3:27 am, edited 1 time in total.

epoch1970
Posts: 5132
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: RPi File Transfer Solution

Tue May 24, 2016 10:49 pm

Oh yes you can. Search for "hostapd".
Be aware than all usb keys are not created equal, and hostapd performance or even support will vary according to brand/model.
On Pi 3 the integrated hardware runs fine, BTW.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

aumudin
Posts: 6
Joined: Tue May 24, 2016 9:23 pm

Re: RPi File Transfer Solution

Wed May 25, 2016 3:25 am

I think I'm going to move forward with this as the solution. For those that are needing something similar here is a link to a tutorial:

https://learn.adafruit.com/setting-up-a ... l-software

Even if power was an issue I could hook up a motion sensor which uses hardly any power and if it detects anything it would trigger it to turn the wifi on for 20 minutes then turn it back off.

Thank you epoch!

epoch1970
Posts: 5132
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: RPi File Transfer Solution

Wed May 25, 2016 9:41 am

I think that's a good starting point. You don't really need the network address translation thing (NAT) since AFAIK your Pis will not be connected to the internet or together. You can do away with the dhcp server requirement, and use either IPv4LL (although you need a thinggy that delivers the 169.254. address) or even simpler, use a static address for the Pi and for the laptop.
(If you can/want to network your Pis then managing fixed addresses become a bit cumbersome.)
To summerize, you could have this:
  • 30 x Pi, address 192.168.0.1
  • Y x clients (laptop, ...), address(es) 192.168.0.2 to 192.168.0.254
Actually maybe you want to use wifi ad-hoc mode, which creates a one-to-one link between 2 radios (with ipv4ll). Then you wouldn't even need hostapd... I've used that so rarely, I can't be too affirmative. But maybe this is the better idea (if so sorry for the false start..)

(something like syncthing, to do file replications, is very much network agnostic, it uses application-level IDs to recognize its peers and do the deed. Should work ok with a completely volatile set of network addresses. I'm sure similar software go the same way.)
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

epoch1970
Posts: 5132
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: RPi File Transfer Solution

Wed May 25, 2016 9:56 am

aumudin wrote:Even if power was an issue I could hook up a motion sensor which uses hardly any power and if it detects anything it would trigger it to turn the wifi on for 20 minutes then turn it back off.
That's a funny idea: use your own cameras to identify the boss and then start the network :)
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

Return to “Beginners”