-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add cvs writer and replayer #77
base: master
Are you sure you want to change the base?
Conversation
…tt lib subscriber example
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ephem
should be added to the requirements.txt
.
#field_names = sorted(data.keys()) | ||
field_names = ['n', 'timestamp', *[k for k in data if k not in ('n', 'timestamp')]] | ||
# Check if the CSV file is empty | ||
is_empty = os.stat(csv_file_path).st_size == 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should also use pathlib
.
|
||
# main | ||
|
||
def main(host=HOST, port=PORT, topic=TOPIC): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this works. These values are always overridden by the args.*
ones.
|
||
HOST = 'samrpi1.local' | ||
PORT = 1883 | ||
KEEPALIVE = 60 # in seconds |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is already the default, it can probably be removed:
KEEPALIVE = 60 # in seconds |
import os | ||
import csv | ||
import time | ||
import json | ||
import paho.mqtt.client as mqtt | ||
import asyncio | ||
from simoc_sam.sensors import utils | ||
import ephem | ||
import datetime |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import os | |
import csv | |
import time | |
import json | |
import paho.mqtt.client as mqtt | |
import asyncio | |
from simoc_sam.sensors import utils | |
import ephem | |
import datetime | |
import os | |
import csv | |
import time | |
import json | |
import asyncio | |
import datetime | |
import ephem | |
import paho.mqtt.client as mqtt | |
from simoc_sam.sensors import utils |
|
||
HOST = 'samrpi1.local' | ||
PORT = 1883 | ||
KEEPALIVE = 10 # in seconds |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
KEEPALIVE = 10 # in seconds |
This can be removed and use the default of 60.
Co-authored-by: Franco Carbognani <fcarbogn@gmail.com>
import datetime | ||
|
||
|
||
HOST = 'samrpi1.local' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
During the mission this was updated to sambridge1
No description provided.