moved comment and minor ops
This commit is contained in:
+25
-25
@@ -1,20 +1,20 @@
|
||||
/* MyMQTT Broker Gateway 0.1b
|
||||
|
||||
Created by Daniel Wiegert <daniel.wiegert@gmail.com>
|
||||
Based on MySensors Ethernet Gateway by Henrik Ekblad <henrik.ekblad@gmail.com>
|
||||
http://www.mysensors.org
|
||||
Created by Daniel Wiegert <daniel.wiegert@gmail.com>
|
||||
Based on MySensors Ethernet Gateway by Henrik Ekblad <henrik.ekblad@gmail.com>
|
||||
http://www.mysensors.org
|
||||
|
||||
Requires MySensors lib 1.4b
|
||||
Requires MySensors lib 1.4b
|
||||
|
||||
* Change below; TCP_IP, TCP_PORT, TCP_MAC
|
||||
This will listen on your selected TCP_IP:TCP_PORT below, Please change TCP_MAC your liking also.
|
||||
*1 -> NOTE: Keep first byte at x2, x6, xA or xE (replace x with any hex value) for using Local Ranges.
|
||||
* Change below; TCP_IP, TCP_PORT, TCP_MAC
|
||||
This will listen on your selected TCP_IP:TCP_PORT below, Please change TCP_MAC your liking also.
|
||||
*1 -> NOTE: Keep first byte at x2, x6, xA or xE (replace x with any hex value) for using Local Ranges.
|
||||
|
||||
*2 You can use standard pin set-up as MySensors recommends or if you own a IBOARD you may change
|
||||
the radio-pins below if you hardware mod your iBoard. see [URL BELOW] for more details.
|
||||
http://forum.mysensors.org/topic/224/iboard-cheap-single-board-ethernet-arduino-with-radio/5
|
||||
*2 You can use standard pin set-up as MySensors recommends or if you own a IBOARD you may change
|
||||
the radio-pins below if you hardware mod your iBoard. see [URL BELOW] for more details.
|
||||
http://forum.mysensors.org/topic/224/iboard-cheap-single-board-ethernet-arduino-with-radio/5
|
||||
|
||||
* Don't forget to look at the definitions in libraries\MySensors\MyMQTT.h!
|
||||
* Don't forget to look at the definitions in libraries\MySensors\MyMQTT.h!
|
||||
|
||||
define TCPDUMP and connect serial interface if you have problems, please write on
|
||||
http://forum.mysensors.org/ and explain your problem, include serial output. Don't forget to
|
||||
@@ -29,8 +29,9 @@
|
||||
MQTT_SEND_SUBSCRIPTION is if you want the MyMQTT to send a empty payload message to your nodes.
|
||||
This can be useful if you want to send latest state back to the MQTT client. Just check if incoming
|
||||
message has any length or not.
|
||||
Example: if (msg.type==V_LIGHT && strlen(msg.getString())>0) otherwise the code might do strange things.
|
||||
|
||||
* Address-layout is : [MQTT_BROKER_PREFIX]/[NodeID]/[SensorID]/[SensorType]
|
||||
* Address-layout is : [MQTT_BROKER_PREFIX]/[NodeID]/[SensorID]/[SensorType]
|
||||
NodeID and SensorID is uint8 (0-255) number.
|
||||
Last segment is translation of the sensor type, look inside MyMQTT.cpp for the definitions.
|
||||
User can change this to their needs. We have also left some space for custom types.
|
||||
@@ -39,18 +40,18 @@ Special: (sensor 255 reserved for special commands)
|
||||
You can receive a node sketch name with MyMQTT/20/255/Sketch_name (or version with _version)
|
||||
|
||||
To-do:
|
||||
Special commands : clear or set EEPROM Values, Send REBOOT and Receive reboot for MyMQTT itself.
|
||||
Be able to send ACK so client returns the data being sent.
|
||||
... Please come with ideas!
|
||||
|
||||
Test in more MQTT clients, So far tested in openhab and MyMQTT for Android (Not my creation)
|
||||
- http://www.openhab.org/
|
||||
- https://play.google.com/store/apps/details?id=at.tripwire.mqtt.client&hl=en
|
||||
... Please notify me if you use this broker with other software.
|
||||
Special commands : clear or set EEPROM Values, Send REBOOT and Receive reboot for MyMQTT itself.
|
||||
Be able to send ACK so client returns the data being sent.
|
||||
... Please come with ideas!
|
||||
|
||||
Test in more MQTT clients, So far tested in openhab and MyMQTT for Android (Not my creation)
|
||||
- http://www.openhab.org/
|
||||
- https://play.google.com/store/apps/details?id=at.tripwire.mqtt.client&hl=en
|
||||
... Please notify me if you use this broker with other software.
|
||||
|
||||
|
||||
* Example Openhab configuration:
|
||||
openhab.cfg
|
||||
* Example Openhab configuration:
|
||||
openhab.cfg
|
||||
---
|
||||
mqtt:mysensor.url=tcp://192.168.0.234:1883
|
||||
mqtt:mysensor.clientId=MQTT
|
||||
@@ -75,7 +76,7 @@ sitemap/test.site
|
||||
---
|
||||
sitemap demo label="Menu"
|
||||
Frame label="Openhab" {
|
||||
Group item=test label="Test group"
|
||||
Group item=test label="Test group"
|
||||
}
|
||||
---
|
||||
|
||||
@@ -148,7 +149,7 @@ int main(void) {
|
||||
delay(1000); // Wait for Ethernet to get configured.
|
||||
gw.begin(RF24_PA_LEVEL_GW, RF24_CHANNEL, RF24_DATARATE, writeEthernet);
|
||||
server.begin();
|
||||
// Add led timer interrupt
|
||||
// Add led timer interrupt
|
||||
if (gw.isLedMode()) {
|
||||
MsTimer2::set(200, ledTimersInterrupt);
|
||||
MsTimer2::start();
|
||||
@@ -159,4 +160,3 @@ int main(void) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user