🏴: Difference between revisions

From Noisebridge
Jump to navigation Jump to search
(CAN to SQLite)
m (→‎hack'n around: wheel speeds)
 
Line 53: Line 53:
import sqlite3
import sqlite3
import pandas
import pandas
conn = sqlite3.connect('data.db')
conn = sqlite3.connect('data.db')
df = pandas.read_csv('data.csv')
df = pandas.read_csv('data.csv')
df.to_sql('can', conn, if_exists='append', index=False)
df.to_sql('can', conn, if_exists='append', index=False)
# get and show 100 samples of wheel speed data with a time over 100
cur = conn.cursor()
cur.execute("SELECT * FROM can WHERE addr = 464 AND time > 100 LIMIT 100")
rows = cur.fetchall()
rows
conn.close()
</pre>
</pre>

Latest revision as of 16:29, 9 January 2018

Hack teh Cabañas here https://community.comma.ai/cabana/?demo=1337

"Cabana" is a tool for deciphering CAN data, which is what cars use for talking to themselves.


Get a 🐼 here: https://shop.comma.ai/products/panda-obd-ii-dongle

Build a 🐼 here: DIY Panda




🏴


"app notes"[edit | edit source]

some features ONLY work in chrome, and there are some issues on linux with chromium

  • Fix double scroll bars
  • Add better grabbers for bit selection
  • Make segment selection clearer in plot
  • Show multi-signal overlay


dumpster dive data[edit | edit source]

Messages sorted by highest event count, with a descriptive'ish name and unique ID.


acura_ilx_2016_can.dbc[edit | edit source]

Identified bit that looks like some kind of watchdog or interupt trigger when vehicle is moving above min speed.

ID     Signal                Note
1:400  SMOOTH_CRUISE_PING    bit 20 some kind of flag/watchdog triggers at regular interval when moving above min speed
       X_COUNT_UP_10_SEC     also contains 10 second incremental count in last byte.


hack'n around[edit | edit source]

You can use the save log button to get a csv file of the data, this only works with chrome and some versions of chromium.

The following converts the csv file to a sqlite3 database file name 'data.db', with a table named 'can' containing all the records.

import sqlite3
import pandas

conn = sqlite3.connect('data.db')

df = pandas.read_csv('data.csv')
df.to_sql('can', conn, if_exists='append', index=False)

# get and show 100 samples of wheel speed data with a time over 100
cur = conn.cursor()
cur.execute("SELECT * FROM can WHERE addr = 464 AND time > 100 LIMIT 100")
rows = cur.fetchall()
rows

conn.close()