simracingtools / ir2mqtt Goto Github PK
View Code? Open in Web Editor NEWSend MQTT messages based on iRacing telemetry
License: GNU General Public License v3.0
Send MQTT messages based on iRacing telemetry
License: GNU General Public License v3.0
Howdy, I'm trying to get this up and running and having an issue with the running the test file. Its blowing up at what looks to be session start, trying to handle the time zone from the track. Here's the console from the whole session.
I'm running the default base config, I've only changed the MQTT broker and added a few basic telemetry parameters.
Note, there was an error earlier in the session, but the time zone one is what kills the process.
=============================
| IR2MQTT |
| 1.7 |
=============================
MQTT host: oasserver
MQTT port: 1883
MQTT base: /sensors/iRacing
Debug output enabled
starting up using dump file: data/limerock-q.dmp
irsdk connected
Location: Observer(latitude=41.928641, longitude=-73.38105, elevation=164.01)
LocationInfo: LocationInfo(name='Lakeville', region='USA', timezone='America/New_York', latitude=41.928641, longitude=-73.38105)
sunrise start 2019-04-01 06:04:35.349539-04:00
sunrise end 2019-04-01 06:34:53.895901-04:00
sunset start 2019-04-01 19:20:37.716530-04:00
sunset end 2019-04-01 19:50:31.822780-04:00
Location: Observer(latitude=41.928641, longitude=-73.38105, elevation=164.01)
LocationInfo: LocationInfo(name='Lakeville', region='USA', timezone='America/New_York', latitude=41.928641, longitude=-73.38105)
MQTT: Connection successful
DEBUG mqtt_publish(/sensors/iRacing/state, 1)
Exception in thread Thread-1 (_thread_main):
Traceback (most recent call last):
File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
self.run()
File "/usr/lib/python3.10/threading.py", line 953, in run
self._target(*self._args, **self._kwargs)
File "/home/dave/dev/ir2mqtt/venv/lib/python3.10/site-packages/paho/mqtt/client.py", line 3591, in _thread_main
self.loop_forever(retry_first_connection=True)
File "/home/dave/dev/ir2mqtt/venv/lib/python3.10/site-packages/paho/mqtt/client.py", line 1756, in loop_forever
rc = self._loop(timeout)
File "/home/dave/dev/ir2mqtt/venv/lib/python3.10/site-packages/paho/mqtt/client.py", line 1164, in _loop
rc = self.loop_read()
File "/home/dave/dev/ir2mqtt/venv/lib/python3.10/site-packages/paho/mqtt/client.py", line 1556, in loop_read
rc = self._packet_read()
File "/home/dave/dev/ir2mqtt/venv/lib/python3.10/site-packages/paho/mqtt/client.py", line 2439, in _packet_read
rc = self._packet_handle()
File "/home/dave/dev/ir2mqtt/venv/lib/python3.10/site-packages/paho/mqtt/client.py", line 3039, in _packet_handle
return self._handle_connack()
File "/home/dave/dev/ir2mqtt/venv/lib/python3.10/site-packages/paho/mqtt/client.py", line 3138, in _handle_connack
on_connect(
File "/home/dave/dev/ir2mqtt/ir2mqtt.py", line 330, in on_connect
if state.local_date_time == -1:
AttributeError: 'State' object has no attribute 'local_date_time'
DEBUG mqtt_publish(/sensors/iRacing/eventtype, Race)
DEBUG mqtt_publish(/sensors/iRacing/practicetrackstate, carry over)
DEBUG mqtt_publish(/sensors/iRacing/currentsessiontype, Lone Qualify)
DEBUG mqtt_publish(/sensors/iRacing/ingarage, False)
DEBUG mqtt_publish(/sensors/iRacing/onpitroad, False)
DEBUG mqtt_publish(/sensors/iRacing/brake, 1.0)
DEBUG mqtt_publish(/sensors/iRacing/gear, 0)
DEBUG mqtt_publish(/sensors/iRacing/steeringwheelangle, 0.0)
session ToD: 2019-04-01T07:30:03 TZ: America/New_York
DEBUG mqtt_publish(/sensors/iRacing/ToD, 2019-04-01T11:30:03+0000)
local time: 2019-04-01 07:30:03-04:00
solar elevation: 9.179465919503954
DEBUG mqtt_publish(/sensors/iRacing/solarElevation, 9.179465919503954)
Traceback (most recent call last):
File "/home/dave/dev/ir2mqtt/ir2mqtt.py", line 411, in <module>
loop()
File "/home/dave/dev/ir2mqtt/ir2mqtt.py", line 248, in loop
publish_session_time()
File "/home/dave/dev/ir2mqtt/ir2mqtt.py", line 141, in publish_session_time
publish_light_info()
File "/home/dave/dev/ir2mqtt/ir2mqtt.py", line 153, in publish_light_info
date_and_time = datetime.astimezone(state.ir_location.timezone)
TypeError: descriptor 'astimezone' for 'datetime.datetime' objects doesn't apply to a 'America/New_York' object
Build setup package with InnoSetup
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.