Raspberry Pi WebCam with 3G (Solarcam): Difference between revisions

From Wurst-Wasser.net
Jump to navigation Jump to search
No edit summary
No edit summary
Line 15: Line 15:


=== How To ===
=== How To ===
==== Update your Pi ====
==== Update your Pi to the latest Linux version ====
  apt-get update
  apt-get update
  apt-get upgrade
  apt-get upgrade
TBD ZBD


==== Install USB-Modeswitch ====
=== Scripts ===
apt-get install usb-modeswitch
(you'll need this to switch your stick from mass storage to modem mode)
 
==== Create network interface ====
Add to <tt>/etc/network/interfaces</tt>
<del>iface eth1 inet dhcp</del>
<del>allow-hotplug eth1</del>
iface wwan0 inet dhcp
allow-hotplug wwan0
Reboot:
shutdown -r now
 
==== Check interface ====
It should read like this (on boot):
pi@raspberrypi ~ $ dmesg | grep GSM
[    9.322073] usbserial: USB Serial support registered for GSM modem (1-port)
[    9.805167] option 1-1.3:1.0: GSM modem (1-port) converter detected
[    9.893094] usb 1-1.3: GSM modem (1-port) converter now attached to ttyUSB0
[  10.003375] option 1-1.3:1.3: GSM modem (1-port) converter detected
[  10.145947] usb 1-1.3: GSM modem (1-port) converter now attached to ttyUSB1
[  10.250436] option 1-1.3:1.4: GSM modem (1-port) converter detected
[  10.372741] usb 1-1.3: GSM modem (1-port) converter now attached to ttyUSB2
pi@raspberrypi ~ $
 
pi@raspberrypi ~ $ dmesg | grep HUA
[    3.442910] usb 1-1.3: Product: HUAWEI Mobile
[    3.448928] usb 1-1.3: Manufacturer: HUAWEI Technology
[    4.514394] scsi 5:0:0:0: CD-ROM            HUAWEI  Mass Storage    2.31 PQ: 0 ANSI: 2
[    4.535154] scsi 6:0:0:0: Direct-Access    HUAWEI  SD Storage      2.31 PQ: 0 ANSI: 2
pi@raspberrypi ~ $
 
root@raspberrypi:~# lsusb | grep Huaw
Bus 001 Device 006: ID 12d1:1436 Huawei Technologies Co., Ltd.
root@raspberrypi:~#
 
==== Script: Take picture every minute ====
==== Script: Take picture every minute ====
Add this to crontab:
Add this to crontab:

Revision as of 14:54, 19 April 2018

The Idea

  • Use solar panel to harvest energy
  • Store the energy in a left over car battery
  • Power a Pi, camera and 3G-Stick Mobile HotSpot[1]
  • Make a nice webcam out of it :)

Shopping List

  • A Pi :)
  • Huawei E1750C (thats an mobile HotSpot. Because getting an UMTS-Stick getting to work with an Pi sucks. Additionally you can easily join the WiFi network for maintenance)
  • SIM Card
  • (used) Car battery, my case an 74Ah battery with one dead cell
  • Solar panel (TBD)
  • Solar charger (TBD)
  • more to come…

How To

Update your Pi to the latest Linux version

apt-get update
apt-get upgrade

TBD ZBD

Scripts

Script: Take picture every minute

Add this to crontab:

* * * * *	/home/pi/Development/webcam/takePicture.sh > /dev/null 2>&1

Add a file named takePicture.sh to ~/Development/webcam/ with this contents:

TBD TBD TBD

Tips

  • Remember that this Pi is in the wild and easily stolen or all the data read
  • Don't use your usual passwords for this project
  • Don't store keys on the Pi
  • Let your master server fetch the data (so no private keys are stored on the Pi) or use a chroot environment
  • Create a special user to access the data from remote, or even better, get it per HTTP and use .htaccess for privacy (and less 3G-traffic ;) )
  • If you WiFi connection breaks regularly, see Raspberry Pi WiFi issue (Solarcam)

?


  1. Since setting up the 3G-Stick was a pain in...