Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Some changes, prevent CPU drain
  • Loading branch information
Iture committed Sep 28, 2017
1 parent f19c860 commit 11bbb1b
Show file tree
Hide file tree
Showing 8 changed files with 138 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -4,3 +4,4 @@
.idea/RFLinkGateway.iml
.idea/vcs.xml
.idea/workspace.xml
*.pyc
125 changes: 125 additions & 0 deletions .vscode/launch.json
@@ -0,0 +1,125 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Python",
"type": "python",
"request": "launch",
"stopOnEntry": true,
"pythonPath": "${config.python.pythonPath}",
"program": "${file}",
"debugOptions": [
"WaitOnAbnormalExit",
"WaitOnNormalExit",
"RedirectOutput"
]
},
{
"name": "Integrated Terminal/Console",
"type": "python",
"request": "launch",
"stopOnEntry": true,
"pythonPath": "${config.python.pythonPath}",
"program": "${file}",
"console": "integratedTerminal",
"debugOptions": [
"WaitOnAbnormalExit",
"WaitOnNormalExit"
]
},
{
"name": "External Terminal/Console",
"type": "python",
"request": "launch",
"stopOnEntry": true,
"pythonPath": "${config.python.pythonPath}",
"program": "${file}",
"console": "externalTerminal",
"debugOptions": [
"WaitOnAbnormalExit",
"WaitOnNormalExit"
]
},
{
"name": "Django",
"type": "python",
"request": "launch",
"stopOnEntry": true,
"pythonPath": "${config.python.pythonPath}",
"program": "${workspaceRoot}/manage.py",
"args": [
"runserver",
"--noreload"
],
"debugOptions": [
"WaitOnAbnormalExit",
"WaitOnNormalExit",
"RedirectOutput",
"DjangoDebugging"
]
},
{
"name": "Flask",
"type": "python",
"request": "launch",
"stopOnEntry": false,
"pythonPath": "${config.python.pythonPath}",
"program": "fully qualified path fo 'flask' executable. Generally located along with python interpreter",
"env": {
"FLASK_APP": "${workspaceRoot}/quickstart/app.py"
},
"args": [
"run",
"--no-debugger",
"--no-reload"
],
"debugOptions": [
"WaitOnAbnormalExit",
"WaitOnNormalExit",
"RedirectOutput"
]
},
{
"name": "Flask (old)",
"type": "python",
"request": "launch",
"stopOnEntry": false,
"pythonPath": "${config.python.pythonPath}",
"program": "${workspaceRoot}/run.py",
"args": [],
"debugOptions": [
"WaitOnAbnormalExit",
"WaitOnNormalExit",
"RedirectOutput"
]
},
{
"name": "Watson",
"type": "python",
"request": "launch",
"stopOnEntry": true,
"pythonPath": "${config.python.pythonPath}",
"program": "${workspaceRoot}/console.py",
"args": [
"dev",
"runserver",
"--noreload=True"
],
"debugOptions": [
"WaitOnAbnormalExit",
"WaitOnNormalExit",
"RedirectOutput"
]
},
{
"name": "Attach (Remote Debug)",
"type": "python",
"request": "attach",
"localRoot": "${workspaceRoot}",
"remoteRoot": "${workspaceRoot}",
"port": 3000,
"secret": "my_secret",
"host": "localhost"
}
]
}
3 changes: 3 additions & 0 deletions .vscode/settings.json
@@ -0,0 +1,3 @@
{
"python.pythonPath": "/usr/local/bin/python3"
}
Empty file modified MQTTClient.py 100755 → 100644
Empty file.
Empty file modified RFLinkGateway.py 100755 → 100644
Empty file.
1 change: 1 addition & 0 deletions SerialProcess.py 100755 → 100644
Expand Up @@ -67,6 +67,7 @@ def connect(self):
self.logger.info('Connecting to serial')
while not self.sp.isOpen():
try:
time.sleep(1)
self.sp = serial.Serial(self.gatewayPort, 57600, timeout=1)
self.logger.debug('Serial connected')
except Exception as e:
Expand Down
4 changes: 2 additions & 2 deletions config.json
Expand Up @@ -4,7 +4,7 @@
"mqtt_prefix": "/data/RFLINK",
"mqtt_message_timeout": 60,
"rflink_tty_device": "/dev/ttyUSB0",
"rflink_ignored_devices": [
"rflink_direct_output_params": [
"BAT",
"CMD",
"SET_LEVEL",
Expand All @@ -14,4 +14,4 @@
"PIR",
"SMOKEALERT"
]
}
}
12 changes: 6 additions & 6 deletions readme.md
@@ -1,9 +1,9 @@
#RFLink Gateway to MQTT
# RFLink Gateway to MQTT

##Purpose
## Purpose
Bridge between RFLink Gateway and MQTT broker.

##Current features
## Current features
Forwarding messages received on TTY port from RFLink Gateway Arduino board
to MQTT broker in both directions.

Expand All @@ -27,7 +27,7 @@ Message:
Every message received on particular MQTT topic is translated to
RFLink Gateway and sent to 433 MHz.

##Configuration
## Configuration

Whole configuration is located in config.json file.

Expand All @@ -49,7 +49,7 @@ config param | meaning
| rflink_tty_device | Arduino tty device |
| rflink_ignored_devices | Parameters transferred to MQTT without any processing|

##Output data
## Output data
Application pushes informations to MQTT broker in following format:
[mqtt_prefix]/[device_type]/[device_id]/R/[parameter]

Expand All @@ -61,6 +61,6 @@ Every change should be published to topic:
`/data/RFLINK/TriState/8556a8/W/1 ON`


##References
## References
- RFLink Gateway project http://www.nemcon.nl/blog2/
- RFLink Gateway protocol http://www.nemcon.nl/blog2/protref

0 comments on commit 11bbb1b

Please sign in to comment.