-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
31 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,37 @@ | ||
from csclient import EventingCSClient | ||
cp = EventingCSClient('mqtt_app') | ||
|
||
MQTT_CLIENT_ID = cp.get('config/system/system_id') | ||
|
||
# settings.py | ||
# MQTT Server settings | ||
MQTT_SERVER = 'test.mosquitto.org' | ||
MQTT_PORT = 1883 | ||
MQTT_USER_NAME = 'anonymous' | ||
MQTT_PASSWORD = 'anonymous' | ||
|
||
# MQTT Topics | ||
# Topics are named the same as the path to get the data from the | ||
# NCOS device. This was done for simplicity. | ||
GPS_TOPIC = '/status/gps/lastpos' | ||
MODEM_TEMP_TOPIC = '/status/system/modem_temperature' | ||
WAN_CONNECTION_STATE_TOPIC = '/status/wan/connection_state' | ||
# Seconds between publishing | ||
PUBLISH_INTERVAL = 10 | ||
|
||
# Each topic is a dictionary, containing the {name: path} of each value to publish | ||
|
||
topics = { | ||
'gps': { | ||
'latitude': '/status/gps/lastpos/latitude', | ||
'longitude': '/status/gps/lastpos/longitude', | ||
'age': '/status/gps/lastpos/age', | ||
'timestamp': '/status/gps/lastpos/timestamp', | ||
'accuracy': '/status/gps/fix/accuracy', | ||
'altitude_meters': '/status/gps/fix/altitude_meters', | ||
'ground_speed_knots': '/status/gps/fix/ground_speed_knots', | ||
'heading': '/status/gps/fix/heading', | ||
'satellites': '/status/gps/fix/satellites', | ||
|
||
}, | ||
'status': { | ||
'system_id': 'config/system/system_id', | ||
'active_wan': 'status/wan/primary_device', | ||
'connection_state': '/status/wan/connection_state', | ||
'wan_in_bps': 'status/wan/stats/ibps', | ||
'wan_out_bps': 'status/wan/stats/obps', | ||
'lan_clients': 'status/lan/clients', | ||
'wlan_clients': 'status/wlan/clients', | ||
'temperature': '/status/system/temperature', | ||
'usb_state': 'status/usb/connection/state' | ||
} | ||
} |