Skip to content

Instantly share code, notes, and snippets.

@njh
Last active August 16, 2024 20:24
Show Gist options
  • Save njh/3c213347931867b1a3b09b93c98e9c50 to your computer and use it in GitHub Desktop.
Save njh/3c213347931867b1a3b09b93c98e9c50 to your computer and use it in GitHub Desktop.
Mitsubishi i-Miev filters for WiCAN
{
"can_flt": [
{
"CANID": 905,
"Name": "ac_volts",
"PID": -1,
"PIDIndex": 1,
"StartBit": 8,
"BitLength": 8,
"Expression": "V",
"Cycle": 9999
},
{
"CANID": 905,
"Name": "ac_amps",
"PID": -1,
"PIDIndex": 1,
"StartBit": 48,
"BitLength": 8,
"Expression": "V/10",
"Cycle": 9999
},
{
"CANID": 884,
"Name": "soc",
"PID": -1,
"PIDIndex": 1,
"StartBit": 8,
"BitLength": 8,
"Expression": "(V-10)/2",
"Cycle": 9999
},
{
"CANID": 838,
"Name": "range",
"PID": -1,
"PIDIndex": 1,
"StartBit": 56,
"BitLength": 8,
"Expression": "V",
"Cycle": 9999
},
{
"CANID": 1042,
"Name": "odometer",
"PID": -1,
"PIDIndex": 1,
"StartBit": 16,
"BitLength": 24,
"Expression": "V",
"Cycle": 9999
},
{
"CANID": 883,
"Name": "dc_amps",
"PID": -1,
"PIDIndex": 1,
"StartBit": 16,
"BitLength": 16,
"Expression": "(V - 32385)/100",
"Cycle": 9999
},
{
"CANID": 883,
"Name": "dc_volts",
"PID": -1,
"PIDIndex": 1,
"StartBit": 32,
"BitLength": 16,
"Expression": "V/10",
"Cycle": 9999
}
]
}
#!/bin/sh
#
# This bash script can be used for publishing
# the filter setting to a WiCAN device
#
# Get current filters:
# curl -s http://192.168.80.1/load_canflt | jq
exec curl \
--silent \
--show-error \
--header "Content-Type: application/json" \
--data '@mitsubishi-imiev-wican-filters.json' \
http://192.168.80.1/store_canflt
# FIXME: tell it to reboot?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment