Smart-Home am Beispiel der Präsenzerkennung im Raum Projektarbeit Lennart Heimbs, Johannes Krug, Sebastian Dohle und Kevin Holzschuh bei Prof. Oliver Hofmann SS2019
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

mysgw.cpp 3.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. /*
  2. * The MySensors Arduino library handles the wireless radio link and protocol
  3. * between your home built sensors/actuators and HA controller of choice.
  4. * The sensors forms a self healing radio network with optional repeaters. Each
  5. * repeater and gateway builds a routing tables in EEPROM which keeps track of the
  6. * network topology allowing messages to be routed to nodes.
  7. *
  8. * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
  9. * Copyright (C) 2013-2018 Sensnology AB
  10. * Full contributor list: https://github.com/mysensors/MySensors/graphs/contributors
  11. *
  12. * Documentation: http://www.mysensors.org
  13. * Support Forum: http://forum.mysensors.org
  14. *
  15. * This program is free software; you can redistribute it and/or
  16. * modify it under the terms of the GNU General Public License
  17. * version 2 as published by the Free Software Foundation.
  18. */
  19. #include <iostream>
  20. #include <cstdio>
  21. #include <unistd.h>
  22. // For more options run ./configure --help
  23. // Config file
  24. //#define MY_LINUX_CONFIG_FILE "/etc/mysensors.conf"
  25. // How many clients should be able to connect to this gateway (default 1)
  26. #define MY_GATEWAY_MAX_CLIENTS 10
  27. // Serial config
  28. // Enable this if you are using an Arduino connected to the USB
  29. //#define MY_LINUX_SERIAL_PORT "/dev/ttyUSB0"
  30. // Enable this if you need to connect to a controller running on the same device
  31. // You also need to define MY_LINUX_SERIAL_PORT above with the symlink name for the PTY device
  32. //#define MY_LINUX_SERIAL_IS_PTY
  33. // Grant access to the specified system group for the serial device
  34. //#define MY_LINUX_SERIAL_GROUPNAME "tty"
  35. // MQTT options
  36. //#define MY_CONTROLLER_IP_ADDRESS 192, 168, 178, 68
  37. //#define MY_PORT 1883
  38. //#define MY_MQTT_CLIENT_ID "mysensors-1"
  39. //#define MY_MQTT_PUBLISH_TOPIC_PREFIX "mygateway1-out"
  40. //#define MY_MQTT_SUBSCRIBE_TOPIC_PREFIX "mygateway1-in"
  41. // Enable these if your MQTT broker requires username/password
  42. //#define MY_MQTT_USER "username"
  43. //#define MY_MQTT_PASSWORD "password"
  44. // Flash leds on rx/tx/err
  45. //#define MY_DEFAULT_ERR_LED_PIN 12 // Error LED pin
  46. //#define MY_DEFAULT_RX_LED_PIN 16 // Receive LED pin
  47. //#define MY_DEFAULT_TX_LED_PIN 18 // Transmit LED pin
  48. // Inverse the blinking feature
  49. //#define MY_WITH_LEDS_BLINKING_INVERSE
  50. // Enable software signing
  51. //#define MY_SIGNING_SOFT
  52. // Enable signing related debug
  53. //#define MY_DEBUG_VERBOSE_SIGNING
  54. // Enable this to request signatures
  55. //#define MY_SIGNING_REQUEST_SIGNATURES
  56. // Enable this to to weaken security for gradual deployment purpose
  57. // (see signing documentation for details)
  58. //#define MY_SIGNING_WEAK_SECURITY
  59. // Enables RF24 encryption (all nodes and gateway must have this enabled, and all must be
  60. // personalized with the same AES key)
  61. //#define MY_RF24_ENABLE_ENCRYPTION
  62. // Enable inclusion mode if your HA Controller supports it (e.g. Vera Controller)
  63. //#define MY_INCLUSION_MODE_FEATURE
  64. // Enable Inclusion mode button on gateway
  65. //#define MY_INCLUSION_BUTTON_FEATURE
  66. // Set inclusion mode duration (in seconds)
  67. //#define MY_INCLUSION_MODE_DURATION 60
  68. // Digital pin used for inclusion mode button
  69. //#define MY_INCLUSION_MODE_BUTTON_PIN 3
  70. #include <MySensors.h>
  71. #define ARDUINO 100
  72. // This space is intended to be used to include arduino libraries
  73. #undef ARDUINO
  74. void setup()
  75. {
  76. // Setup locally attached sensors
  77. }
  78. void presentation()
  79. {
  80. // Present locally attached sensors here
  81. }
  82. void loop()
  83. {
  84. // Send locally attached sensors data here
  85. }