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

Add cvs writer and replayer #77

Open
wants to merge 28 commits into
base: master
Choose a base branch
from

Conversation

fcarbogn
Copy link
Collaborator

@fcarbogn fcarbogn commented Mar 4, 2024

No description provided.

Copy link
Collaborator

@ezio-melotti ezio-melotti left a 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.

src/simoc_sam/csv_writer.py Outdated Show resolved Hide resolved
src/simoc_sam/csv_writer.py Outdated Show resolved Hide resolved
src/simoc_sam/csv_writer.py Outdated Show resolved Hide resolved
#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
Copy link
Collaborator

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.

src/simoc_sam/csv_writer.py Outdated Show resolved Hide resolved

# main

def main(host=HOST, port=PORT, topic=TOPIC):
Copy link
Collaborator

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
Copy link
Collaborator

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:

Suggested change
KEEPALIVE = 60 # in seconds

Comment on lines +1 to +9
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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
KEEPALIVE = 10 # in seconds

This can be removed and use the default of 60.

src/simoc_sam/csv_writer.py Outdated Show resolved Hide resolved
import datetime


HOST = 'samrpi1.local'
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants