[Ovmsdev] Can sniff and play

Mark Webb-Johnson mark at webb-johnson.net
Thu Jun 20 14:53:53 HKT 2019


In general, OVMS can capture CAN traffic. You can also play back any CAN frames you want, under programmatic control. For example, in the Tesla Roadster code, we have this code to send the command to start streaming the CAC values:

  // Request CAC streaming...
  // 102 06 D0 07 00 00 00 00 40
  frame.origin = m_can1;
  frame.FIR.U = 0;
  frame.FIR.B.DLC = 8;
  frame.FIR.B.FF = CAN_frame_std;
  frame.MsgID = 0x102;
  frame.data.u8[0] = 0x06;
  frame.data.u8[1] = 0xd0;
  frame.data.u8[2] = 0x07;
  frame.data.u8[3] = 0x00;
  frame.data.u8[4] = 0x00;
  frame.data.u8[5] = 0x00;
  frame.data.u8[6] = 0x00;
  frame.data.u8[7] = 0x40;
  m_can1->Write(&frame);

You can also do that from the command line with:

can can1 tx standard 102 06 D0 07 00 00 00 00 40

I am not sure what you mean by ‘analog command’, but I hope that the above answers your question.

Regards, Mark.

> On 20 Jun 2019, at 2:25 AM, Tamás Kovács <kommykt at gmail.com> wrote:
> 
> My friend ask me about OVMS. He want to sniff a command on a CAN network, and if a analog command starting signal the module play the sniffed command.  Is this possible with OVMS?
> 
> 
> _______________________________________________
> OvmsDev mailing list
> OvmsDev at lists.openvehicles.com
> http://lists.openvehicles.com/mailman/listinfo/ovmsdev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openvehicles.com/pipermail/ovmsdev/attachments/20190620/2cbda5d0/attachment.html>


More information about the OvmsDev mailing list