schmupu / ioBroker.sia

SIA server for burglar alarm system

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Having trouble communicating via SIA

skitzo2000 opened this issue · comments

What encoding should messages be sent in? I'm attempting to recreate the SIA sending method via php. I'm sending the data as a string, but all I ever get in the log is: Required SIA fields missing

I've updated so that all messages now go to the log, the bit I'm confused on is how I should be sending the messages. I'm sending a plan text message: "<0x0a>D345003D"SIA-DCS"0001L0#5504[5004|Nri1HA1][Nri1HA1]_17:53:48,00-31-2019<0x0D>"

That is getting converted to a buffer, so I'm confused as to how line: 509 is supposed to work, "if (data && data[0] == 0x0a && data[len] == 0x0d)' As data[0] is in buffer and reflects: 10 in my use case.

I will take a look. Can you send me your message in a file as attachment?

The SIA protocol is confusing. You can find an emulator here and the SIA specification here.
Every SIA message starts with LF and ends with CR in binary value (0x0A and 0x0D).
Lupusec sends the CRC unfortunatly as binary and not in ASCII. The CRC calculation is a litte bit confusing. Maybe you find some some examples for crc16 calculation in php. Maybe this works:
https://stackoverflow.com/questions/14018508/how-to-calculate-crc16-in-php

could you please try it again. In version 1.0.1 I did an update. Maybe it helped

fixed the error in Version 1.0.1. Unfortunately the alarm systems send the CRC in two different ways:

  • 0xABCD (like Lupusec alarm system)
  • ABCD (like your systems does)

the version 1.0.1 can handle both version.
Please test the version and give me a feedback.