User Tools

Site Tools


acdsn:acdsn-v-fx

This is an old revision of the document!


ACDSN-V-FX

The following line shows how to address and communicate with a NiX1 slave over a RS485 line.

 2700000000000000Qw3
 ^               ^^^
 |               |||
 |               ||- option
 |               |-- argument
 |               --- command
 ---- address

Addresses

Label Address Comment
scratch 270000000000005C This is the scratch address used to configure new slave
broadcast 27FFFFFFFFFFFF4E This is the broadcast address

Commands

Label Command
delete D
new N
query Q

Arguments

Delete

Label Arguments Options Comments
format a
copy file c <filename>/t<copyFilename>
delete file g <filename>
restart s
delete unit u if option set to 0, delete file

New

Label Arguments Options Comments
new Check c
new Entry e <nb request>
new file g <filename>\t<filesize>\t<CRC>
new Vault Status h <unit>\t<status> ouverture(1) / fermeture(0)
new firmware version n <filename>\t<retry times>
new general status s <value> set value in NiX general status
new timestamp t <timestamp>\t<TZ> only if RTC defined (used to synchronize clock)(date +%s)
new unit u <unit>\t<CH>\t<staytime>
new baudrate z <baudrate>

Query

Label Arguments Options Comments
query entry e receive status lock (client ouverture)
query file g <filename>\t<limit>
query vault status h <unit> Receive: <VaultStatus>
query extension i <extension> give a list of files with the extension desired (TXT,1, …)
query firmware version n
query Checksum p <filename>
query Remaining time r <unit>
query general status s
query timestamp t only if RTC is defined
query unit u <CH>Receive : <unit><staytime>
query init state x   Receive: <initState><ChecksumInit>

Options

Options Comments
<filename> filename (format : 88888888.333)
<copyFilename> filename destination
<CH>  channel of the lock hardware (1 to 48)
<unit> N° de coffre de la banque 1-65536
<filesize> size of the file
<CRC> CRC of the file
<retry times> number of retry times
<timestamp> 0 to 9'999'999'999 [seconds since 1.1.1970]
<TZ> -1200 to +1400
<staytime> delay for the time to stay open
<VaultStatus> voir table de vérité
<stateInit> envoi de tous les coffres avec un status différent de 0 (masque codé en ASCII HEXA)
<checksumInit> checksum de l'envoi du state

Table de vérité Vault Status

Client Banque Ouverture
0 0 0 0 fermé
1 0 0 1 porte ouverte, verrous fermés
2 0 1 0 déverrouillage banque
3 0 1 1 porte mal fermée
4 1 0 0 fermé
5 1 0 1 porte ouverte, verrouillage banque
6 1 1 0 verrous déverrouillés
7 1 1 1 porte ouverte

Return Code (HEX)

Code Transmission Functions
00 OK
04 EOT
06 ACK
15 NAK
16 SYN
21 ERROR_ADDRESS
41 ERROR_ARG
42 ERROR_BUS
43 ERROR_CMD ERROR_CREDENTIAL
44 ERROR_DATA (iC)
46 ERROR_FLASH
47 ERROR_CRC
48    ERROR_HASH
49 ERROR_IB
4B ERROR_KEY
4C ERROR_LOG
4D ERROR_MALLOC 
4E ERROR_NOT_FOUND
4F ERROR_OFFSET
50 ERROR_PARAM
51 ERROR_QUANTITY
52 ERROR_RXDATA
53 ERROR_STATE
54 ERROR_TYPE
55 ERROR_USER
57 ERROR_WRITE
58 ERROR_X
60 ERROR_SYNTAX
61 ERROR_DAY_OF_YEAR
63 ERROR_COPY
64 ERROR_DIAG
65 ERROR_EMPTY_MISSION (iC)
6C ERROR_LOCK
69 ERROR_I2CREAD
77 ERROR_I2CWRITE
70 ERROR_PULSE
72 ERROR_RESOLUTION (sC)
73 ERROR_SCHEDULE
76 ERROR_UNIT
74 ERROR_TIMESTAMP
7B ERROR_SDCARDNOTFOUND
FF ERROR_INT

Configuration Files (Server)

The configuration files are flat text file where each fields are separated by a tabulation.

units.txt

Provides a link beetween the unit id and a human readable label.

Field Name Description Example
id The unique identifier of the unit, as used in slaves.conf 2
label A human description of the unit Main Office
demo_units.txt
1       Reception
2       Main Office
3       CEO's Office

Configuration Files (Micro-SD)

These files can be found on the Micro-SD of a NiX.

units.txt

This file contains the lock number from the CH number. And the delay to stay open the vault.

Field Name Description Example
unit The vault number 324
CH Channel number (1 to 48) 34
 staytime  The delay to stay open the vault (minutes) 10
units.txt
324     34     10
425     35      9

ACCESS.#

This file contains important logs. (# is the extension of day of year)

Field Name Description Example
slave address SID of NiX 271A2100000000F3
CH The CH number 324
lock lock identification 15
timestamp The timestamp of the NiX 1400620011
timezone Code of the timezone +0100
vaultStatus table de vérité correspondant au status 4
error code Error code in hex format 39
ACCESS.#
271A2100000000F3	324	15		1436413339	+0100	0	55
271A2100000000F3	356	15		1436413340	+0100	4	55
271A2100000000F3	73	9		1436413341	+0100	0	55
271A2100000000F3	556	15		1436413345	+0100	6	55

ACTIVITY.#

This file contains not important iButtons discharge logs. (# is the extension of day of year)

First line:

Field Name Description Example
timestamp The timestamp of the time when the NiX start 1400578529
slave address SID of NiX 271A2100000000F3
general status Last general status of NiX before the start (in hex format) 00
other info  information about the error 86

After:

Field Name Description Example
slave address SID of NiX 271A2100000000F3
unit The vault number 324
CH Channel number (1 to 48) 34
timestamp The timestamp of the NiX 1400620011
timezone Code of the timezone +0100
 cmd command sent (0 or 1 or 2) 0 (clear), 1 (set), 2 (clear by timeout)
error code Error code in hex format 39
ACTIVITY.#
1436413328	Slave ID: 271A2100000000F3	General status: 00
271A2100000000F3	324	15		1436413339	+0100	0	55
271A2100000000F3	356	15		1436413340	+0100	1	49
271A2100000000F3	73	9		1436413341	+0100	2	55
271A2100000000F3	556	15		1436413345	+0100	1	40
1436413328	Slave ID: 271A2100000000F3	General status: 70 | 86

CONFIG.TXT

This file contains the minimal configuration with which the NiX cans run autonomously.

CONFIG.TXT
BAUDRATE	9600
TIMEZONE	+0100

Signals

List of used signals:

Name Hex Bash Dec
EOT 0x04 \x04 4
ACK  0x06 \x06 6
NAK 0x15 \0x15 21
SYN 0x16 \0x16 22

Use cases + example:

  1. Query sended to the NiX1:
    SYN + Query + EOT:
    \x1627D518320000007EQn\x4
  2. Answer from the NiX1 to a Query:
    Return code + EOT:
    \x0\x4
  3. Answer from the NiX1 to a sucessful New or Delete:
    ACK + EOT:
    \x6\x4
  4. Answer from the NiX1 to a failed New or Delete:
    NAK + Return code + EOT:
    \x15\x76\x4
  5. Answer from the NiX1 to a bad/misunderstood message (Query, New or Delete):
    NAK + Return code + EOT:
    \x15\x43\x4
  6. Broadcast: NiX1 is quiet:
    No Answer!
  7. Bad NiX1 address: no one answers:
    No Answer!
acdsn/acdsn-v-fx.1514454715.txt.gz · Last modified: 2017/12/28 09:51 by aheritier