electronicramblings.com

Archive for April, 2014

Raspberry Pi Arch Linux: Another thing I have learned. NTPd

by on Apr.16, 2014, under Electronic Projects, Raspberry Pi

A quick post.

NTPd service should not be installed as root. Specially if you want to run it as a daemon.
Make sure you install from a less user.

So install ntpd like so:
sudo pacman -S ntp

Enable the systemd:
sudo systemctl enable ntpd

sudo nano /etc/conf.d/ntpd.conf
NTPD_ARGS=”-g -i /var/lib/ntp -u ntp:ntp”

sudo nano /etc/ntp.conf 
#driftfile /var/lib/ntp/ntp.drift
driftfile /ntp.drift

Now configure the chroot environment:

mkdir /var/lib/ntp/etc /var/lib/ntp/lib /var/lib/ntp/proc
touch /var/lib/ntp/etc/resolv.conf /var/lib/ntp/etc/services

sudo nano /etc/fstab
#ntpd chroot mounts
/etc/resolv.conf /var/lib/ntp/etc/resolv.conf none bind 0 0
/etc/services /var/lib/ntp/etc/services none bind 0 0
/lib /var/lib/ntp/lib none bind 0 0
/proc /var/lib/ntp/proc none bind 0 0

Reboot or run this:
sudo systemctl restart ntpd

Leave a Comment more...

Raspberry Pi TreeCam project Arch Linux Motion USB Cam Gdrive Gmail

by on Apr.13, 2014, under Electronic Projects, Raspberry Pi

 

 

Finished my TreeCam project.

IMG_7504-800

Just a reminder, I am pretty much documenting my adventure for a reminder to myself of what I did.  If others can use what I have done, so be it.  However I am still learning and go to the great and all powerful GOOGLE to find answers to the questions I seek when I just don’t know or understand something.

To start you should head to the net and read how to load a image of Arch Linux for the raspberry pi. 

Get your pi running Arch and then head over to this page. Kean has done great job of explaining the loading of the software, python scripts and getting the system running. If you follow his directions, you will have a working system when done.

Note: If you have a problem loading the gdata package like I did. You might have a unit with only 256k. To fix this, create a swap file on the system. 128k swap will be enough. (my first Raspberry Pi post talks about this)

Here is a video of my unit in action watching the cat post.
I have the motion.conf set to show 5 frames before motion is detected and 30 frames after motion has stopped in the video. Makes for a more complete video.
2014-03-30-07-44-51-08

Now down to business.

The Parts:

Raspberry Pi B1 256mb (market price)
4gig SD card (DX.com $4)
Arch Linux (Free….)
Microsoft LifeCam HD-3000 Camera (used at garage sale $5, got to love garage sales!!!!!)
Wifi Dongle (Comfast CF-WU720N, bought it from DX.com  $8)
     -next time purchasing one with the external antenna.CF-WU730A $10
12 volt to 5 volts converter (DX.com as well $4)
JB Enclousure (HomeDepot 6x6x4″ $20)
White Vacuum couplers and tubing.(Leftovers from Centeral Vac install)
Clear glass cut to fit White Vacuum coupler ($5)
Misc stuff ($5)

Now if you want, you can down load my image from *****.  It fits on a 4gig or larger card and make the changes mentioned below and have a running system in a short while. (if this file is not accessible by the link, contact me and I will send a link to the file to you.)

You can use Win32diskimager to load the image on to the SD card.
My image is for a 4gig or larger SD card. You should not have to expand to full size of your SD if 4gigs or  larger, as all storage of video files is done on Google’s gdrive.

Ethernet is set to DHCP, so you will have to find your Ip address on the network before accessing the unit using Putty, Xshell or terminal program. ( I run my system headless… no monitor, keyboard or mouse)
Wifi is set DHCP.

Things you need to update to have working system:

Setup a Gmail account and gdrive information in the uploader file: /etc/motion/uploader.cfg
Wifi information: run wifi-menu , follow the programs prompts.  If you want to make static edit /etc/netctl/wlan0-??? file. Search the net for the proper information to place here. This is what I would have in mine:(the ESSID and Key will already be there from when you ran the wifi-menu script.)

Interface=wlan0
Connection=wireless
Security=wpa
ESSID=????
IP=static
#IP=dhcp
Key=\”fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
Address=(‘192.168.0.211/24’)
gateway=(‘192.168.0.1’)
DNS=(‘8.8.8.8’ ‘8.8.4.4’)

Motion information(if you want it act differently): Edit /etc/motion/motion.conf

Now change the Passwords for root and pi to make it your own.
Default for this image are:
User: root     Password: root
User: pi          Password: rpi

Reboot the unit and cross your fingers and you should be catching the neighbour’s dog pooping on your lawn.
Below I have attached pictures of the unit. Very simple and easy to build. If you can not cut the glass, visit your local glass shop, they can do it for you, if you ask nicely. Also plexi-glass will work as well.

Till next time, thanks for your time.

Pictures:

IMG_7531-800 IMG_7536-800 IMG_7533-800 IMG_7545-800 IMG_7522-800 IMG_7517-800 IMG_7529-800

 

 

 

Leave a Comment more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...