mirror of
https://github.com/Utyff/Zintercom.git
synced 2026-01-13 01:37:43 +03:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e98969e3c5 | ||
|
|
a3ec8d06b0 | ||
|
|
66869f7d0c | ||
|
|
db6995dc7b | ||
|
|
7994aead0c | ||
|
|
5de49cbeae | ||
|
|
6255791281 | ||
|
|
a872b42ff1 | ||
|
|
b2d9a718a4 | ||
|
|
21106958c5 |
@@ -142,11 +142,11 @@
|
|||||||
<option>
|
<option>
|
||||||
<name>Input variant</name>
|
<name>Input variant</name>
|
||||||
<version>2</version>
|
<version>2</version>
|
||||||
<state>0</state>
|
<state>5</state>
|
||||||
</option>
|
</option>
|
||||||
<option>
|
<option>
|
||||||
<name>Input description</name>
|
<name>Input description</name>
|
||||||
<state>Automatic choice of formatter.</state>
|
<state>No float.</state>
|
||||||
</option>
|
</option>
|
||||||
<option>
|
<option>
|
||||||
<name>Output variant</name>
|
<name>Output variant</name>
|
||||||
@@ -1284,11 +1284,11 @@
|
|||||||
<option>
|
<option>
|
||||||
<name>Input variant</name>
|
<name>Input variant</name>
|
||||||
<version>2</version>
|
<version>2</version>
|
||||||
<state>0</state>
|
<state>5</state>
|
||||||
</option>
|
</option>
|
||||||
<option>
|
<option>
|
||||||
<name>Input description</name>
|
<name>Input description</name>
|
||||||
<state>Automatic choice of formatter.</state>
|
<state>No float.</state>
|
||||||
</option>
|
</option>
|
||||||
<option>
|
<option>
|
||||||
<name>Output variant</name>
|
<name>Output variant</name>
|
||||||
@@ -1604,7 +1604,7 @@
|
|||||||
<option>
|
<option>
|
||||||
<name>Compiler Extra Options Edit</name>
|
<name>Compiler Extra Options Edit</name>
|
||||||
<state>-f $PROJ_DIR$\..\..\..\Tools\CC2530DB\f8wRouter.cfg</state>
|
<state>-f $PROJ_DIR$\..\..\..\Tools\CC2530DB\f8wRouter.cfg</state>
|
||||||
<state>-f $PROJ_DIR$\..\..\..\Tools\CC2530DB\f8wConfig.cfg</state>
|
<state>-f $PROJ_DIR$\..\zstack-lib\f8wConfig.cfg</state>
|
||||||
<state>-f $PROJ_DIR$\..\..\..\Tools\CC2530DB\f8wZCL.cfg</state>
|
<state>-f $PROJ_DIR$\..\..\..\Tools\CC2530DB\f8wZCL.cfg</state>
|
||||||
</option>
|
</option>
|
||||||
<option>
|
<option>
|
||||||
@@ -3704,7 +3704,7 @@
|
|||||||
</option>
|
</option>
|
||||||
<option>
|
<option>
|
||||||
<name>OGChipConfigPath</name>
|
<name>OGChipConfigPath</name>
|
||||||
<state>$TOOLKIT_DIR$\config\devices\Texas Instruments\CC2530F256.i51</state>
|
<state>$TOOLKIT_DIR$\config\devices\Texas Instruments\CC25xx\3x\CC2530F256.i51</state>
|
||||||
</option>
|
</option>
|
||||||
</data>
|
</data>
|
||||||
</settings>
|
</settings>
|
||||||
@@ -3887,7 +3887,7 @@
|
|||||||
<option>
|
<option>
|
||||||
<name>Compiler Extra Options Edit</name>
|
<name>Compiler Extra Options Edit</name>
|
||||||
<state>-f $PROJ_DIR$\..\..\..\Tools\CC2530DB\f8wRouter.cfg</state>
|
<state>-f $PROJ_DIR$\..\..\..\Tools\CC2530DB\f8wRouter.cfg</state>
|
||||||
<state>-f $PROJ_DIR$\..\..\..\Tools\CC2530DB\f8wConfig.cfg</state>
|
<state>-f $PROJ_DIR$\..\zstack-lib\f8wConfig.cfg</state>
|
||||||
<state>-f $PROJ_DIR$\..\..\..\Tools\CC2530DB\f8wZCL.cfg</state>
|
<state>-f $PROJ_DIR$\..\..\..\Tools\CC2530DB\f8wZCL.cfg</state>
|
||||||
</option>
|
</option>
|
||||||
<option>
|
<option>
|
||||||
@@ -5989,7 +5989,7 @@
|
|||||||
</option>
|
</option>
|
||||||
<option>
|
<option>
|
||||||
<name>OGChipConfigPath</name>
|
<name>OGChipConfigPath</name>
|
||||||
<state>$TOOLKIT_DIR$\config\devices\Texas Instruments\CC2530F256.i51</state>
|
<state>$TOOLKIT_DIR$\config\devices\Texas Instruments\CC25xx\3x\CC2530F256.i51</state>
|
||||||
</option>
|
</option>
|
||||||
</data>
|
</data>
|
||||||
</settings>
|
</settings>
|
||||||
@@ -6174,7 +6174,7 @@
|
|||||||
<option>
|
<option>
|
||||||
<name>Compiler Extra Options Edit</name>
|
<name>Compiler Extra Options Edit</name>
|
||||||
<state>-f $PROJ_DIR$\..\..\..\Tools\CC2530DB\f8wRouter.cfg</state>
|
<state>-f $PROJ_DIR$\..\..\..\Tools\CC2530DB\f8wRouter.cfg</state>
|
||||||
<state>-f $PROJ_DIR$\..\..\..\Tools\CC2530DB\f8wConfig.cfg</state>
|
<state>-f $PROJ_DIR$\..\zstack-lib\f8wConfig.cfg</state>
|
||||||
<state>-f $PROJ_DIR$\..\..\..\Tools\CC2530DB\f8wZCL.cfg</state>
|
<state>-f $PROJ_DIR$\..\..\..\Tools\CC2530DB\f8wZCL.cfg</state>
|
||||||
</option>
|
</option>
|
||||||
<option>
|
<option>
|
||||||
@@ -8276,7 +8276,7 @@
|
|||||||
</option>
|
</option>
|
||||||
<option>
|
<option>
|
||||||
<name>OGChipConfigPath</name>
|
<name>OGChipConfigPath</name>
|
||||||
<state>$TOOLKIT_DIR$\config\devices\Texas Instruments\CC2530F256.i51</state>
|
<state>$TOOLKIT_DIR$\config\devices\Texas Instruments\CC25xx\3x\CC2530F256.i51</state>
|
||||||
</option>
|
</option>
|
||||||
</data>
|
</data>
|
||||||
</settings>
|
</settings>
|
||||||
@@ -8461,7 +8461,7 @@
|
|||||||
<option>
|
<option>
|
||||||
<name>Compiler Extra Options Edit</name>
|
<name>Compiler Extra Options Edit</name>
|
||||||
<state>-f $PROJ_DIR$\..\..\..\Tools\CC2530DB\f8wRouter.cfg</state>
|
<state>-f $PROJ_DIR$\..\..\..\Tools\CC2530DB\f8wRouter.cfg</state>
|
||||||
<state>-f $PROJ_DIR$\..\..\..\Tools\CC2530DB\f8wConfig.cfg</state>
|
<state>-f $PROJ_DIR$\..\zstack-lib\f8wConfig.cfg</state>
|
||||||
<state>-f $PROJ_DIR$\..\..\..\Tools\CC2530DB\f8wZCL.cfg</state>
|
<state>-f $PROJ_DIR$\..\..\..\Tools\CC2530DB\f8wZCL.cfg</state>
|
||||||
</option>
|
</option>
|
||||||
<option>
|
<option>
|
||||||
@@ -9687,7 +9687,7 @@
|
|||||||
<name>$PROJ_DIR$\..\..\..\Tools\CC2530DB\f8w2530.xcl</name>
|
<name>$PROJ_DIR$\..\..\..\Tools\CC2530DB\f8w2530.xcl</name>
|
||||||
</file>
|
</file>
|
||||||
<file>
|
<file>
|
||||||
<name>$PROJ_DIR$\..\..\..\Tools\CC2530DB\f8wConfig.cfg</name>
|
<name>$PROJ_DIR$\..\zstack-lib\f8wConfig.cfg</name>
|
||||||
</file>
|
</file>
|
||||||
<file>
|
<file>
|
||||||
<name>$PROJ_DIR$\..\..\..\Tools\CC2530DB\f8wCoord.cfg</name>
|
<name>$PROJ_DIR$\..\..\..\Tools\CC2530DB\f8wCoord.cfg</name>
|
||||||
|
|||||||
40
README.md
40
README.md
@@ -1,40 +1,54 @@
|
|||||||
# Zintercom
|
# Zintercom
|
||||||
|
|
||||||
|
## How to compile
|
||||||
|
Follow this article https://zigdevwiki.github.io/Begin/IAR_install/
|
||||||
|
|
||||||
##### Zigbee Intercom Automator
|
##### Zigbee Intercom Automator
|
||||||
This device is designed to control the matrix intercom using Zigbee.
|
This device is designed to control the matrix intercom using Zigbee.
|
||||||
|
|
||||||
Using zigbee2mqtt you can:
|
Using zigbee2mqtt you can:
|
||||||
1. Receive notification when the intercom rings. (also support **direct bind**)
|
1. Receive a notification when the intercom rings. (also support **direct bind**)
|
||||||
2. Mute the sound on the intercom handset.
|
2. Mute the sound on the intercom handset.
|
||||||
3. Automatically or manually open the door or hang up when the intercom rings.
|
3. Automatically or manually open the door or hang up when the intercom rings.
|
||||||
|
|
||||||
There are 4 work modes:
|
There are 4 work modes:
|
||||||
1. `Never` - ordinary work mode, use handset to control
|
1. `Never` - ordinary work mode, use a handset to control
|
||||||
2. `Once` - one time open door when intercom rings
|
2. `Once` - one-time open door when intercom rings
|
||||||
3. `Always` - open door when intercom rings
|
3. `Always` - open door when intercom rings
|
||||||
4. `Drop` - hangs up all intercom rings, right after start
|
4. `Drop` - hangs up all intercom rings, right after the start
|
||||||
|
|
||||||
You can change the operating mode uisng z2m or by short press the button. (< 1000ms)
|
You can change the operating mode using z2m or by short press the button. (< 1000ms)
|
||||||
After pressing the button, the LED will flash at 4 Hz.
|
After pressing the button, the LED will flash at 4 Hz.
|
||||||
The number of flashes indicates the current operating mode.
|
The number of flashes indicates the current operating mode.
|
||||||
|
|
||||||
You can control sound mode using z2m or by long press the button. (1000ms < X < 5000ms)
|
You can control sound mode using z2m or by long-press the button. (1000ms < X < 5000ms)
|
||||||
After pressing the button, the LED will flash at 1.5 Hz.
|
After pressing the button, the LED will flash at 1.5 Hz.
|
||||||
One flash - OFF, two flashes - ON.
|
One flash - OFF, two flashes - ON.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Important info
|
## Important info
|
||||||
|
#### 1
|
||||||
In Gerber PCB v1.0 committed on Apr 14, there are some errors in the silkscreen layers:
|
In Gerber PCB v1.0 committed on Apr 14, there are some errors in the silkscreen layers:
|
||||||
1. 'Line-' and 'Phone-' are reversed.
|
1. 'Line-' and 'Phone-' are reversed.
|
||||||
2. '+' and '-' are also reversed.
|
2. '+' and '-' are also reversed.
|
||||||
|
|
||||||
Just plug by swapping.
|
Just plug by swapping.
|
||||||
|
|
||||||
|
#### 2
|
||||||
|
The problem of cross-calls to other apartments:
|
||||||
|
it was revealed that the intercom circuit is closed through the reverse diode of the u2 transistor (thanks to @Alex_AW)
|
||||||
|
to prevent it, you need to add a diode according to the diagram:
|
||||||
|

|
||||||
|
|
||||||
|
#### 3
|
||||||
|
If you want to use the battery version without a handset, do not turn off the sound in z2m, but use an external resistor to emulate the intercom handset, according to the diagram:
|
||||||
|

|
||||||
|
|
||||||
|
|
||||||
### How to join
|
### How to join
|
||||||
Reset to FN by reboot device 5 times with interval less than 10 seconds.
|
Reset to FN by reboot the device 5 times with intervals of less than 10 seconds.
|
||||||
Reset to FN by press and hold BTN for 5 seconds.
|
Reset to FN by pressing and holding BTN for 5 seconds.
|
||||||
|
|
||||||
LED will flash during reset.
|
LED will flash during reset.
|
||||||
|
|
||||||
@@ -61,6 +75,8 @@ Converter file located [here](https://github.com/diyruz/Zintercom/blob/master/co
|
|||||||
|
|
||||||
### DC Power
|
### DC Power
|
||||||
|
|
||||||
|
5-10 V
|
||||||
|
|
||||||
Support `router` and `end device` modes.
|
Support `router` and `end device` modes.
|
||||||
Install `E18-MS1PA1`, `E18-MS1PA2` or `E18-MS1-PCB`.
|
Install `E18-MS1PA1`, `E18-MS1PA2` or `E18-MS1-PCB`.
|
||||||
|
|
||||||
@@ -71,13 +87,15 @@ Install `E18-MS1PA1`, `E18-MS1PA2` or `E18-MS1-PCB`.
|
|||||||
|
|
||||||
### Battery Power
|
### Battery Power
|
||||||
|
|
||||||
|
2 * AAA batteries
|
||||||
|
|
||||||
Support only `end device` mode.
|
Support only `end device` mode.
|
||||||
Install `E18-MS1-PCB` only!
|
Install `E18-MS1-PCB` only!
|
||||||
|
|
||||||
Do not turn off `sound` because it turns U2 forever, which will drain the battery much faster.
|
Do not turn off `sound` because it turns U2 forever, which will drain the battery much faster.
|
||||||
|
|
||||||
Since the device is in sleep mode, it cannot receive commands.
|
Since the device is in sleep mode, it cannot receive commands.
|
||||||
But you have the ability to set the button mode or at the time of the call.
|
But you can set the button mode or at the time of the call.
|
||||||
|
|
||||||
If any commands are in the coordinator's queue, they will be executed after a button is pressed or a call is received.
|
If any commands are in the coordinator's queue, they will be executed after a button is pressed or a call is received.
|
||||||
|
|
||||||
@@ -86,7 +104,7 @@ If any commands are in the coordinator's queue, they will be executed after a bu
|
|||||||
##### The mode set by the Zigbee command `overwrites` the mode set by the button.
|
##### The mode set by the Zigbee command `overwrites` the mode set by the button.
|
||||||
|
|
||||||
### Binding
|
### Binding
|
||||||
The device supports direct binding of an incoming call to the onOff cluster.
|
The device supports the direct binding of an incoming call to the onOff cluster.
|
||||||
|
|
||||||
For example, you can turn on the light while a call comes to the intercom, for notification in mute mode.
|
For example, you can turn on the light while a call comes to the intercom, for notification in mute mode.
|
||||||
|
|
||||||
|
|||||||
@@ -42,20 +42,29 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined( HAL_BOARD_TARGET )
|
#if defined( HAL_BOARD_TARGET )
|
||||||
|
// Income ring - P0_0
|
||||||
|
#define KEY_INCOME_PORT HAL_KEY_PORT0
|
||||||
#define HAL_KEY_P0_INPUT_PINS BV(0)
|
#define HAL_KEY_P0_INPUT_PINS BV(0)
|
||||||
#define HAL_KEY_P0_INPUT_PINS_EDGE HAL_KEY_RISING_EDGE
|
#define HAL_KEY_P0_INPUT_PINS_EDGE HAL_KEY_RISING_EDGE
|
||||||
|
// Button - P2_0
|
||||||
|
#define KEY1_PORT HAL_KEY_PORT2
|
||||||
#define HAL_KEY_P2_INPUT_PINS BV(0)
|
#define HAL_KEY_P2_INPUT_PINS BV(0)
|
||||||
#define HAL_KEY_P2_INPUT_PINS_EDGE HAL_KEY_FALLING_EDGE
|
#define HAL_KEY_P2_INPUT_PINS_EDGE HAL_KEY_FALLING_EDGE
|
||||||
#define INT_HEAP_LEN 2200//2256
|
#define INT_HEAP_LEN 2200//2256
|
||||||
#elif defined( HAL_BOARD_CHDTECH_DEV )
|
#elif defined( HAL_BOARD_CHDTECH_DEV )
|
||||||
|
// Income ring - P0_1
|
||||||
|
#define KEY_INCOME_PORT HAL_KEY_PORT0
|
||||||
#define HAL_KEY_P0_INPUT_PINS BV(1)
|
#define HAL_KEY_P0_INPUT_PINS BV(1)
|
||||||
#define HAL_KEY_P0_INPUT_PINS_EDGE HAL_KEY_FALLING_EDGE
|
#define HAL_KEY_P0_INPUT_PINS_EDGE HAL_KEY_FALLING_EDGE
|
||||||
|
// Button - P2_0
|
||||||
|
#define KEY1_PORT HAL_KEY_PORT2
|
||||||
#define HAL_KEY_P2_INPUT_PINS BV(0)
|
#define HAL_KEY_P2_INPUT_PINS BV(0)
|
||||||
#define HAL_KEY_P2_INPUT_PINS_EDGE HAL_KEY_FALLING_EDGE
|
#define HAL_KEY_P2_INPUT_PINS_EDGE HAL_KEY_FALLING_EDGE
|
||||||
#define DO_DEBUG_UART
|
#define DO_DEBUG_UART
|
||||||
#define INT_HEAP_LEN 2060
|
#define INT_HEAP_LEN 2060
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define BTN_HOLD_TIME 1000
|
||||||
#define FACTORY_RESET_HOLD_TIME_LONG 5000
|
#define FACTORY_RESET_HOLD_TIME_LONG 5000
|
||||||
|
|
||||||
#if defined( DO_DEBUG_UART )
|
#if defined( DO_DEBUG_UART )
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ static void zclApp_HandleKeys(byte portAndAction, byte keyCode) {
|
|||||||
//LREP("zclApp_HandleKeys portAndAction=0x%X keyCode=0x%X\r\n", portAndAction, keyCode);
|
//LREP("zclApp_HandleKeys portAndAction=0x%X keyCode=0x%X\r\n", portAndAction, keyCode);
|
||||||
//zclCommissioning_HandleKeys(portAndAction, keyCode);
|
//zclCommissioning_HandleKeys(portAndAction, keyCode);
|
||||||
|
|
||||||
if (portAndAction & 0x01) { //P0 Ring //S1 P0_1
|
if (portAndAction & KEY_INCOME_PORT) { //P0 Ring //S1 P0_1 TODO add check Income pin
|
||||||
|
|
||||||
//exit old stop timer
|
//exit old stop timer
|
||||||
osal_stop_timerEx(zclApp_TaskID, APP_RING_STOP_EVT);
|
osal_stop_timerEx(zclApp_TaskID, APP_RING_STOP_EVT);
|
||||||
@@ -167,25 +167,25 @@ static void zclApp_HandleKeys(byte portAndAction, byte keyCode) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (portAndAction & 0x04) { //P2 Btn //S2 P2_0
|
if (portAndAction & KEY1_PORT) { //P2 Btn //S2 P2_0 TODO add check BUTTON pin
|
||||||
zclFactoryResetter_HandleKeys(portAndAction, keyCode);
|
zclFactoryResetter_HandleKeys(portAndAction, keyCode);
|
||||||
if (portAndAction & HAL_KEY_PRESS) {
|
if (portAndAction & HAL_KEY_PRESS) {
|
||||||
LREPMaster("Key pressed\r\n");
|
LREPMaster("Key pressed\r\n");
|
||||||
zclApp_State.pressTime = osal_getClock();
|
zclApp_State.pressTime = osal_GetSystemClock();
|
||||||
LREP("pressTime = %d\r\n", zclApp_State.pressTime);
|
LREP("pressTime = %ld\r\n", zclApp_State.pressTime);
|
||||||
}
|
}
|
||||||
if (portAndAction & HAL_KEY_RELEASE) {
|
if (portAndAction & HAL_KEY_RELEASE) {
|
||||||
LREPMaster("Key released\r\n");
|
LREPMaster("Key released\r\n");
|
||||||
uint32 holdTime = osal_getClock() - zclApp_State.pressTime;
|
uint32 holdTime = osal_GetSystemClock() - zclApp_State.pressTime;
|
||||||
LREP("holdTime = %d \r\n", holdTime);
|
LREP("holdTime = %ld \r\n", holdTime);
|
||||||
zclApp_State.pressTime = 0;
|
if (zclApp_State.pressTime != 0 && holdTime >= BTN_HOLD_TIME) { // check release without press and hold milliseconds
|
||||||
if (holdTime >= 1) { //seconds
|
|
||||||
osal_start_timerEx(zclApp_TaskID, APP_BTN_HOLD_EVT, 50);
|
osal_start_timerEx(zclApp_TaskID, APP_BTN_HOLD_EVT, 50);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
osal_start_timerEx(zclApp_TaskID, APP_BTN_CLICK_EVT, 50);
|
osal_start_timerEx(zclApp_TaskID, APP_BTN_CLICK_EVT, 50);
|
||||||
}
|
}
|
||||||
}
|
zclApp_State.pressTime = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
BIN
images/battery_no_handset.png
Normal file
BIN
images/battery_no_handset.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 76 KiB |
BIN
images/fix_error_rings.png
Normal file
BIN
images/fix_error_rings.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 71 KiB |
Reference in New Issue
Block a user