I gathered a lot of information from all kind of sources and I think I'm pretty close, but still doing something wrong since I always receive "NO DATA".
I hope somebody here can put me to the right direction. This is my script:
Code: Select all
#!/usr/bin/expect
telnet 192.168.0.10 35000
# Reset scanner
send "ATZ\r"
expect "ELM327 v1.3a"
# Add line feed (enter)
send "ATL1\r"
expect "OK"
# Protocol selection (I tried different protocols here, not sure which one I should use)
#HS CAN (ISO 15765, 11-bit Tx, 500kbps, DLC=8)
send "STP33\r"
expect "OK"
# Turn headers on
send "ATH1\r"
expect "OK"
# I have a list of Control Module Id's, this is an example for "Air Suspension Control Module (RequestId: 245 ResponseId: 545)"
# Set the header
send "ATSH 245\r"
expect "OK"
# Set the response id filter
# As each message is received, the incoming CAN ID bits are compared to the CAN Filter bits (when the mask bit is a ‘1’, 7FF = 11111111111).
send "ATCM 7FF\r"
expect "OK"
send "ATCF 545\r"
expect "OK"
# Ask for trouble codes
send "A981DA\r"
expect "NO DATA" #<-- It always gives me this, even if I have a error code in the car display