.json trace file 8 bytes only?

34 views
Skip to first unread message

F(x)

unread,
Dec 19, 2015, 5:58:12 PM12/19/15
to OpenXC
I have a bus that sends out varying lengths of CAN messages.  The standard enabler app is only capturing the messages with 8 bytes.  

I believe this is only on the app/Enabler side of things and need to dig into the API further (suspect CanMessage.java is the culprit).

Is this correct?

Thanks.

Chris

unread,
Dec 20, 2015, 11:32:47 AM12/20/15
to OpenXC
Hey there - if I'm not mistaken, CAN messages can have are a maximum of 8 bytes in each payload. Do you have a protocol running on top of CAN to send longer messages? Are you using CAN FD?

Chris

F(x)

unread,
Dec 20, 2015, 11:39:19 AM12/20/15
to OpenXC
It's a standard auto bus, 500k. I y in with a Vector setup and see messages (with diff IDs) with lengths from 1-8bytes. Comparing a log with the .json trace....only 8 byte length messages are captured by OpenXC, it misses/omita the shorter messages.

Christopher Peplin

unread,
Dec 20, 2015, 11:42:11 AM12/20/15
to openxc@googlegroups com
Ah thanks, I understand, I thought you were looking for longer messages. It sounds like there may be a bug in the firmware, if you care to dig into it - I never ran less than 8 byte messages in the field while working on it so I'll admit that may not be well tested.

On Sun, Dec 20, 2015 at 11:39 AM, F(x) <knoc...@gmail.com> wrote:
It's a standard auto bus, 500k. I y in with a Vector setup and see messages (with diff IDs) with lengths from 1-8bytes. Comparing a log with the .json trace....only 8 byte length messages are captured by OpenXC, it misses/omita the shorter messages.

--
You received this message because you are subscribed to a topic in the Google Groups "OpenXC" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/openxc/HW58Wy5fC40/unsubscribe.
To unsubscribe from this group and all its topics, send an email to openxc+un...@googlegroups.com.
Visit this group at https://groups.google.com/group/openxc.
To view this discussion on the web visit https://groups.google.com/d/msgid/openxc/56cf01d8-84ed-48c1-aa89-f54f2751eb7d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Christopher Peplin

unread,
Dec 20, 2015, 11:45:03 AM12/20/15
to openxc@googlegroups com
However you mentioned you think the issue is on the app side. Can you elaborate on that? Have you looked at the data coming out of the device another way and seen the messages?

F(x)

unread,
Mar 2, 2016, 11:47:31 AM3/2/16
to OpenXC
Hi Chris,

Yes, I have a benchtop setup that also has Busmaster on it with a Kvaser.  I can verify that with Busmaster i see ALL messages with varying lengths.  

I can see the app incrementing the message counter when I send anything less than or equal to 8 bytes, but it doesn't log....I do see bad array lengths when I send a message that is not 8 bytes.

7114 messages.CanMessage
7115 java.lang.reflect.InvocationTargetException
7116 at java.lang.reflect.Constructor.newInstance(Native Method)
7117 at java.lang.reflect.Constructor.newInstance(Constructor.java:288)
7118 at com.openxc.messages.VehicleMessage$1.createFromParcel(VehicleMessage.java:257)
7119 at com.openxc.messages.VehicleMessage$1.createFromParcel(VehicleMessage.java:232)
7120 at com.openxc.remote.VehicleServiceListener$Stub.onTransact(VehicleServiceListener.java:54)
7121 at android.os.Binder.execTransact(Binder.java:446)
7122 Caused by: java.lang.RuntimeException: bad array lengths
7123 at android.os.Parcel.readByteArray(Parcel.java:1769)
7124 at com.openxc.messages.CanMessage.readFromParcel(CanMessage.java:130)
7125 at com.openxc.messages.CanMessage.<init>(CanMessage.java:134)
7126 at java.lang.reflect.Constructor.newInstance(Native Method)
7127 at java.lang.reflect.Constructor.newInstance(Constructor.java:288)
7128 at com.openxc.messages.VehicleMessage$1.createFromParcel(VehicleMessage.java:257)
7129 at com.openxc.messages.VehicleMessage$1.createFromParcel(VehicleMessage.java:232)
7130 at com.openxc.remote.VehicleServiceListener$Stub.onTransact(VehicleServiceListener.java:54)
7131 at android.os.Binder.execTransact(Binder.java:446)

I am able to fix this but only for certain lengths (ie. anywhere from 1-8 bytes) if I edit CanMessage.java:

 @SerializedName(DATA_KEY)
    private byte[] mData = new byte[8];
    /*public List<Byte> list = new ArrayList<>(); */

If the 8 is changed to anything else, it will log that to the JSON.

It looks like the app needs some sort of Dynamic Array, which right now is beyond me (I've tried).

Whaddya think?

MM
Reply all
Reply to author
Forward
0 new messages