Commit c72675ea authored by Nelso Jost's avatar Nelso Jost

FIX: float LDR readings; server api usage;

parent 58237269
...@@ -31,7 +31,7 @@ clean-venv: ...@@ -31,7 +31,7 @@ clean-venv:
rm -rf ${VENV} rm -rf ${VENV}
log: log:
@ ${VENV}/bin/python meteorolog.py @ ${VENV}/bin/python logger.py
testserial: testserial:
@ ${VENV}/bin/ipython test_serial.py @ ${VENV}/bin/ipython test_serial.py
......
...@@ -56,7 +56,7 @@ class Meteorologger: ...@@ -56,7 +56,7 @@ class Meteorologger:
if not self.CFG['BASE_URL'].endswith('/'): if not self.CFG['BASE_URL'].endswith('/'):
self.CFG['BASE_URL'] += '/' self.CFG['BASE_URL'] += '/'
self.URL = self.CFG['BASE_URL'] + 'api/board/post/rawsensordata/{}'\ self.URL = self.CFG['BASE_URL'] + 'api/post/rawsensordata/{}'\
.format(self.CFG['BOARD_ID']) .format(self.CFG['BOARD_ID'])
self.SENSORS_CSV_LINE = self.CSV_SEP.join([d['nickname'] for d in self.SENSORS_CSV_LINE = self.CSV_SEP.join([d['nickname'] for d in
...@@ -200,7 +200,7 @@ class Meteorologger: ...@@ -200,7 +200,7 @@ class Meteorologger:
print('\n-----------------------------------------------------') print('\n-----------------------------------------------------')
csv_result = self.serial_read_sensors(self.SENSORS_CSV_LINE, csv_result = self.serial_read_sensors(self.SENSORS_CSV_LINE,
serial_port=serial_port) serial_port=serial_port)
print("csv_result: ", csv_result, type(csv_result)) print("csv_result: '{}'".format(csv_result))
if csv_result is not None: if csv_result is not None:
json_raw_data = self.create_json_raw_sensor_data(csv_result) json_raw_data = self.create_json_raw_sensor_data(csv_result)
self.add_data_log(json_raw_data) self.add_data_log(json_raw_data)
......
# server's full base address for sendind requests (must end with /) # server's full base address for sendind requests (must end with /)
BASE_URL: http://localhost:5000/ BASE_URL: http://localhost:5000/
# board to upload data baka
BOARD_ID: 2 BOARD_ID: 2
SENSORS: SENSORS:
...@@ -15,12 +14,12 @@ SENSORS: ...@@ -15,12 +14,12 @@ SENSORS:
data_format: INTEGER data_format: INTEGER
- nickname: LDR - nickname: LDR
data_format: INTEGER data_format: FLOAT
SERIAL_PORT: /dev/ttyACM0, /dev/ttyACM1 SERIAL_PORT: /dev/ttyACM0, /dev/ttyACM1
BAUD_RATE: 9600 # 115200 seems unstable with Uno + PySerial BAUD_RATE: 9600 # 115200 seems unstable with Uno + PySerial
READING_INTERVAL_SECONDS: 2 READING_INTERVAL_SECONDS: 5
EXPORT_CSV_SEP: '\t' EXPORT_CSV_SEP: '\t'
DATA_LOG_FILENAME: datalog.csv DATA_LOG_FILENAME: datalog.csv
......
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