Skip to content

Commit adb116c

Browse files
authored
Merge pull request #18 from exsilium/development
[v0.4.0-rc.0] From Grove to Custom design - From 1 channel to 4
2 parents 2573c08 + 51ad879 commit adb116c

31 files changed

+53016
-270
lines changed

.github/workflows/c-cpp.yml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: C/C++ CI
2+
3+
on:
4+
push:
5+
branches: [ master, development ]
6+
pull_request:
7+
branches: [ master, development ]
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v2
16+
- name: Install 32-bit libraries
17+
run: sudo apt-get install lib32stdc++6
18+
- name: make
19+
run: make
20+
env:
21+
WRAPINDOCKER: ""

.gitignore

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
11
.DS_Store
22
err.txt
33
obj
4+
5+
# Autodesk Eagle Backup files
6+
*.s#?
7+
*.b#?
8+
*.l#?
9+
*.b$?
10+
*.s$?
11+
*.l$?

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Basic image to compile
2-
FROM ubuntu:16.04
2+
FROM ubuntu:20.04
33
MAINTAINER Sten Feldman <[email protected]>
44
RUN apt-get update
55
RUN apt-get install -y lib32stdc++6 make

Makefile

+10-4
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,10 @@ APP_NAME=trigger
3434

3535
# Toolchain and output. If you are using Docker to build, make sure the paths
3636
# are relative and within this directory to ensure container access.
37-
CC=./hc08c/bin/chc08
38-
LINKER=./hc08c/bin/linker
39-
BURNER=./hc08c/bin/burner
37+
WRAPINDOCKER ?=docker run -v $(CURDIR):$(CURDIR) -w=$(CURDIR) $(APP_NAME)
38+
CC=$(WRAPINDOCKER) ./hc08c/bin/chc08
39+
LINKER=$(WRAPINDOCKER) ./hc08c/bin/linker
40+
BURNER=$(WRAPINDOCKER) ./hc08c/bin/burner
4041
OUTPUT=obj
4142

4243
PXBEE_API_SRC=./pxbee
@@ -79,6 +80,7 @@ all: start cpu drivers misc pan link burn
7980
start: $(OUTPUT) \
8081
$(OUTPUT)/start08.o \
8182
$(OUTPUT)/util.o \
83+
$(OUTPUT)/serialpass.o \
8284
$(OUTPUT)/main.o
8385

8486
$(OUTPUT)/start08.o: ./src/start08.c
@@ -87,6 +89,9 @@ $(OUTPUT)/start08.o: ./src/start08.c
8789
$(OUTPUT)/util.o: ./src/util.c
8890
$(CC) $(CFLAGS) -ObjN="$@" -Lm="$@.d" -LmCfg=xilmou $<
8991

92+
$(OUTPUT)/serialpass.o: ./src/serialpass.c
93+
$(CC) $(CFLAGS) -ObjN="$@" -Lm="$@.d" -LmCfg=xilmou $<
94+
9095
$(OUTPUT)/main.o: ./src/main.c
9196
$(CC) $(CFLAGS) -ObjN="$@" -Lm="$@.d" -LmCfg=xilmou $<
9297

@@ -288,6 +293,7 @@ link:
288293
"$(OUTPUT)/pan/zigbee/zigbee_zdo.o" \
289294
"$(OUTPUT)/start08.o" \
290295
"$(OUTPUT)/util.o" \
296+
"$(OUTPUT)/serialpass.o" \
291297
"$(OUTPUT)/main.o" \
292298
"$(HC08C)/lib/$(HC08C_LIB)"\) \
293299
-O"$(OUTPUT)/$(APP_NAME).abs"
@@ -332,7 +338,7 @@ builddocker:
332338
docker build --tag=$(APP_NAME):latest .
333339

334340
dall:
335-
docker run -v $(CURDIR):/$(APP_NAME) -w=/$(APP_NAME) --rm=true $(APP_NAME)
341+
docker run -v $(CURDIR):$(CURDIR) -w=$(CURDIR) --env WRAPINDOCKER="" --rm=true $(APP_NAME)
336342

337343
###############################################################################
338344
# CLEAN #######################################################################

README.md

+44-11
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,38 @@
11
# pxbee-trigger
22

3-
Programmable XBee Trigger that is ZigBee Home Automation profile compliant. The testing of this feature is carried out using [SmartThings](https://www.smartthings.com) Hub and a default ZigBee device handler.
4-
5-
## Bill of Materials
6-
7-
| Component | Manufacturer | Quantity | SKU / Part nr. | Mandatory / Optional |
8-
| ------------- | ------------- | -------- | -------------- | -------------------- |
9-
| [Programmable XBee](https://www.digi.com/products/xbee-rf-solutions/rf-modules/xbee-zigbee#partnumbers) | [Digi](https://www.digi.com) | 1 | XBP24CZ7PITB003 | M |
10-
| [Grove - XBee Carrier](https://www.seeedstudio.com/Grove-XBee-Carrier-p-905.html) | [Seeed Development](https://www.seeedstudio.com/) | 1 | 113020004 | O |
11-
| [Grove - Relay](https://www.seeedstudio.com/Grove-Relay-p-769.html) | [Seeed Development](https://www.seeedstudio.com/) | 1 | 103020005 | O |
12-
| [Grove 5cm Cable](https://www.seeedstudio.com/Grove-Universal-4-Pin-Buckled-5cm-Cable-(5-PCs-Pack)-p-925.html) | [Seeed Development](https://www.seeedstudio.com/) | 1 | 110990036 | O |
3+
Programmable XBee Trigger that is ZigBee Home Automation profile compliant. Possible to integrate with [SmartThings](https://www.smartthings.com) Hub v3 or a separate ZigBee / XBee network. Includes a reference hardware design up to 4 channels with a full BOM, perfect for DIYselfers out there.
4+
5+
Used in real life to automate garage / gate automatons.
6+
7+
## Hardware example
8+
9+
![Picture](doc/board_top.jpg)
10+
11+
An assembled board without a mounted XBee radio. Metric scale for reference (cm.). Board dimension - 51 x 57 mm.
12+
## Bill of Materials (BOM)
13+
14+
| Designator | Component | Manufacturer | Quantity | SKU / Part nr. | Spec | Option |
15+
| ----------- | -------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------- | -------- | ----------------------------- | ---------------------------------------------------------------------------------- | ------ |
16+
| XB1 | [Programmable XBee](https://www.digi.com/products/xbee-rf-solutions/rf-modules/xbee-zigbee#partnumbers) (with RPSMA) | [Digi](https://www.digi.com) | 1 | XBP24CZ7SITB003 | [PDF](http://www.digi.com/resources/documentation/digidocs/pdfs/90002002.pdf) | |
17+
| BR1 | [Bridge Rectifier DF01M](https://www.mouser.ee/ProductDetail/512-DF01M) | [ON Semiconductor](https://www.onsemi.com) | 1 | Mouser No: 512-DF01M | [PDF](https://www.mouser.ee/datasheet/2/308/DF10M-D-1803766.pdf) | |
18+
| C1 (C2) | [Electrolytic Capacitor - Radial 220uF 50V](https://www.mouser.ee/ProductDetail/EEU-FM1H221) | [Panasonic](https://industrial.panasonic.com). | 1-2 | Mouser No: 667-EEU-FM1H221. | [PDF](https://www.mouser.ee/datasheet/2/315/ABA0000C1018-947496.pdf). | |
19+
| PS1 | [DC/DC Isolated Converter Cosel MGFS1R5243R3](https://www.mouser.ee/ProductDetail/436-MGFS1R5243R3) | [Cosel](https://www.coseleurope.eu) | 1 | Mouser No: 436-MGFS1R5243R3 | [PDF](https://www.mouser.ee/datasheet/2/622/SFE_MGFS-1115632.pdf) | |
20+
| Q1,Q2,Q3,Q4 | [Bipolar Transistor BC548BTA](https://www.mouser.ee/ProductDetail/512-BC548BTA) | [ON Semiconductor](https://www.onsemi.com) | 4 | Mouser No: 512-BC548BTA | [PDF](https://www.mouser.ee/datasheet/2/308/BC548-1118644.pdf) | |
21+
| D1,D2,D3,D4 | [Diode 1N4004](https://www.mouser.ee/ProductDetail/863-1N4004RLG) | [ON Semiconductor](https://www.onsemi.com) | 4 | Mouser No: 863-1N4004RLG | [PDF](https://www.mouser.ee/datasheet/2/308/1N4001-D-110363.pdf) | |
22+
| K1,K2,K3,K4 | [General Purpose Relay (APAN3103)](https://www.mouser.ee/ProductDetail/769-APAN3103) | [Panasonic](https://industrial.panasonic.com) | 4 | Mouser No: 769-APAN3103 | [PDF](https://www.mouser.ee/datasheet/2/315/mech_eng_pan-1299258.pdf) | |
23+
| R1,R2,R3,R4 | [Resistor RN55D1801FB14](https://www.mouser.ee/ProductDetail/71-RN55D1801FB14) | [Vishay](https://www.vishay.com) | 4 | Mouser No: 71-RN55D1801FB14 | [PDF](https://www.mouser.ee/datasheet/2/427/cmfmil-109690.pdf) | |
24+
| XB1 | [10 pin header for XBee](https://www.mouser.ee/ProductDetail/855-M22-7131042) | [Harwin](https://www.harwin.com) | 2 | Mouser No: 855-M22-7131042 | [PDF](https://www.mouser.ee/datasheet/2/181/M22-713-1134021.pdf) | |
25+
| J1 | [2 pin Terminal Block (PCB)](https://www.mouser.ee/ProductDetail/538-39501-1002) | [Molex](https://www.molex.com) | 1 | Mouser No: 538-39501-1002 | [PDF](https://www.mouser.ee/datasheet/2/276/0395011002_TERMINAL_BLOCKS-163759.pdf) | A |
26+
| | [2 pin Terminal Plug](https://www.mouser.ee/ProductDetail/538-39500-0002) | [Molex](https://www.molex.com) | 1 | Mouser No: 538-39500-0002 | [PDF](https://www.mouser.ee/datasheet/2/276/0395000002_TERMINAL_BLOCKS-136229.pdf) | A |
27+
| J2 | [9 pin Terminal Block (PCB)](https://www.mouser.ee/ProductDetail/538-39501-1009) | [Molex](https://www.molex.com) | 1 | Mouser No: 538-39501-1009 | [PDF](https://www.mouser.ee/datasheet/2/276/0395011009_TERMINAL_BLOCKS-163629.pdf) | A |
28+
| | [9 pin Terminal Plug](https://www.mouser.ee/ProductDetail/651-1908101) | [Molex](https://www.molex.com) | 1 | Mouser No: 651-1908101 | [PDF](https://www.mouser.ee/datasheet/2/276/0395000009_TERMINAL_BLOCKS-163669.pdf) | A |
29+
| J1 | [2 pin Fixed Terminal Block (PCB)](https://www.mouser.ee/ProductDetail/538-39357-0002) | [Molex](https://www.molex.com) | 1 | Mouser No: 538-39357-0002 | [PDF](https://www.mouser.ee/datasheet/2/276/0393570002_TERMINAL_BLOCKS-227759.pdf) | B |
30+
| J2 | [9 pin Fixed Terminal Block (PCB)](https://www.mouser.ee/ProductDetail/538-39357-0009) | [Molex](https://www.molex.com) | 1 | Mouser No: 538-39357-0009 | [PDF](https://www.mouser.ee/datasheet/2/276/0393570009_TERMINAL_BLOCKS-136250.pdf) | B |
31+
| | [Antenna with RP-SMA Connector](https://www.mouser.ee/ProductDetail/712-ANT-2.4-CW-RAH) | [Linx Technologies](https://linxtechnologies.com) | 1 | Mouser No: 712-ANT-2.4-CW-RAH | [PDF](https://www.mouser.ee/datasheet/2/238/ant-2.4-cw-rah-ccc-1659143.pdf) | |
32+
| JP1 | [6 pin Debug Header](https://www.mouser.ee/ProductDetail/538-22-28-8065) | [Molex](https://www.molex.com) | 1 | Mouser No: 538-22-28-8065 | [PDF](https://www.mouser.ee/datasheet/2/276/0022288065_PCB_HEADERS-159204.pdf) | O |
33+
| J3 | [2 pin Reset Header](https://www.mouser.ee/ProductDetail/Molex/22-28-5027) | [Molex](https://www.molex.com) | 1 | Mouser No: 538-22-28-5027 | [PDF](https://www.mouser.ee/ProductDetail/Molex/22-28-5027) | O |
34+
35+
Standard 3.5 width headers are used. Option **A**) uses pluggable termination; **B**) Fixed screw termination; **O**) Parts are optional and meant for development; Components can easily be switched with other termination blocks or use direct wire soldering.
1336

1437
## Compiling
1538

@@ -30,7 +53,7 @@ Programmable XBee Trigger that is ZigBee Home Automation profile compliant. The
3053

3154
## Trigger
3255

33-
Send a Unicast ZCL "On" command to trigger the connected relay for 125ms. The state of the switch remains in "Off" state. Broadcast command is ignored by default.
56+
Send a Unicast ZCL "On" command to trigger the connected relay for 125ms (Relay 1). The state of the switch remains in "Off" state. Broadcast command is ignored by default.
3457

3558
```
3659
Endpoint: 0xEA,
@@ -49,6 +72,16 @@ The following defines can be altered in `custom.h` prior to compilation to chang
4972
| `ZCL_MANUFACTURER` | The reported manufacturer string. For SmartThings local execution support without custom device handler, set this to "Leviton". | "PXBee" |
5073
| `ZCL_MODEL` | The reported model string. For SmartThings local execution support without custom device handler, set this to "ZSS-10". | "Trigger" |
5174

75+
### Endpoints
76+
77+
| Endpoint | Description |
78+
| ----------| ----------- |
79+
| `0xEA` | Relay 1 |
80+
| `0xEB` | Relay 2 |
81+
| `0xEC` | Relay 3 |
82+
| `0xED` | Relay 4 |
83+
| `0xEE` | Auxiliary binary input endpoint |
84+
5285
## License
5386

5487
This project is based on [exsilium/pxbee-blink-led](https://github.com/exsilium/pxbee-blink-led) boilerplate and includes the full [Digi](http://www.digi.com) XBee SDK version 1.6.0 sources.

doc/board_top.jpg

757 KB
Loading

0 commit comments

Comments
 (0)