Commit fc4b6332 authored by Nelso Jost's avatar Nelso Jost

FIX: rtc detection removed

parent 54640d6e
......@@ -107,7 +107,7 @@ bu: ${USE}-install
bus: bu serial
sync-rtc:
${VENV}/bin/python${PYVER} run.py --syncrtc
${VENV}/bin/python${PYVER} logger/run.py --syncrtc
run:
${VENV}/bin/python logger/run.py
......
......@@ -282,10 +282,10 @@ class Meteorologger:
def sync_rtc(self, port_index=None):
if isinstance(port_index, int):
serial_port = self.CFG['ARDUINO']['SERIAL_PORT'][port_index]
else:
serial_port = self.SERIAL_PORTS[0]
if not isinstance(port_index, int):
port_index = 0
serial_port = self.CFG['ARDUINO']['SERIAL_PORTS'][port_index]
# if present, the board will be reseted
ser = serial.Serial(serial_port, self.CFG['ARDUINO']['BAUD_RATE'],
......
......@@ -60,6 +60,8 @@ RTC_DS1307 rtc;
String read_RTC_DS1307()
{
return get_datetime_str(rtc.now());
if (rtc.isrunning())
{
return get_datetime_str(rtc.now());
......@@ -92,10 +94,11 @@ String get_datetime_str(DateTime dt)
// Expects something like "2015,6,28,13,13,10"
String set_time_from_csv(String s)
{
/*
if (!rtc.isrunning())
{
return String("<RTC_DS1307_not_found>");
}
} */
DateTime dt;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment