How to Verify J1708 with BB Streamer on IR 829

  • Stop the J1939 script:
    conf t
    no ev m p BB_J1939_rawtcp.tcl
    end


  • Copy-paste below code into the TCL shell:


set allDataReceived 0
set responseReceived 0
set dataReceived 0
proc bgerror {message} {
global allDataReceived
after cancel $cmdTimeoutId
log "ERROR: $message"
set allDataReceived 3
}
proc handleCmdTimeout {} {
global cmdTimeoutId
global allDataReceived
after cancel $cmdTimeoutId
puts "ERROR: Response timeout"
set allDataReceived 2
}
proc handleResponse { connection } {
global allDataReceived
global cmdTimeoutId
global responseReceived
global dataReceived
after cancel $cmdTimeoutId
set response [read -nonewline $connection]
binary scan $response H* responseReceived
puts "response: $responseReceived"
set allDataReceived 1
}
proc sendcmd { cmd } {
global connection
global cmdTimeoutId
global allDataReceived
set allDataReceived 0
puts -nonewline $connection [binary format H* $cmd]
set cmdTimeoutId [after [expr 5 * 1000] handleCmdTimeout]
vwait allDataReceived
}
proc setup {} {
global connection
set BBKeyIP 10.0.0.10
set BBKeyPort 5002
if {[catch {set connection [socket $BBKeyIP $BBKeyPort]} errmsg]} {
puts "ERROR: Unable to connect to BB ODB Streamer key at, $BBKeyIP:$BBKeyPort, $errmsg"
return
}
fconfigure $connection -translation binary -blocking 0 -buffering none -encoding binary
fileevent $connection r "handleResponse $connection"
puts "Connected to OBDII Streamer"
}


  • Then run:

setup
sendcmd 010202000005
sendcmd 010201110015


  • J1708 streaming is now activated. Capture the response received from the key. Wait 3 secs and send:

sendcmd 010201100014


  • J1708 streaming is now stopped. If needed, re-enable your J1939 script:
    conf t
    ev m p BB_J1939_rawtcp.tcl
    end