Data logging for Elk M1

AnotherOne

Active Member
I've been trying to figure out how to track when people come in and out of the house and after talking to one of my web programming friends, he pointed me to a simple example written in Python that allows me to open the non-secured ethernet port and log all the data. Python is free from the download site and seems pretty easy to use.

Here's a simple module to read all the data and time stamp it:

#python module to read Elk M1 data over non-secure ethernet port

import socket
from time import localtime, strftime
import datetime

mySocket = socket.socket ( socket.AF_INET, socket.SOCK_STREAM )

# connect to the socket 'IP Address', port
# CHANGE IP ADDRESS

mySocket.connect ( ( '192.168.254.6', 2101 ) )

while 1 : #loop forever

data = mySocket.recv (220)
print (strftime("%a %d %b %Y %H:%M:%S", localtime()), data)

mySocket.close()

Which yields data like this:

('Wed 08 Nov 2006 08:41:48', '16XK2341084081106010006F')
('Wed 08 Nov 2006 08:41:48', '\r\n')
('Wed 08 Nov 2006 08:42:08', '0AZC040900C5\r\n')
('Wed 08 Nov 2006 08:42:10', '0AZC040200CC\r\n')

My full blown python module logs everything to both a file and displays it in a Windows XP command window (this will run on linux, etc as well) like this:

Wed 08 Nov 2006 09:59:51 Temp Mudroom 68
Wed 08 Nov 2006 10:00:01 Temp Outside Sensor 48
Wed 08 Nov 2006 10:00:06 Temp Basement 69
Wed 08 Nov 2006 10:00:27 Zone Kitchen Motion Violated
Wed 08 Nov 2006 10:00:30 Zone Kitchen Motion Normal
Wed 08 Nov 2006 10:00:32 Zone Dine Hall Motion Violated
Wed 08 Nov 2006 10:00:33 Zone Dine Hall Motion Normal

If you'd like a copy of the full blown logger, it's about 350 lines. Send me an email to first name: fred last name: hillen.
Email is firstname.lastname at gmail.com and you can modify it to your hearts content. By the way, it should be able to change this to work with the serial port as well, but you have to do reads instead of receives.
 
This is great, I was about to start writing a linux based php/perl script to communicate with the M1, but pyhton is great as well. I am hoping to run this on a WRT54GL router, thanks for posting this!
 
Hi all, long time lurker and first time poster here.
I realise this is an old thread but I was hoping someone could help me out.
 
I wrote something similar to log data sent via the M1EXP  but the data stream from the M1 always stops at HH:59 - the socket is still open but no further data is received. It's always at 59 minutes past the hour and can run anywhere from an hour to 24 hours at a time. 
 
Some specs:
  - M1 Gold version: 5.3.10
  - M1EXP version: 2.0.42
  - Python script is running on a Raspberry Pi
 
Thanks,
 
Mark :)
 
New to the Elk M1. I am looking for an all-events log. A former system had one called ACTIVITY that listed date and time each door/window/sensor was opened or closed. I see the activity live on the ekeypad app but it does not get saved anywhere. Is there a way to create such a log within ElkRP? A third party? This thread is OLD and I hope by now there is a solution to this issue. Thanks!
 
Sorry jovan1320, I can't help you.
Just an update on my list though. The issue was caused by my local network (M1 is located on a remote network). Our ISP has been doing some works in our area and our network isn't as stable as I'd like.
Updating code to run on the remote RPi has fixed my connectivity issues.
 
Back
Top