This repository has been archived on 2024-01-30. You can view files and clone it, but cannot push or open issues or pull requests.
trev/README.md

100 lines
3.1 KiB
Markdown
Raw Permalink Normal View History

2016-01-11 21:16:48 +01:00
# Home Automation
## Vision
This should work in such a way that the user logs into a web interface where they then should be able to easily control their home. A lot like heimcontrol.js, however with a cleaner interface and less wasted space. On the technical side it would be nice to have a better protocol than the one used by duino, which seems counterintuitive. Its not a binary protocol, but rather a text based one, which is odd. It would also be nice if there were a easier way to set up device maybe I could use receivers to learn patterns of, for example IR-remotes, that I then could replicate with the transmitter. It would also be nice to have the capability to schedule tasks. Turning on the radio to wake me up or being able to switch of the lights automatically for example.
## Links
- [duino](https://github.com/ni-c/duino)
- [heimcontrol.js](http://ni-c.github.io/heimcontrol.js/)
- [serialport](https://www.npmjs.com/package/serialport)
2016-01-17 12:26:04 +01:00
# Dependicies and Requirements
## Hardware
2016-01-11 21:16:48 +01:00
- [x] Raspberry Pi
- [x] Arduino Uno Rev3
- [x] Heat-Sensor
- [x] Light-Sensor
2016-01-16 21:58:05 +01:00
- [x] RC-Transmitter (Receiver?)
2016-01-17 12:18:41 +01:00
- [x] IR-Transmitter
2016-02-01 15:34:05 +01:00
- [x] IR-Receiver
2016-01-11 21:16:48 +01:00
- [x] RC-Poweroutlets
- [x] LEDs
2016-01-17 12:26:04 +01:00
## Software
2016-01-11 21:16:48 +01:00
- [x] [Node.js](https://nodejs.org/en/)
2016-01-31 18:52:09 +01:00
- [x] [MySQL](http://www.raspberry-projects.com/pi/software_utilities/mysql)
2016-01-11 21:16:48 +01:00
- [ ] [Passport?](http://passportjs.org/)
- [x] [Serialport](https://www.npmjs.com/package/serialport)
2016-01-31 18:52:09 +01:00
- [x] [mysql](https://www.npmjs.com/package/mysql)
2016-01-14 00:48:45 +01:00
- [x] [Express](http://expressjs.com/)
- [x] [AngularJS](https://angularjs.org/)
2016-01-17 12:26:04 +01:00
- [x] [Ino](http://inotool.org/)
- [x] Raspberry Pi Arduino Package (`sudo apt-get install arduino`)
2016-01-16 21:58:05 +01:00
2016-01-17 12:26:04 +01:00
# Pins
## Analog
2016-02-01 15:12:36 +01:00
|Pin | Function |
|---- |--------------- |
|A0 | Temperature |
|A1 | Light |
2016-01-16 21:58:05 +01:00
2016-01-17 12:26:04 +01:00
## Digital
2016-01-21 23:02:07 +01:00
|Pin | Function |
|---- |--------------- |
| ~3* | IR-Trasmitter |
|~10* | IR-Receiver |
|~11 | RC-Trasmitter |
|~13* | LED (Status) |
The pins marked with an * are fixed and cannot be changed to another pin.
2016-01-18 22:30:20 +01:00
# Protocol
2016-01-18 23:32:33 +01:00
```
2016-01-18 22:30:20 +01:00
0,5 Byte Overhead
0,5 Byte Command
1 Byte Pin
6 Byte Value
----
8 Byte
2016-01-18 23:32:33 +01:00
```
2016-01-18 22:30:20 +01:00
## Description
All messages start with the header, which consits of a nibble:
```
0101
```
2016-12-28 09:53:40 +01:00
Those four Bits are followed by one of ten commands which are also encoded in a nibble e.g.:
2016-01-18 22:30:20 +01:00
```
0000 - toggle Debug mode
or combined
0101 0000 - Ascii: P / Dec: 80
```
The server side of the protocol deals with the messages as Ascii encoded strings. This is followed by the second byte which encodes the pin that shall be used:
```
Pin ranges digital: 110 0001 / Ascii: a / DEC: 97 - 110 1110 / Ascii: n / DEC: 110
Pin ranges analog: 110 1111 / Ascii: o / DEC: 111 - 111 0100 / Ascii: t / DEC: 116
```
Followed by six byte long value
## Possible Commands
2016-01-30 19:05:31 +01:00
- [x] 80 - P - toggle Debug
- [x] 81 - Q - set pin mode
2016-01-21 22:51:15 +01:00
- [x] 82 - R - digital write
- [x] 83 - S - digital read
2016-01-25 22:02:42 +01:00
- [x] 84 - T - analog write
- [x] 85 - U - analog read
- [x] 86 - V - handle RC Decimal
2016-01-21 22:51:15 +01:00
- [x] 87 - W - handle RC TriState
2016-01-25 22:02:42 +01:00
- [x] 88 - X - handle IR send
2016-01-21 22:51:15 +01:00
- [x] 89 - Y - handle IR read
2016-01-18 22:30:20 +01:00
## Special Command
2016-01-21 22:51:15 +01:00
- [x] 90 - Z - Beginn Communication
2016-01-18 22:30:20 +01:00
2016-01-18 23:28:35 +01:00
## Possible future commands
2016-01-18 23:27:16 +01:00
- 91 - [ -
- 92 - \ -
- 93 - ] -
- 94 - ^ -
- 95 - _ -