Go to advanced search

by RDK
Tue Jul 19, 2016 7:01 pm
Forum: Automation, sensing and robotics
Topic: Using a Pi to Log Data in a Magnum Energy System
Replies: 122
Views: 51671

Re: Using a Pi to Log Data in a Magnum Energy System

Paul...Well, I'm back in France after 3 weeks with my family and friends in Colorado and Wyoming. While at my son's cabin I captured several sequences of traffic between the MagWeb unit and the Magnum server. So far I'm at a brick wall to decode it all. I have found the inverter section but so far c...
by RDK
Wed Jul 13, 2016 12:22 am
Forum: Automation, sensing and robotics
Topic: Using a Pi to Log Data in a Magnum Energy System
Replies: 122
Views: 51671

Re: Using a Pi to Log Data in a Magnum Energy System

Paul..Thanks for the reply and yes, I am RDK45!!! The technique you are emulating is NOT the same as I wish to use. I have experience using a Raspberry Pi as an Internet bridge, that is a device which spies on traffic passing through it. In practice, I have the Pi attached to the internet (actually ...
by RDK
Tue Jul 05, 2016 10:25 pm
Forum: Automation, sensing and robotics
Topic: Using a Pi to Log Data in a Magnum Energy System
Replies: 122
Views: 51671

Re: Using a Pi to Log Data in a Magnum Energy System

Guys.....Really got my juices flowing as I read this thread. My son has MS4448PAE inverter and ME-BMK battery monitor at his "off grid" cabin. Oddly, even though it is truly "off-grid" he has a way to get internet services. Thus, he also has the MagWeb Monitoring Kit (ME-MW-E) so he can check out th...
by RDK
Sun Jun 05, 2016 8:10 am
Forum: Python
Topic: Detect a shutdown event in Python
Replies: 21
Views: 8197

Re: Detect a shutdown event in Python

Ok, I have completed my tests with my Pi's: v2 with Jessie and B+ with Wheezy. I modified my program from shown above to trap the following events: SIG name = SIGTSTP; SIG number = 20 SIG name = SIGTTIN; SIG number = 21 SIG name = SIGTTOU; SIG number = 22 SIG name = SIGURG; SIG number = 23 SIG name ...
by RDK
Wed Jun 01, 2016 4:11 pm
Forum: Python
Topic: Detect a shutdown event in Python
Replies: 21
Views: 8197

Re: Detect a shutdown event in Python

Thanks guys, you are great!!! I have to get onto some other things I have let lapse while I was playing with this problem. I will try your ideas out this weekend on this Raspberry Pi v2 and an older B+ (not sure if it is Wheezy or Jessie?).

Anyway, thanks for all of these ideas and efforts......RDK
by RDK
Wed Jun 01, 2016 1:40 pm
Forum: Python
Topic: Detect a shutdown event in Python
Replies: 21
Views: 8197

Re: Detect a shutdown event in Python

I'm throwing in the towel for a while. I tried a few modifications to my code, paralleling some of your code, but I still am not seeing the expected results. I'll get back to this when I get my new Raspberry Pi v2. By the way, what happens if an event occurs during a "sleep()" period. I would hope t...
by RDK
Wed Jun 01, 2016 11:37 am
Forum: Python
Topic: Detect a shutdown event in Python
Replies: 21
Views: 8197

Re: Detect a shutdown event in Python

WELL!!! Looks like there is something wrong with my code. Here is the output I got from your code: 3:30:26: Caught signal 15, ignoring. 13:30:26: Caught signal 18, ignoring. 13:30:26: Caught signal 15, ignoring. 13:30:26: Caught signal 1, ignoring. 13:30:26: Caught signal 1, ignoring. 13:30:26: Cau...
by RDK
Wed Jun 01, 2016 9:56 am
Forum: Python
Topic: Detect a shutdown event in Python
Replies: 21
Views: 8197

Re: Detect a shutdown event in Python

Well, I'm confused! My Raspberry Pi v2 does have the PiModules http://www.pimodules.com/ UPS PIco HAT module installed. I wonder if it or their software is doing something? Two things come to mind for next steps: In a couple weeks I will have another Raspberry Pi v2 and I can try some of these ideas...
by RDK
Tue May 31, 2016 6:24 pm
Forum: Python
Topic: Detect a shutdown event in Python
Replies: 21
Views: 8197

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: 8197

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: 8197

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: 8197

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: 8197

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: 4780

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: 4780

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: 4780

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: 4780

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: 4780

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: 1313

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: 1313

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: 1313

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: 4647

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: 4647

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: 4647

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: 2300

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...

Go to advanced search