From 2e82495118b3d20fae8cfb694c7d0ee47660e78b Mon Sep 17 00:00:00 2001 From: Arne Schwarck Date: Fri, 27 Mar 2020 21:27:12 +0100 Subject: [PATCH] ipAddress over capnp --- selfdrive/thermald/thermald.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/selfdrive/thermald/thermald.py b/selfdrive/thermald/thermald.py index 3f7ba8692a13ef..944ff7be1eef3e 100755 --- a/selfdrive/thermald/thermald.py +++ b/selfdrive/thermald/thermald.py @@ -17,6 +17,7 @@ from selfdrive.version import terms_version, training_version from selfdrive.swaglog import cloudlog import cereal.messaging as messaging +import cereal.messaging_arne as messaging_arne from selfdrive.loggerd.config import get_available_percent from selfdrive.pandad import get_expected_version from selfdrive.thermald.power_monitoring import PowerMonitoring, get_battery_capacity, get_battery_status, get_battery_current, get_battery_voltage, get_usb_present @@ -193,7 +194,7 @@ def thermald_thread(): params = Params() pm = PowerMonitoring() - + arne_pm = messaging_arne.PubMaster('ipAddress') while 1: health = messaging.recv_sock(health_sock, wait=True) location = messaging.recv_sock(location_sock) @@ -242,8 +243,12 @@ def thermald_thread(): except: ip_addr = 'N/A' ts_last_ip = ts - params.put("IPAddress", ip_addr) - + params.put("IPAddress", ip_addr) + msg = messaging_arne.new_message() + msg.init('ipAddress ') + msg.ipAddress.ipAddr = ip_addr + arne_pm.send('ipAddress', msg) + current_filter.update(msg.thermal.batteryCurrent / 1e6) # TODO: add car battery voltage check