3

I have just got my first Raspberry Pi, (3 Model B+) and am having so much fun with it. My first project is a simple wildlife camera that takes pictures using a simple python script to detect motion. It works great and I have since updated it to also take 10-second videos on motion, (Great for watching the birds in front of a bird feeder).

I have set up samba to make it easy to access the files, but that requires me to be connected to a wifi network. Is there any way that I could use Samba, by connecting over wifi directly to the pi? so that I could go outside with my laptop and have a look if I caught any good images without having to take it inside and connect to my home wifi network.

Even better would be to somehow make the images accessible by any browser so I could have a look at the pictures that were taken. The SD card I am using is multi-purpose so I don't want to mess too much with the wifi configuration etc.

If anyone could point me in the right direction I would appreciate it greatly, Thank you!

  • 1
    The easiest way would probably be to create a WiFi hotspot on the RPi, and run a Samba server to access the files. See https://raspberrypi.stackexchange.com/questions/77470/configure-wifi-settings-with-startup-as-a-acces-point and https://raspberrypi.stackexchange.com/questions/3498/how-can-i-log-into-my-raspberry-pi-samba-share-from-windows – Piskvor left the building Mar 29 '19 at 13:17
  • @Piskvor Thank you, would that make it incapable of connecting to wifi networks normally? I tried a method using Hostapd to turn the pi into an access point, but then I was not able to use the pi normally. – Peter Ruppert Mar 29 '19 at 13:39
  • Once you have the hotspot the world is your oyster regarding getting the files off. Run a little webserver to view them from the laptop, maybe. – Mark Smith Mar 29 '19 at 13:39
  • 1
    I think that you can use the wifi as a hotspot and client at the same time, but it needs additional changes. – Piskvor left the building Mar 29 '19 at 13:41
  • 1
    (It could be easier to add a USB wifi dongle and run the hotspot on that, while using the built-in interface for client wifi access) – Piskvor left the building Mar 29 '19 at 13:43
  • An alternative to a WiFi hotspot might be to use the Bluetooth for the file transfer. It'd be slow and no web browser access but might be better suited. An "old school" way to transfer the photos would be to use a USB drive that you can unplug from the Pi and connect to the laptop... – Roger Jones Mar 29 '19 at 13:46
  • thanks guys a bunch of great ideas! This is why I fell instantly in love with the Raspberry Pi, so many different possibilities and solutions! I may have a USB wifi dongle laying around somewhere that might work well as I can just plug that in when I need it, otherwise perhaps it would be possible to have something in my camera script that starts a wifi hotspot and ends it when I close the program. Not sure how simple that would be... – Peter Ruppert Mar 29 '19 at 15:12
  • @Piskvor said, I think getting a second USB wifi dongle to create a hotspot with would be the best option. Then, you could run a small webserver to serve the images. Here is an easy command line webserver option. – Benjamin Ashbaugh Mar 29 '19 at 18:18

3 Answers3

0

If the Pi is mostly-connected, there's also the option "lsyncd the pictures to a server out there, and webserve it from there."

0

Your question is unclear, but I think the following would meet your needs Raspberry Pi as an Access Point OR WiFi client

This lets my Pi work as a normal WiFi Client when one of my networks is available and as an Access Point otherwise. This would let you use your laptop to connect to the Access Point, but when you bring the Pi indoors it would connect to your router. I use this when travelling with my Pi.

I can't comment on Samba, but I access the Pi with ssh, VNC, ftp and other protocols, and can access a nginx server on the Pi.

Milliways
  • 59,890
  • 31
  • 101
  • 209
0

I don't know if it is reasonable for your situation but by far the easiest way to connect to the RasPi outside is to connect to it with an ethernet cable. This works out of the box and don't need additional configuration. You may have the cable always plugged in the RasPi. For example if you have the RasPi mounted in a tree, the cable is hanging down the tree and you can temporary connect to it with the laptop if you want.

Other ways are to use WiFi in all its possible combinations. If the cable solution is not possible I would prefer an access point without routing because there is no routing needed between the access point and the client connection. How to do it you can look at Access point as WiFi repeater, optional with bridge. Follow it until Step 4: setup static interfaces and omit the line IPForward=yes in file /etc/systemd/network/08-wlan0.network.

If you prefer to use an additional USB/WiFi dongle you can look at Access point as WiFi repeater with additional WiFi-dongle but I don't see a real advantage to spend additional hardware for this simple use case.

You can also switch manual or by script the on-board WiFi to be used either as access point or as client connection. How to do it you can look at Switch between wifi client and access point without reboot.

You may also consider to use the bluetooth connection.

Ingo
  • 42,107
  • 20
  • 85
  • 197