TPI help please: netcat + bash script + tasker oh my!
Posted: Thu May 01, 2014 2:55 pm
Ok, I wanted to post for help here since this isn't really a question about the TPI documentation, as it is a plea for help on understanding it (Please forgive my ignorance). I've been working in the IT industry for most of my life (professional and non-professional) but programming has never been my forte, so I have a few questions, or maybe I can state what I'm trying to do and someone can help me. (FYI, I just installed a DSC system)
Basically, what I'm wanting to do is, on my phone, tasker (a wonderful automation utility for android phones) will fire up an SSH session to my home computer (using a widget or a shortcut or automatically) run a script and using netcat, login, get status information/arm system/disarm/etc, then capture the output into a variable, split that variable until I get the info I need then update a widget/icon on my phone depending on what the status is.
I have managed to get login and system status working (001), but only by using another android app and doing packet captures from the device to the envisalink to see what the checksums are for the commands I need to run)
for example, here is my script for linux:
and my command line is
I've found that works great for getting status, problem is, I'm having difficulty understanding the command syntax, specifically, the checksums. I don't quite understand how those are calculated. Looking at the example in the documentation, I don't quite understand the formula. Under 3.1 on the documentation, it says 36 + 35 + 34 +33 = D2 (or 44 32 in ascii), and I can look at the ASCII table and see that 44=D. I can even understand why the command 001 has a checksum of 91 ( ascii codes 30 30 31=91) If someone could give me an example on how to get that info, or is there something I'm missing? I'm assuming it has to do with the "nibble" thing, but I'm not sure how to do the conversion, even after googling a "nibble"
Basically, what I'm wanting to do is, on my phone, tasker (a wonderful automation utility for android phones) will fire up an SSH session to my home computer (using a widget or a shortcut or automatically) run a script and using netcat, login, get status information/arm system/disarm/etc, then capture the output into a variable, split that variable until I get the info I need then update a widget/icon on my phone depending on what the status is.
I have managed to get login and system status working (001), but only by using another android app and doing packet captures from the device to the envisalink to see what the checksums are for the commands I need to run)
for example, here is my script for linux:
Code: Select all
#!/bin/bash
sleep 1
echo -e -n '005password+checksum\r\n'
sleep 1
echo -e -n '00191\r\n'
Code: Select all
./test.sh | nc IPADDRESS 4025