LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices


Reply
  Search this Thread
Old 03-30-2014, 05:09 PM   #1
sansprecept
LQ Newbie
 
Registered: Nov 2013
Location: Houston, Tx
Distribution: Arch, Slackware
Posts: 11

Rep: Reputation: 1
Headless RasPi boot conflict


Kind of a long explanation but I want to be sure I cover everything to make the question understandable. I started a timelapse project with a RasPi to watch two houses across the street get torn down and then rebuilt. I mounted it under one of my eaves and it is just barely in wifi range, but works. I need to move it out more so I need it set up with a rtc also, but now I cant get it all to work together.

If I have the rtc, camera and usb wifi plugged in, the wifi cuts shortly after booting. If I disconnect either the cam or rtc, it boots fine.

I have it set up so that when it boots, a script named
timelapse.sh runs.

/usr/local/bin/timelapse.sh
Code:
#!/bin/bash
while true
	do
	filename="pic_$(date +%Y%m%dT%H%M%S)".jpg
	raspistill -w 1920 -h 1080 -o /home/pi/images/$filename
	echo Image captured
	sleep 30
done
I put it in cron originally but now I have it in rc.local. It runs fine on startup.

Next I edited my fstab and created a udev rule so that everytime I inserted my usb thumbdrive it would automatically mount and then run backup.sh.

fstab
Code:
proc            /proc           proc    defaults          0       0
/dev/mmcblk0p1  /boot           vfat    defaults          0       2
/dev/mmcblk0p2  /               ext4    defaults,noatime  0       1
UUID=E280-D629  /usb            vfat    defaults,users,umask=0  0 0
/etc/udev/rules.d/95-usb.rules
Code:
SUBSYSTEM=="block",RUN+="/bin/mount -a",RUN+="/usr/local/bin/backup.sh"
/usr/local/bin/backup.sh
Code:
#!/bin/bash
sleep 10
mv /home/pi/pic/*.jpg /usb
It runs fine also. Not sure if the sleep is really necessary but it isn't the problem.

I then have 2 cronjobs. Shiftpics.sh moves the images to a directory for backup.

/usr/local/bin/shiftpics.sh
Code:
#!/bin/bash
mv /home/pi/images/*.jpg /home/pi/pics
exit 0
and cleanusb moves images from mount directory 3 hours later because it has pics there without the stick sometimes.

/usr/local/bin/cleanusb.sh
Code:
#!/bin/bash
mv /usb/* /home/pi/pics
exit 0
These were all working fine before I added the rtc.

I need the rtc so that I can move it out of wifi range and keep the date/time file naming. I got a rtc, soldered it together and followed the Adafruit wiring and setup instructions. Mine is actually a Digistump real time clock shield but it worked fine when I tested it out on another RasPi.

The ultimate plan is:
The pi would boot and save the pics to images. Shift would move them at 3am and 3pm. I would stick in the usb at around 4am and pm before I left and got back from work. I would walk off because it took about 20 or 30 minutes to copy. I would take out the stick and a couple hours later cleanusb would make sure that directory was clear. Timelapse could run the whole time.

Thank you for any ideas and please tell me if there is anything else I could post to make troubleshooting easier.
 
Old 03-31-2014, 09:55 AM   #2
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7 / 8
Posts: 3,560

Rep: Reputation: 1600Reputation: 1600Reputation: 1600Reputation: 1600Reputation: 1600Reputation: 1600Reputation: 1600Reputation: 1600Reputation: 1600Reputation: 1600Reputation: 1600
Just out of curiosity, what are you powering the RasPi with?

It may be the case that with the camera and RTC board the RasPi is using more current than the power supply can provide so it's conserving power by shutting down the (USB) WiFi dongle.
 
Old 03-31-2014, 10:33 AM   #3
sansprecept
LQ Newbie
 
Registered: Nov 2013
Location: Houston, Tx
Distribution: Arch, Slackware
Posts: 11

Original Poster
Rep: Reputation: 1
Your thinking was spot on. I figured it out last night but the thread was not posted yet so I couldn't edit it. I was powering it with an old Motorola charger but have since replaced that with a LG charger from my G2. It all works fine.
I was actually diving into figuring out why the usb kept going to sleep which is what I thought was happening. I happened upon a thread where someone found out theirs was a power supply problem so I switched mine out. It didn't even occur to me like it did you that there was not enough power. I kept thinking software. I should have realized that if I add hardware and things start running bad, it will probably be a hardware issue. Kind of silly when I look back. Not the best example of my troubleshooting skills.
Thanks again. I'll edit the subject as solved.
 
Old 03-31-2014, 10:46 AM   #4
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7 / 8
Posts: 3,560

Rep: Reputation: 1600Reputation: 1600Reputation: 1600Reputation: 1600Reputation: 1600Reputation: 1600Reputation: 1600Reputation: 1600Reputation: 1600Reputation: 1600Reputation: 1600
There are also some power supplies that are designed with the Pi in mind in terms of supplied current. Not all mobile device chargers were created equal
 
Old 03-31-2014, 07:41 PM   #5
sansprecept
LQ Newbie
 
Registered: Nov 2013
Location: Houston, Tx
Distribution: Arch, Slackware
Posts: 11

Original Poster
Rep: Reputation: 1
Gotcha. Sounds like a good investment to look into for this application. Thanks again.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Video Stream from RasPi to Linux Debian CokeAt3C Linux - Newbie 2 01-14-2014 11:40 AM
[SOLVED] slackware arm on raspi eth2 problem r2512s1925 Slackware 1 11-09-2013 05:26 PM
headless dual boot without floppy txm123 Linux - Newbie 4 09-15-2008 09:12 PM
Access headless server which dont boot ? erland Linux - General 3 07-27-2005 06:32 PM
Headless Router RedHat 9.0 Will Not Boot bdm Red Hat 0 04-25-2004 08:23 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 08:30 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration