Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mono #14

Merged
merged 31 commits into from
Apr 19, 2021
Merged

Mono #14

Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
small bug
  • Loading branch information
luke-iqt committed Mar 22, 2021
commit 11e17f83deb3010fe62feec187e07ba16fedeafb
47 changes: 32 additions & 15 deletions Config.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -159,16 +159,16 @@
},
{
"cell_type": "code",
"execution_count": 54,
"execution_count": 61,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<paho.mqtt.client.MQTTMessageInfo at 0x7f8d0104a2c0>"
"<paho.mqtt.client.MQTTMessageInfo at 0x7f8d010529f0>"
]
},
"execution_count": 54,
"execution_count": 61,
"metadata": {},
"output_type": "execute_result"
}
Expand Down Expand Up @@ -198,19 +198,18 @@
},
{
"cell_type": "code",
"execution_count": 41,
"execution_count": 60,
"metadata": {},
"outputs": [
{
"ename": "NameError",
"evalue": "name 'json' is not defined",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-41-d2d74bd3e78d>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[1;32m 2\u001b[0m \u001b[0mdata\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m{\u001b[0m\u001b[0;34m}\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 3\u001b[0m \u001b[0mdata\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m'cameraZoom'\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;36m9999\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 4\u001b[0;31m \u001b[0mjson_data\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mjson\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdumps\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mdata\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 5\u001b[0m \u001b[0mclient\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpublish\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"skyscan/config/json\"\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mjson_data\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mNameError\u001b[0m: name 'json' is not defined"
]
"data": {
"text/plain": [
"<paho.mqtt.client.MQTTMessageInfo at 0x7f8d01052310>"
]
},
"execution_count": 60,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
Expand All @@ -231,16 +230,34 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 59,
"metadata": {},
"outputs": [],
"outputs": [
{
"data": {
"text/plain": [
"<paho.mqtt.client.MQTTMessageInfo at 0x7f8d0104af90>"
]
},
"execution_count": 59,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"client.connect(broker)\n",
"data = {}\n",
"data['minElevation'] = 45 # Update this Value\n",
"json_data = json.dumps(data)\n",
"client.publish(\"skyscan/config/json\",json_data)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
2 changes: 1 addition & 1 deletion tracker/flighttracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ def update_config(config):
logging.info("Setting Camera Lead to: {}".format(camera_lead))
if "minElevation" in config:
min_elevation = int(config["minElevation"])
logging.info("Setting Min. Elevation to: {}".format(minElevation))
logging.info("Setting Min. Elevation to: {}".format(min_elevation))

def on_message(client, userdata, message):
global camera_altitude
Expand Down