0

Help mimicking truck canbus & rpm's; Parker IQAN MD3

rstuckey 2 weeks ago in IQANdesign updated 2 weeks ago 1

I purchased a garbage truck side-loader hydraulic arm from a salvage yard and am working to retrofit it onto my truck to improve time and safety. trouble is, the truck i am installing it on is older, and runs off 1708 protocol. the hydraulic system electrical system (parker iqan) wants to tap into the truck chassis and listen for j1939 engine speed <900 rpm in order to allow the arm to work. I am working to setup a raspberry pi with a waveshare 2 ch can hat to simulate a heavy truck can bus network with engine speed message so that i can use the arm.
here's my current setup -
- can hat (https://www.waveshare.com/2-ch-can-hat.htm)- Raspberry Pi 4 Model B Rev 1.1- can0-h wired into can1-h- can0-l wired into can1-l- both terminating resistors on the can hat are enabled - j1939 chassis connection wires spliced into my can hat jumpers - h to h and l to l - the parker iqan system is working and properly terminated itself (md3 communicating to 2 xa2 modules, properly terminated)- in this setup i am hoping to mimic a heavy truck network- toggling between 250/500k baud (company isn't sure which one the parker iqan md3 is looking for)
i have been trying numerous code iterations to mimic an rpm message on my can bus network. i haven't been able to get the parker iqan hydraulic electrical system to recognize an rpm. the j1939 page on the parker iqan md3 display module just shows !!! 0.00 with a timeout message underneath.

Here is my latest code: (i have tried 250k and 500k)

#!/home/rob/canenv/bin/python3
import can
import time
import os
import sys

# Function to configure CAN interfaces
def setup_can_interfaces():
try:
os.system("sudo ip link set can0 down")
os.system("sudo ip link set can1 down")
os.system("sudo ip link set can0 type can bitrate 500000")
os.system("sudo ip link set can1 type can bitrate 500000")
os.system("sudo ip link set can0 up")
os.system("sudo ip link set can1 up")
print("CAN0 and CAN1 configured successfully")
except Exception as e:
print(f"Error configuring CAN interfaces: {e}")
sys.exit(1)

# Main function to send J1939 messages
def main():
setup_can_interfaces()
try:
bus0 = can.interface.Bus(channel='can0', interface='socketcan', bitrate=500000)
bus1 = can.interface.Bus(channel='can1', interface='socketcan', bitrate=500000)
except Exception as e:
print(f"Error initializing CAN buses: {e}")
sys.exit(1)

# Updated message with new CAN ID
main_msg = can.Message(
arbitration_id=0x0CF00401, # Updated CAN ID
data=[0xFF, 0xFF, 0xFF, 0x68, 0x13, 0xFF, 0xFF, 0xFF], # Specified data bytes
is_extended_id=True
)

print("Starting J1939 simulation with updated CAN ID 0x0CF00401...")
while True:
try:
bus0.send(main_msg)
time.sleep(0.1)
except Exception as e:
print(f"Error sending messages: {e}")
time.sleep(1)

if __name__ == "__main__":
main()

Here is latest output via candump: 

can1 0CF00401 [8] FF FF FF 68 13 FF FF FF
can1 0CF00401 [8] FF FF FF 68 13 FF FF FF
can1 0CF00401 [8] FF FF FF 68 13 FF FF FF
can1 0CF00401 [8] FF FF FF 68 13 FF FF FF
can1 0CF00401 [8] FF FF FF 68 13 FF FF FF
can1 0CF00401 [8] FF FF FF 68 13 FF FF FF

any help appreciated. 

Kevin Grover helped me get it figured out. Message ID needed to be 0CF00401. Thanks!