Getting Started - Send simple LIN message

Help and Assistance requestes

Getting Started - Send simple LIN message

Postby ADuval » Thu Jun 21, 2018 4:41 pm

I am trying to find how to simply send correct LIN message but I am struggling since few weeks now.
Basically, I want the Carberry to act like a master. I can simulate the LIN message with CANoe (tool from vector). In attachment you can see the LIN message I have to send (the one with the ID = A).
So the ID is A and the Data are FF 80 C0 C0 E0 80 10 FF.
How can I do the same thing with Carberry?
I tried:

#!/usr/bin/env python

import socket

TCP_IP = '127.0.0.1'
TCP_PORT = 7070
BUFFER_SIZE = 1024
MESSAGE1 = "LIN OPEN MASTER1X 19200 \r\n"
MESSAGE2 = "LIN RQ 10 \r\n"
MESSAGE3 = "LIN CLOSE \r\n"

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((TCP_IP, TCP_PORT))

s.send(MESSAGE1)
data = s.recv(BUFFER_SIZE)
print "received data:", data

s.send(MESSAGE2)
data = s.recv(BUFFER_SIZE)
print "received data:", data

s.send(MESSAGE3)
data = s.recv(BUFFER_SIZE)
print "received data:", data

s.close()


I don't know if I am doing in the right direction but I only get the answer "OK" and nothing happen.

Thanks for helping
Have a nice day
Attachments
SBBR.PNG
SBBR.PNG (10.5 KiB) Viewed 924 times
ADuval
 
Posts: 8
Joined: Fri May 18, 2018 10:07 am

Re: Getting Started - Send simple LIN message

Postby AChaalane » Wed Jul 11, 2018 5:22 pm

In order to send a LIN message as MASTER, you need to add a pull up resistance of 1K at the LIN 12V wire of the Carberry.
Second, if you want to send a message with data, you need to use the FREE MODE ( AS MENTIONED IN THE Wiki).
Ex:
LIN OPEN FREE 20000 //message1
LIN TX 03 (pid) 01 01 (data) FA (checksum) //message2
LIN CLOSE //message3
AChaalane
 
Posts: 9
Joined: Wed Apr 18, 2018 10:38 am
Location: France


Return to Help

Who is online

Users browsing this forum: No registered users and 1 guest

cron