Go to advanced search

by RDK
Tue May 31, 2016 6:24 pm
Forum: Python
Topic: Detect a shutdown event in Python
Replies: 21
Views: 7508

Re: Detect a shutdown event in Python

My work-around is to open and close the files for each access. This is ok, but not elegant which is why I wanted to learn about SIGNAL and event processing. As I noted in my original posting "kill -15 <pid>" does work and is trapped by my code. Not often, but occasionally my program hangs, hence the...
by RDK
Tue May 31, 2016 5:38 pm
Forum: Python
Topic: Detect a shutdown event in Python
Replies: 21
Views: 7508

Re: Detect a shutdown event in Python

OK, I added the following code: signals = { signal.SIGABRT: 'signal.SIGABRT', signal.SIGALRM: 'signal.SIGALRM', signal.SIGBUS: 'signal.SIGBUS', signal.SIGCHLD: 'signal.SIGCHLD', signal.SIGCONT: 'signal.SIGCONT', signal.SIGFPE: 'signal.SIGFPE', signal.SIGHUP: 'signal.SIGHUP', signal.SIGILL: 'signal.S...
by RDK
Tue May 31, 2016 4:07 pm
Forum: Python
Topic: Detect a shutdown event in Python
Replies: 21
Views: 7508

Re: Detect a shutdown event in Python

OK, how does one go about trapping "every" signal/event?....RDK
by RDK
Tue May 31, 2016 3:09 pm
Forum: Python
Topic: Detect a shutdown event in Python
Replies: 21
Views: 7508

Re: Detect a shutdown event in Python

OK, I tried adding these to my test program signal.signal(signal.SIGHUP,CloseAll) signal.signal(signal.SIGCHLD,CloseAll) signal.signal(signal.SIGALRM,CloseAll) , with no positive results. The other signal options do not seem appropriate? Perhaps I should say no consistent results , every now and aga...
by RDK
Tue May 31, 2016 5:39 am
Forum: Python
Topic: Detect a shutdown event in Python
Replies: 21
Views: 7508

Detect a shutdown event in Python

I posted this question on another forum without success, perhaps someone here can help me? I'm running a Raspberry Pi v2 with Jessy. Is there a way from a Python program to detect that a "shutdown" or "restart" event has been initiated? I have a Python program which runs 24x7 in a Screen session win...
by RDK
Sun May 22, 2016 4:33 am
Forum: Beginners
Topic: last reboot command shows wrong date
Replies: 17
Views: 4352

Re: last reboot command shows wrong date

OK, I can buy into these explanations, but then why is wheezy showing the right times?

Regardless,

Code: Select all

uptime
gives me the info I wanted. Thanks.....RDK
by RDK
Sat May 21, 2016 4:53 am
Forum: Beginners
Topic: last reboot command shows wrong date
Replies: 17
Views: 4352

Re: last reboot command shows wrong date

OK, it appears that many of us are seeing this problem and agree that it is not correct. So what do we do about it? Is it a bug in Jessie or do I have to add/change something?

Thanks....RDK
by RDK
Thu May 19, 2016 5:26 pm
Forum: Beginners
Topic: last reboot command shows wrong date
Replies: 17
Views: 4352

Re: last reboot command shows wrong date

Interesting, I just looked at my Raspberry Pi B+ and the dates shown by the "last reboot" are correct. Is this an issue with the Raspberry Pi v2 and/or Jessie?...RDK
by RDK
Thu May 19, 2016 4:47 am
Forum: Beginners
Topic: last reboot command shows wrong date
Replies: 17
Views: 4352

Re: last reboot command shows wrong date

OK. How do I check this out and if necessary "install" a real time clock?.....RDK
by RDK
Wed May 18, 2016 3:08 pm
Forum: Beginners
Topic: last reboot command shows wrong date
Replies: 17
Views: 4352

last reboot command shows wrong date

I have a cron job which reboots my Raspberry Pi v2 (Jessie) every night a 11:59 pm (59 23 * * * /sbin/shutdown -r 2 ). That seems to be working. However when I run last reboot or who -b to check, I always see Jan 1 as the date: xx:~ $ last reboot ....more lines edited out... reboot system boot 4.1.1...
by RDK
Sat May 14, 2016 4:38 pm
Forum: Beginners
Topic: Using GPIO on Pi B+
Replies: 4
Views: 1236

Re: Using GPIO on Pi B+

Oops. I did not mean to say I was going to do
sudo apt-get dist-upgrade
. I want to keep this unit on Wheezy for the time being.

WiringPi installed successfully this time. Thanks to all.....RDK
by RDK
Sat May 14, 2016 4:05 pm
Forum: Beginners
Topic: Using GPIO on Pi B+
Replies: 4
Views: 1236

Re: Using GPIO on Pi B+

OK, I ran the install command and got the following error: $ sudo apt-get install wiringpi Reading package lists... Done Building dependency tree Reading state information... Done Package wiringpi is not available, but is referred to by another package. This may mean that the package is missing, has...
by RDK
Sat May 14, 2016 3:37 pm
Forum: Beginners
Topic: Using GPIO on Pi B+
Replies: 4
Views: 1236

Using GPIO on Pi B+

I've been experimenting with GPIO on a Raspberry Pi v2. Both Python code and command line commands are working. I just tried to do this on one of my Raspberry Pi B+ units and have run into a problem. My simple Python program runs and does not give any errors, however when I try to run "sudo gpio rea...
by RDK
Thu May 12, 2016 4:34 pm
Forum: Windows 10 for IoT
Topic: What is the path to GPIO?
Replies: 8
Views: 4324

Re: What is the path to GPIO?

Marcus.....OK, thanks for your comments. I'm VERY new to the idea of using the GPOI pins on my Raspberry Pi v2. I could have started with a simple LED project, but as I had this 2 channel relay here I decided to try to do something which might eventually be useful. At time zero, ie boot up, I want t...
by RDK
Thu May 12, 2016 4:58 am
Forum: Windows 10 for IoT
Topic: What is the path to GPIO?
Replies: 8
Views: 4324

Re: What is the path to GPIO?

Thanks, that worked.....RDK
by RDK
Wed May 11, 2016 5:27 pm
Forum: Windows 10 for IoT
Topic: What is the path to GPIO?
Replies: 8
Views: 4324

What is the path to GPIO?

I'm setting up a 2 channel relay using the GPIO pins 5 and 6. I have a working Python program which turns those pins on and off and is successfully controlling the relay. In reading the web about GPIO settings, I have discovered that the pin settings at "time zero", ie boot up, are not always the sa...
by RDK
Wed May 11, 2016 5:07 pm
Forum: Beginners
Topic: sudo apt-get upgrade interrupted - now won't boot correctly
Replies: 8
Views: 2108

Re: sudo apt-get upgrade interrupted - now won't boot correc

ok, I did have a backup, several months old, but as this Pi was on the shelf being ignored since then, it was recent enough for me to recover the work from the past week or so. It is a Jessie image upgraded from a NOOBS Wheezy image. I will look at the Raspi-Config to see if it can be expanded. Prev...
by RDK
Tue May 10, 2016 12:46 pm
Forum: Beginners
Topic: sudo apt-get upgrade interrupted - now won't boot correctly
Replies: 8
Views: 2108

Re: sudo apt-get upgrade interrupted - now won't boot correc

I did nothing to the SD card before running the Update sequence. It is a 16 GB card, which should be plenty large enough. However, the interrupt was not initialed by the Pi, it was my fault. I was using Putty and reviewing the progress when it asked about changing a "...RULES..." file. I should have...
by RDK
Tue May 10, 2016 8:51 am
Forum: Beginners
Topic: sudo apt-get upgrade interrupted - now won't boot correctly
Replies: 8
Views: 2108

sudo apt-get upgrade interrupted - now won't boot correctly

Folks....Raspberry Pi 2 running Jessie I was doing a sudo apt-get upgrade when the process was interrupted which returned me to a command prompt. When I rebooted the console log shows several "Failed" messages and it would appear that the rc.local is not being processed nor the networks file. Here a...
by RDK
Sat Feb 13, 2016 12:39 am
Forum: Beginners
Topic: How to detect corrupted file system
Replies: 5
Views: 1183

Re: How to detect corrupted file system

I guess I need to be a little more specific. First off I'm a novice when it comes to Linux. My Raspberry Pi's (a B+ and a V2) are running headless, so I do not get to see the information displayed on the console during boot-up. My Pi's are running Wheezy with a standard SD card (8 GB) and a 16 GB US...
by RDK
Thu Feb 04, 2016 5:59 pm
Forum: Beginners
Topic: How to detect corrupted file system
Replies: 5
Views: 1183

Re: How to detect corrupted file system

OK, I will read up on fsck, but as I recall it is only good for Linux file systems. I'm sure my USB memory stick is FAT or FAT32.

Thanks....RDK
by RDK
Thu Feb 04, 2016 1:32 pm
Forum: Beginners
Topic: How to detect corrupted file system
Replies: 5
Views: 1183

How to detect corrupted file system

Is there a simple command which will tell me if any part of the SD's file system or my USB stick's (auto-mounted) has been corrupted by a "non-graceful" shutdown? With Wheezy and attached to a monitor I could usually see the error or warning messages on the screen, but not so from PUTTY. With Jessie...
by RDK
Mon Feb 01, 2016 10:44 pm
Forum: Beginners
Topic: Pi as wireless bridge?
Replies: 81
Views: 151247

Re: Pi as wireless bridge?

Hi. Just got around to trying this as I have an application for a wireless bridge. No happiness here. I tried the "wait for network..." option in the Raspi-Config and the sleep 10 option in the rc.local (along with the other two commands). In both cases I get "can't add wlan 0 to bridge br0: operati...
by RDK
Fri Jan 15, 2016 6:35 pm
Forum: Beginners
Topic: Pi as wireless bridge?
Replies: 81
Views: 151247

Re: Pi as wireless bridge?

Which distro are you using Wheezy or Jessie? Did you install the bridge-utils ? Thanks....RDK
by RDK
Fri Jan 15, 2016 5:56 pm
Forum: Beginners
Topic: Pi B+ SD in Pi V2 - will it work?
Replies: 1
Views: 326

Pi B+ SD in Pi V2 - will it work?

I have a working SD card in a Raspberry Pi B+ and I'm wondering if I can simply plug it into my Raspberry Pi V2 and expect it to work? That SD card is from the Wheezie distribution and is fully updated. apt-get update / apt-get upgrade... And, will the reverse work for a Jessie SD card from the Rasp...

Go to advanced search