[OBSOLETE] DSC -> EVL-3(4) -> Alarmserver -> Smartthings

My oh my these instructions are all over the map. I would like to install this on a windows computer that’s always on so it will interface with smartthings.

Beying on a Pi (which runs Linux) I would check capitalization. Linux is case sensitive for all and any words. Also spaces and puctuation marks. Compare what you have with what you had.
I run it on a Pi 3 wth no issues.

What version of python are you running on your Pi? I’m running 3.2.

@arch1tect Alarmserver requires 2.7. Raspbian Jessie has both.
This is the first line in devices.py #!/usr/bin/python2.7.
I believe I also read somewhere thai it does not work with pythom 3.x. I don’t know why.

I’m still on WHeezy so I guess I need to update my Pi and get python 2.7. Probably best to just start over with a clean install.

I’m having problem to get this working Daniel :frowning:
Screen installed fine but then all my fun ended

pi@rpixel:~ $ sudo systemctl enable screen@pi.service
Failed to execute operation: No such file or directory
pi@rpixel:~ $ sudo systemctl start screen@pi.service
Failed to start screen@pi.service: Unit screen@pi.service failed to load: No such file or directory.
pi@rpixel:~ $ sudo systemctl status screen@pi.service.
● screen@pi.service…service
Loaded: not-found (Reason: No such file or directory)
Active: inactive (dead)

I did all the steps you suggested:
alarmserver directory is located /home/pi/
renamed and edited screen@user.service to screen@pi.server and
it’s located in /lib/systemd/system

Unit]
Description=screen
After=multi-user.target network-online.target

[Service]
Type=idle
User=%i
ExecStart=/usr/bin/screen -DmS alarmserver /home/%i/alarmserver/alarmserver.py -c /home/%i/alarmserver/alarmserver.cfg
ExecStop=/usr/bin/screen -S alarmserver -X quit

[Install]
WantedBy=multi-user.target

I can start the alarmserver.py manually and it’s working fine

Any idea where I managed to screw up?

Thanks!

I would look for 2 things.

  1. Exact spelling for alarmserver directory. Linux is case sensitive for everything. for example, Alarmserver is not the same as alarmserver.
  2. When you login Pi you login as a user with a username. If you changed it from the default (pi) then you have to have alarmserver directory in that user’s location. If you located it in /home/pi/ then user is pi and you have to login as pi. The file screen@pi.service identifies the user as pi (following the @ sign). The variable defined inside as User=%i is reding the user name from the file name as the string that comes after @ sign and is using it to identify the proper directory in the ExecStart line. If you want to use whatever user name you like, then place alarmserver there and change the name of the file to screen@???.service (replace ???with the username (is that rpixel?)
    And don’t forget to run sudo systemctl enable screen@pi.service to create the proper link, then sudo systemctl daemonrestart to reread any changes and sudo systemctl start screen@pi.service.
    Run sudo systemctl status screen@pi.service. Should see loade and active. Restart Pi sudo reboot. And verify status again.
    Let me know the result.
1 Like

Thanks for your time Daniel!
Spelling is correct, double checked
I did not change user name, still pi

I will try all over again, using Raspbian Jessie Pixel installation without any changes
I did change the password and Hostname

EDIT:

Looks like I found some discrepancy that caused problem, while following the instructions
(and please understand that Iḿ like better trained monkey, copy/paste :slight_smile: )
I noticed that the renaming screen@user.service as described bellow is possibly incorrect:

n \home/pi create a directory alarmserver. Copy there all files from https://github.com/LXXero/DSCAlarm/tree/master/alarmserver14, except screen@user.service that goes to /lib/systemd/system. If you didn.t change default user, change name to screen@pi.server.

So I changed the screen@user.service to screen@pi.service instead of screen@pi.server
That got me a bit further but itś still not working.

If I start it manually itś working fine again

pi@raspberrypi:~ $ cd /home/pi/alarmserver
pi@raspberrypi:~/alarmserver $ python alarmserver.py
Using configuration file alarmserver.cfg
2017-01-29 08:18:57 Alarm Server Starting
2017-01-29 08:18:57 Currently Supporting Envisalink 2DS/3 only
2017-01-29 08:18:57 Tested on a DSC-1616 + EVL-3
2017-01-29 08:18:57 and on a DSC-1832 + EVL-2DS
2017-01-29 08:18:57 and on a DSC-1864 v4.6 + EVL-3

If you still have patience with me please see bellow
Thanks!

pi@raspberrypi:~ $ sudo apt-get install screen
Reading package lists… Done
Building dependency tree
Reading state information… Done
Suggested packages:
iselect screenie byobu
The following NEW packages will be installed:
screen
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 522 kB of archives.
After this operation, 854 kB of additional disk space will be used.
Get:1 http://mirrordirector.raspbian.org/raspbian/ jessie/main screen armhf 4.2.1-3+deb8u1 [522 kB]
Fetched 522 kB in 16s (32.0 kB/s)
Selecting previously unselected package screen.
(Reading database … 121836 files and directories currently installed.)
Preparing to unpack …/screen_4.2.1-3+deb8u1_armhf.deb …
Unpacking screen (4.2.1-3+deb8u1) …
Processing triggers for systemd (215-17+deb8u5) …
Processing triggers for man-db (2.7.0.2-5) …
Processing triggers for install-info (5.2.0.dfsg.1-6) …
Setting up screen (4.2.1-3+deb8u1) …
Processing triggers for systemd (215-17+deb8u5) …
pi@raspberrypi:~ $ sudo systemctl enable screen@pi.service
Failed to execute operation: No such file or directory
pi@raspberrypi:~ $ sudo systemctl enable screen@pi.service
Created symlink from /etc/systemd/system/multi-user.target.wants/screen@pi.service to /lib/systemd/system/screen@pi.service.
pi@raspberrypi:~ $ sudo systemctl start screen@pi.service
pi@raspberrypi:~ $ sudo systemctl status screen@pi.service
● screen@pi.service - screen
Loaded: loaded (/lib/systemd/system/screen@pi.service; enabled)
Active: failed (Result: exit-code) since Sun 2017-01-29 07:34:13 EST; 18s ago
Process: 18553 ExecStop=/usr/bin/screen -S alarmserver -X quit (code=exited, status=1/FAILURE)
Process: 18549 ExecStart=/usr/bin/screen -DmS alarmserver /home/%i/alarmserver/alarmserver.py -c /home/%i/alarmserver/alarmserver.cfg (code=exited, status=0/SUCCESS)
Main PID: 18549 (code=exited, status=0/SUCCESS)

Jan 29 07:34:13 raspberrypi systemd[1]: Starting screen…
Jan 29 07:34:13 raspberrypi systemd[1]: Started screen.
Jan 29 07:34:13 raspberrypi screen[18553]: No screen session found.
Jan 29 07:34:13 raspberrypi systemd[1]: screen@pi.service: control process e…1
Jan 29 07:34:13 raspberrypi systemd[1]: Unit screen@pi.service entered faile…
Hint: Some lines were ellipsized, use -l to show in full.
pi@raspberrypi:~ $

That would’ve been wrong. My bad It is screen@pi.service… Here is the exact content of my file.

[Unit]
Description=Alarm Daemon
After=multi-user.target network-online.target

[Service]
Type=idle
User=%i
ExecStart= /usr/bin/screen -DmS alrmserver /home/%i/Alarmserver/alarmserver.py -c /home/%i/Alarmserver/alarmserver.cfg
ExecStop=usr/bin/screen -S alarmserver -X quit

[Install]
WantedBy=multi-user.target

If you copy/paste it be aware that I capitalized Alarmserver directory. Changed it to what you have.
I also chaged permissions for all files in alarmserver directory to octal 777. If you use a windows machine it’s very easy with winscp WinSCP :: Official Site :: Download. Or use chmod -R 777 . while in that directory.

If it manually starts but not automatically it points me towards the startup sequence (too early in the process). That’s why I changed Type=idle.

1 Like

AWESOME! Looks like Iḿ up and running thanks to you!

pi@raspberrypi:~/alarmserver $ chmod -R 777 alarmserver.cfg
pi@raspberrypi:~/alarmserver $ chmod -R 777 alarmserver.py
pi@raspberrypi:~/alarmserver $ chmod -R 777 devices.py
pi@raspberrypi:~/alarmserver $ chmod -R 777 envisalindefs.py
chmod: cannot access ‘envisalindefs.py’: No such file or directory
pi@raspberrypi:~/alarmserver $ chmod -R 777 envisalinkdefs.py
pi@raspberrypi:~/alarmserver $ chmod -R 777 envisalinkdefs.pyc
pi@raspberrypi:~/alarmserver $ sudo systemctl enable screen@pi.service
pi@raspberrypi:~/alarmserver $ sudo systemctl start
Too few arguments.
pi@raspberrypi:~/alarmserver $ sudo systemctl start screen@pi.service
pi@raspberrypi:~/alarmserver $ sudo systemctl status screen@pi.service
● screen@pi.service - screen
Loaded: loaded (/lib/systemd/system/screen@pi.service; enabled)
Active: active (running) since Sun 2017-01-29 11:20:59 EST; 16s ago
Main PID: 2365 (screen)
CGroup: /system.slice/system-screen.slice/screen@pi.service
├─2365 /usr/bin/SCREEN -DmS alarmserver /home/pi/alarmserver/alarm…
└─2367 /usr/bin/python2.7 /home/pi/alarmserver/alarmserver.py -c /…

Jan 29 11:20:59 raspberrypi systemd[1]: Started screen.

Thank you very much for all the time you put in to this to help people!

That’s good news. Now go into smatthings mobile app and check it there.

1 Like

Yes, working perfect even after reboot :slight_smile:

1 Like

Châteauneuf-du-Pape ? :thumbsup:

I stil have 3 of these.

They need to be enjoyed not stored!

They are. But timing is everyting.

True!

One more question, is there way to trigger the PGM1 or 2 on the pannel via the smart app?

It is, but I didn’t look into it.
EVL allows for commands

You have to look into TPI manual for the exact command, then modify the panel app to put an extra button on screen to trigger it.

Yes, I use it there, I just thought that it would be nice to have it all in one place