can-bus

Count items in dictionary

只谈情不闲聊 提交于 2019-12-11 16:14:38
问题 I need to count the the different IDENTIFIERS and print a number count for the them. The information comes from a data stream that looks like this: IDENTIFIER 7756753.940 receivetest: m s 0x0000069a 8 00 00 00 00 00 e4 8a 9a 7756754.409 receivetest: m s 0x00000663 8 2f 00 62 02 00 e4 8a 9a 7756754.878 receivetest: m s 0x0000069e 8 00 1f 5e 28 34 83 59 1a 7756755.348 receivetest: m s 0x00000690 8 00 18 00 28 34 83 59 1a 7756853.908 receivetest: m s 0x0000069a 8 00 00 00 00 00 e4 8a 9a 7756854

Can-bus Filter and Mask Logic

ぃ、小莉子 提交于 2019-12-11 07:47:57
问题 I want to understand below code, why the filter 0x100 between 1xFF address. Mask value is 1110000000000000 (16 bit) and filter value is 10000000000000. That mean my ids could be 100 100000000000(16bit), 100 00100000000(16 bit) etc. ( 100 .. side must be constant all ids. But the 0x100 value is 100000000 (9 bit) how this possible I can not understand.How it compares 9-bit and 16-bit id ? HAL_StatusTypeDef CAN_Filter_Init(CAN_HandleTypeDef *hcanxx) { CAN_FilterTypeDef can_filter_config; //100

Temperature Conversion 2 byte

╄→尐↘猪︶ㄣ 提交于 2019-12-11 02:57:38
问题 I have difficulty in converting two bytes in temperature. I have a control unit (temperature sensor) where I get the message of temperature with two bytes. 1 ) Example: message: [ 40 ][ 25 ] LSBYTE : [ 40 ] MSBYTE : [ 25 ] 0.03125 C/bit temperature: 25C° ( seen from the display of the control unit ) 2 ) Example: message: [ 40 ][ 26 ] LSBYTE : [ 40 ] MSBYTE : [ 26 ] 0.03125 C/bit temperature: 30C° ( seen from the display of the control unit ) 3 ) Example: message: [ 20 ][ 26 ] LSBYTE : [ 20 ]

How does socketcan handle arbitration?

人盡茶涼 提交于 2019-12-11 01:34:06
问题 I pretty much understand how the CAN protocol works -- when two nodes attempt to use the network at the same time, the lower id can frame gets priority and the other node detects this and halts. This seems to get abstracted away when using socketcan - we simply write and read like we would any file descriptor. I may be misunderstanding something but I've gone through most of the docs (http://lxr.free-electrons.com/source/Documentation/networking/can.txt) and I don't think it's described

CAPL Programming usage of Timer as a delay

霸气de小男生 提交于 2019-12-10 17:49:31
问题 I have been writing a CAPL script that would send message on each channel (2 no's) after a certain delay. The following delay i want to generate using SetTimer() and mstimer::isRunning function. I can use setTimer function but I dont know how to use mstimer::isRunning . The code is shown below: Variables{ message * temp = {DLC=8}; mstimer timer1; } on timer timer1{ //Do nothing } onstart{ for(noofChannel=1;noofChannel<=2;noofChannel++){ settimer(timer1,100); temp.CAN = noofChannel; temp.ID =

How do I convert .blf data from CAN to .csv using python

故事扮演 提交于 2019-12-10 10:02:47
问题 I have CAN-Data in the blf-format from the Vector software. For further investigation I want to convert it into csv format using python. My progress so far: import can filename = "test.blf" log = can.BLFReader(filename) I dont know if thats the right way. I can't save "log" to a csv file now. This might help 回答1: List of that object does the trick import can import csv filename = "test.blf" log = can.BLFReader("test.blf") log = list(log) log_output = [] for msg in log: msg = str(msg) log

boost::asio over SocketCAN

时光怂恿深爱的人放手 提交于 2019-12-06 22:03:54
问题 I was thinking of making use of Boost Asio to read data from a Socket CAN. There's nothing fancy going on in linux/can.h , and the device should behave like the loopback interface, and be used with a raw socket. Looking at the basic_raw_socket interface it seems that I can make use of basic_raw_socket::assign to assign the native socket created with socket( PF_CAN, SOCK_RAW, CAN_RAW ); This is what I have so far namespace can { class CanSocket { public: typedef boost::asio::ip::basic_endpoint

Best way to display high-speed data from a telnet interface on a web view?

我的未来我决定 提交于 2019-12-06 08:11:18
问题 I'd like to display data coming off a telnet interface on a web view. I have a daemon running which reads CAN bus data and produces about 500 lines of ~40 characters per second onto a telnet port. It's a few messages running at 100 Hz and most others running at 10 or 5 Hz, so in sum it's about 500 / second. I want to grab the latest values in each packet and display those on a web page. The web page is loaded locally (not via HTTP) and the daemon might be on a different host, so there is

How to write a CanOpen stack?

限于喜欢 提交于 2019-12-06 06:15:24
I have a similar problem with this. How to program a simple CANopen layer . I read the answers but I have to program a CANopen layer on my own I cannot get a commercial one. So are there any basics of writing a CANopen stack (or layer I'm not certain about the difference)? I don't know even where to start.. If it's required here's some information : My master device is a beagle bone black with QNX. QNX has a generic CAN library I think but not specific to CANopen. And my slave is a militarized brushless motor controller. I'm writing in C++. I have a documentation about the general requirements

Socket-CAN virtual bus

大城市里の小女人 提交于 2019-12-06 01:57:16
问题 How can I create several virtual sockets and link them together to create a virtual bus? I want to simulate an application in which many nodes communicate to each other via CAN. 回答1: All you need is cangw tool from can-utils. Create two virtual interfaces: ip link add dev vcan0 type vcan ip link add dev vcan1 type vcan ip link set up vcan0 ip link set up vcan1 Create routing rule, so that all packets coming to vcan0 will be sent to vcan1 : cangw -A -s vcan0 -d vcan1 -e Listen to vcan1 in one