Hmm. Must be a 30 min timout on editing posts...
Another newbie question... What's the best way to power down a Raspberry Pi? I got the impression there's no off switch so you just unplug it. Doesn't quite sound safe though.
Re: Raspberry pi as a Wake on Lan source
Hmm. How would you delete a cron job?
Say I set 6am was a wake on lan time, but later changed my mind and wanted it to be 615am instead?
Found this...
http://forums.webhostingdiscussion.net/ ... 294.0.html
But can I delete just one entry? Not my whole user list of cron jobs?
Say I set 6am was a wake on lan time, but later changed my mind and wanted it to be 615am instead?
Found this...
http://forums.webhostingdiscussion.net/ ... 294.0.html
But can I delete just one entry? Not my whole user list of cron jobs?
Re: Raspberry pi as a Wake on Lan source
Ah. Must be something like this...
http://faq.1and1.com/scripting_language ... obs/4.html
http://faq.1and1.com/scripting_language ... obs/4.html
Re: Raspberry pi as a Wake on Lan source
And I see Allied has the power supply. I was wondering.
Which is better, Allied or RS? I'm in the US.
I'm not sure about the Allied white power supply connected with usb to micro usb. Is the RS power supply any advantage if it's all one unit? (Haha... And it's black. Less conspicuous that way. I plan to tuck this on a shelf and forget about it.)
I don't want to futz up the power. I would assume the power supply sold on Allied or RS should work just finie. As opposed to me hunting something else down somewhere.
Which is better, Allied or RS? I'm in the US.
I'm not sure about the Allied white power supply connected with usb to micro usb. Is the RS power supply any advantage if it's all one unit? (Haha... And it's black. Less conspicuous that way. I plan to tuck this on a shelf and forget about it.)
I don't want to futz up the power. I would assume the power supply sold on Allied or RS should work just finie. As opposed to me hunting something else down somewhere.
Re: Raspberry pi as a Wake on Lan source
Correct. That's not safe. There is a chance that the SD card could become corrupted, making it impossible to reboot.rasprm3 wrote:What's the best way to power down a Raspberry Pi? I got the impression there's no off switch so you just unplug it. Doesn't quite sound safe though.
Opinions vary as to the 'best' way to stop the operating system before removing the power, but my choice is -
Code: Select all
sudo shutdown -h now
How To Ask Questions The Smart Way: http://www.catb.org/~esr/faqs/smart-questions.html
How to Report Bugs Effectively: http://www.chiark.greenend.org.uk/~sgtatham/bugs.html
How to Report Bugs Effectively: http://www.chiark.greenend.org.uk/~sgtatham/bugs.html
Re: Raspberry pi as a Wake on Lan source
I started a post over here, looking for the right SD card...
http://www.raspberrypi.org/phpBB3/viewt ... 26&t=31219
It's more work to find the SD card then it is to pick out a Pi or even generally plan the whole thing out.
http://www.raspberrypi.org/phpBB3/viewt ... 26&t=31219
It's more work to find the SD card then it is to pick out a Pi or even generally plan the whole thing out.
Re: Raspberry pi as a Wake on Lan source
I'm surprised and much more aware how static my schedule is. I'm setting a device to turn my computer on for my set schedule. And that idea works.
I was thinking.... It's probably possible, but not my project, to use GPS on a phone to detect when you're home. If you're home, the Raspberry Pi makes sure your computer is powered on. When you leave, it could power it down. Just an idea. I'm not interested in messing with that though. It does avoid the staticness of how I'm scheduling with this alarm clock idea.
I was thinking.... It's probably possible, but not my project, to use GPS on a phone to detect when you're home. If you're home, the Raspberry Pi makes sure your computer is powered on. When you leave, it could power it down. Just an idea. I'm not interested in messing with that though. It does avoid the staticness of how I'm scheduling with this alarm clock idea.
Re: Raspberry pi as a Wake on Lan source
I was wondering about this. For whatever SD card I get, I'll probably have resize the partition?
http://elsmorian.com/post/23366148056/b ... y-pi-setup
Or can I set it up initially to use all the available space?
http://elsmorian.com/post/23366148056/b ... y-pi-setup
Or can I set it up initially to use all the available space?
Re: Raspberry pi as a Wake on Lan source
Is there any advantage or disadvantage to the SD card size?
At least 2GB for the OS, so probably 4GB minimum to be safe, right?
But then... 8, 16, 32 GB? The only things I've found is that extra space can mean a faster write if you have something where that's an issue. And just having extra space if needed is nice.
If I have a choice between 8 and 16GB, is there really any difference?
At least 2GB for the OS, so probably 4GB minimum to be safe, right?
But then... 8, 16, 32 GB? The only things I've found is that extra space can mean a faster write if you have something where that's an issue. And just having extra space if needed is nice.
If I have a choice between 8 and 16GB, is there really any difference?
Re: Raspberry pi as a Wake on Lan source
Go for the biggest card you can comfortably afford. Don't take the chance of running out of space, and it's always good to have more in case you need it for another project later on 
Yes, you will have to resize the partition. The image is built to fit on the smallest feasible card it can. Resizing is easy, form the initial config menu, it just needs a reboot (when told to) and a bit of time to finish (your Pi will be usable after the reboot, but slow while it is performing the resize task in the background.
I used other methods to resize my cards, but I'm very familiar with *nix operating systems, especially the command line, having worked on them for nearly 20 years now. I actually use an old 16MB card for some testing
Your GPS driven alarm idea sounds like an interesting project. It would take some work though.

Yes, you will have to resize the partition. The image is built to fit on the smallest feasible card it can. Resizing is easy, form the initial config menu, it just needs a reboot (when told to) and a bit of time to finish (your Pi will be usable after the reboot, but slow while it is performing the resize task in the background.
I used other methods to resize my cards, but I'm very familiar with *nix operating systems, especially the command line, having worked on them for nearly 20 years now. I actually use an old 16MB card for some testing

Your GPS driven alarm idea sounds like an interesting project. It would take some work though.
Re: Raspberry pi as a Wake on Lan source
Ordered a Pi. 1 28 2013.
RS shuffled me over to Allied. They're back ordered. Now I have to wait.
I'll just get the rest of the stuff through Amazon sometime over the next month or so. No rush now.
RS shuffled me over to Allied. They're back ordered. Now I have to wait.
I'll just get the rest of the stuff through Amazon sometime over the next month or so. No rush now.
Re: Raspberry pi as a Wake on Lan source
Hmm. Another question....
I read the Raspberry Pi doesn't have its own real time clock.
Is it just a matter of connecting it to the network after its been powered off and then it will know the correct time/date?
The important question -- I was planning on leaving the raspberry pi on all the time. I would assume once it's got the time/date, it would keep it. I am planning on turning the router off though like I usually do. The raspberry pi will still keep its time/date, right? It's not completely relying on the router/network to find the time/date?
It looks like there are options for adding an RTC clock. More involved, but if I have to do that, that's the only way... Hopefully it will keep its time/date as long as its got power.
I read the Raspberry Pi doesn't have its own real time clock.
Is it just a matter of connecting it to the network after its been powered off and then it will know the correct time/date?
The important question -- I was planning on leaving the raspberry pi on all the time. I would assume once it's got the time/date, it would keep it. I am planning on turning the router off though like I usually do. The raspberry pi will still keep its time/date, right? It's not completely relying on the router/network to find the time/date?
It looks like there are options for adding an RTC clock. More involved, but if I have to do that, that's the only way... Hopefully it will keep its time/date as long as its got power.
Re: Raspberry pi as a Wake on Lan source
As long as the Pi has an internet connection it will automatically set its clock from one of the many NTP servers when it boots. If not, it will either use the last date/time it remembers, or default to 00:01 01 Jan 1970.
The realtime clock add-on is only really needed if running without an internet connection, or it can't connect to any of the NTP servers.
The realtime clock add-on is only really needed if running without an internet connection, or it can't connect to any of the NTP servers.
Re: Raspberry pi as a Wake on Lan source
Hey, hey. Pi Day... And my Raspberry Pi showed up.
Now I can get back to this project....


Now I can get back to this project....
Re: Raspberry pi as a Wake on Lan source
Dumb question time...
It's connected. Raspbian is installed. It's running.
I see two terminals, LXTerminal and Root Terminal.
On Ubuntu, I just typed in wakeonlan on the terminal and it asked if I wanted to install wakeonlan.
No luck here.
How do I get wakeonlan either installed or working if it is installed? I was just going to send a test wake on lan command. And then mess with settings up something on cron.
It's connected. Raspbian is installed. It's running.
I see two terminals, LXTerminal and Root Terminal.
On Ubuntu, I just typed in wakeonlan on the terminal and it asked if I wanted to install wakeonlan.
No luck here.

Re: Raspberry pi as a Wake on Lan source
On the Pi:
sudo apt-get update (just to make sure the software index is up to date)
sudo apt-get install wakeonlan
sudo apt-get update (just to make sure the software index is up to date)
sudo apt-get install wakeonlan
Re: Raspberry pi as a Wake on Lan source
It really helps when the other end of the Ethernet cable is plugged in too.
Rat's nest of Ethernet cables and the wrong one was plugged in. Someone helped discover that one. Duh...
I've got it updated and upgraded. Wake on lan is installed.
I expanded the partition (?) size when I first started it. And I redid the password so it's not the default anymore.
I need to test out wake on lan and then figure out cron jobs better.
And I know how to shut it down. sudo halt. I wish there was a little on switch though so it doesn't start up as soon as it's plugged in.

I've got it updated and upgraded. Wake on lan is installed.
I expanded the partition (?) size when I first started it. And I redid the password so it's not the default anymore.
I need to test out wake on lan and then figure out cron jobs better.
And I know how to shut it down. sudo halt. I wish there was a little on switch though so it doesn't start up as soon as it's plugged in.
Re: Raspberry pi as a Wake on Lan source
Dang....
wakeonlan macaddress
That's tells me the mac address I put in isn't a hardware address.
It's wakeonlan ver 0.41.
Maybe there's a different one I can use?
I want it to send a wake on lan magic packet to a Mac address. Hmm....
wakeonlan macaddress
That's tells me the mac address I put in isn't a hardware address.
It's wakeonlan ver 0.41.
Maybe there's a different one I can use?
I want it to send a wake on lan magic packet to a Mac address. Hmm....
Re: Raspberry pi as a Wake on Lan source
Did you use the command in the format:
wakeonlan aa:bb:cc:dd:ee:ff:gg
Where aa:bb:cc:dd:ee:ff:gg is the MAC/hardware address of the machine to wake?
I just did
wakeonlan aa:bb:cc:dd:ee:ff:gg
Where aa:bb:cc:dd:ee:ff:gg is the MAC/hardware address of the machine to wake?
I just did
Code: Select all
pi@raspi1:~$ wakeonlan 00:50:8d:51:40:41
Sending magic packet to 255.255.255.255:9 with 00:50:8d:51:40:41
Re: Raspberry pi as a Wake on Lan source
Freaking colons....
Oops. I just had wakeonlan 123456789 No colons in the Mac address. Duh on me. First time Linux user here....
Pi said it sent the magic packet. That test computer is waking up now. Works like it's supposed to. User ignorance.
Now it's just figuring out how to set a cron job. Later I'd like to set up Putty. I think. I was wondering if there would be any security concerns with it. If Putty opens anything up and I'm leaving the Pi on all the time connected to a router. (although that would be someone going through the router to the Pi and I've changed the Pi password now.) I can see needing to change the cronjob times when my schedule changes periodically.
Thanks for the wake solution there. Haha.
Oops. I just had wakeonlan 123456789 No colons in the Mac address. Duh on me. First time Linux user here....
Pi said it sent the magic packet. That test computer is waking up now. Works like it's supposed to. User ignorance.
Now it's just figuring out how to set a cron job. Later I'd like to set up Putty. I think. I was wondering if there would be any security concerns with it. If Putty opens anything up and I'm leaving the Pi on all the time connected to a router. (although that would be someone going through the router to the Pi and I've changed the Pi password now.) I can see needing to change the cronjob times when my schedule changes periodically.
Thanks for the wake solution there. Haha.
Re: Raspberry pi as a Wake on Lan source
All right. I'll cave. I've waited couple months and want to wrap this up.
I just need the cron part. I've got the format down now for wake on lan. And I can get in the terminal now. Haha.
I want a cron job for 6:00am weekdays, 5:00pm weekdays, and... say 10:00pm on weekdays/9:00pm on weekends. 10am Sat and Sun too.
And I'll need to be able to change that later.
How do I create a cron job?
How do I list the cron jobs?
How do I delete cron jobs? That sounds easiest. Deleted and recreate, considering it's just one line.
After the cron jobs are set up I can set up the Pi and forget about it.
I just need the cron part. I've got the format down now for wake on lan. And I can get in the terminal now. Haha.
I want a cron job for 6:00am weekdays, 5:00pm weekdays, and... say 10:00pm on weekdays/9:00pm on weekends. 10am Sat and Sun too.
And I'll need to be able to change that later.
How do I create a cron job?
How do I list the cron jobs?
How do I delete cron jobs? That sounds easiest. Deleted and recreate, considering it's just one line.
After the cron jobs are set up I can set up the Pi and forget about it.
Re: Raspberry pi as a Wake on Lan source
Add the following to the crontab for the user the jobs need to run as:rasprm3 wrote:All right. I'll cave. I've waited couple months and want to wrap this up.
I just need the cron part. I've got the format down now for wake on lan. And I can get in the terminal now. Haha.
I want a cron job for 6:00am weekdays, 5:00pm weekdays, and... say 10:00pm on weekdays/9:00pm on weekends. 10am Sat and Sun too.
Code: Select all
# 6am weekdays
0 6 * * mon-fri path-to-job1
# 5pm weekdays
0 17 * * mon-fri path-to-job2
# 10pm weekdays and 9pm weekends - needs two entries
0 22 * * mon-fri path-to-job3
0 21 * * sat,sun path-to-job3
# 10am Saturday and Sunday
0 10 * * sat,sun path-to-job4
crontab -eAnd I'll need to be able to change that later.
How do I create a cron job?
Then add a line as above
crontab -lHow do I list the cron jobs?
crontab -eHow do I delete cron jobs? That sounds easiest. Deleted and recreate, considering it's just one line.
and delete the line
YesAfter the cron jobs are set up I can set up the Pi and forget about it.

Re: Raspberry pi as a Wake on Lan source
Danke.
Instead of path to job, that would be the wakeonlan ab
ef:gh instead if I want it in the line and not a file?
Do I need a VI or VIM editor or is it all through the terminal command line? I was thinking it was using the terminal and typing in a line for each cron change. This one I'm not quite following...
crontab -e
and delete the line
It sounds like I can list them all and then go up and delete one.
Thanks for the help. I'll figure this out soon. It's not rocket science. I just haven't worked with it yet.
Instead of path to job, that would be the wakeonlan ab
Do I need a VI or VIM editor or is it all through the terminal command line? I was thinking it was using the terminal and typing in a line for each cron change. This one I'm not quite following...
crontab -e
and delete the line
It sounds like I can list them all and then go up and delete one.
Thanks for the help. I'll figure this out soon. It's not rocket science. I just haven't worked with it yet.
Re: Raspberry pi as a Wake on Lan source
Yes, but to be safe you should use the full path as cron doesn't load all the defaults that you get in the terminal, so that would be /usr/bin/wakeonlan abrasprm3 wrote:Instead of path to job, that would be the wakeonlan abef:gh instead if I want it in the line and not a file?
crontab -e will launch whichever is the default editor (vim or nano) with a copy of the current crontab. You can change that by setting the EDITOR= variable in the shell.Do I need a VI or VIM editor or is it all through the terminal command line?
There is a way to write the crontab to a file, which you can then edit however you like, and then use it to update the crontab. That is:
Code: Select all
crontab -l >mycronfile
# then edit mycronfile very carefully. Do not delete the comments at the top.
crontab <mycronfile
Re: Raspberry pi as a Wake on Lan source
http://www.tuxradar.com/content/text-ed ... -made-easy
GNU nano, if I need it for later.
Nano is the editor.
wakeonlan worked with the actual computer. I'm setting up cron now. I think I've got it. Just need a test....
GNU nano, if I need it for later.
Nano is the editor.
wakeonlan worked with the actual computer. I'm setting up cron now. I think I've got it. Just need a test....