collin80 / SavvyCAN

QT based cross platform canbus tool
MIT License
1k stars 278 forks source link

Adding timestamps? #600

Closed lansalot closed 1 year ago

lansalot commented 1 year ago

Am using this library with a Nano, MCP2515 and SavvyCAN, but I can't get timestamps from it: https://github.com/latonita/arduino-canbus-monitor

I thought setting System Clock in Preferences would inject the capture time according to PC rather than dongle, but it's still blank - am I doing something wrong?

I tried sending Z and Z2 commands via SavvyCAN text sending, but that didn't seem to help...

What am I missing?

Thanks

Dreed420 commented 1 year ago

Saavycan and lawicel working On Windows?

pt., 17 mar 2023, 14:42 użytkownik lansalot @.***> napisał:

Am this library with a Nano, MCP2515 and SavvyCAN, but I can't get timestamps from it: https://github.com/latonita/arduino-canbus-monitor

I thought setting System Clock in Preferences would inject the capture time according to PC rather than dongle, but it's still blank - am I doing something wrong?

I tried sending Z and Z2 commands via SavvyCAN text sending, but that didn't seem to help...

What am I missing?

Thanks

— Reply to this email directly, view it on GitHub https://github.com/collin80/SavvyCAN/issues/600, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOJUB7FA7SBPXDUAWE2KLK3W4RS4PANCNFSM6AAAAAAV6RTXNI . You are receiving this because you are subscribed to this thread.Message ID: @.***>

lansalot commented 1 year ago

Yes on Windows, but I got same on linux

Dreed420 commented 1 year ago

I cannot send or recive any mesaages on Windows (saavycan)

sob., 18 mar 2023, 17:53 użytkownik lansalot @.***> napisał:

Yes on Windows, but I got same on linux

— Reply to this email directly, view it on GitHub https://github.com/collin80/SavvyCAN/issues/600#issuecomment-1474908007, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOJUB7ARVRCZNLL3C54TTWTW4XSBVANCNFSM6AAAAAAV6RTXNI . You are receiving this because you commented.Message ID: @.***>

amiralnar commented 1 year ago

@lansalot > What am I missing?

For now the Lawicel protocol implementation uses timstamps only from device and the problem is that the arduino device dosen't provide timestamps unfortunately.

@Dreed420 > I cannot send or recive any mesaages on Windows (saavycan)

It's because of using serial connection with Hardware conrol option. Try to create connection, then remove it and then create again. It can force bytes thru serial without hardware control. It works for me. Also i use the Terminal 1.9 program to start CAN flow from device by sending commands manual: C -> S6 -> O and after starting the flow from device i create connection in the program. Then it can recive messages. Buh it can't send messages anyway.

@collin80

Maybe you can add the Hardware flow control option and the timestamps from the system?

изображение

@lansalot @Dreed420 You can try the private build where i had fixed problems https://drive.google.com/file/d/1qQEISS-eC4MUCTjCN9F2MCL_EIuZjJYu/view?usp=sharing

lansalot commented 1 year ago

Thanks @amiralnar

I might see if I can just inject millis() into the Arduino lawicel library, but it would be handy if savvycan could just fill it in if blank of course.

Is that what your custom build does ?

amiralnar commented 1 year ago

Is that what your custom build does ?

Yes it uses system time timestamps And it uses serial port without hardware flow control option. This is useful for some Arduino devices which has only RX TX and GND signals.

lansalot commented 1 year ago

Throwing "the application was unable to start" straight away, it's in same folder as all the support code.

lansalot commented 1 year ago

Went back to the library source, and if I hard-code in the addition of timestamps, and enable _MCP_FAKE_MODE, the sample format changes from

t10440DC90000 t10640BD80000 t105409AA0000 to t10F40DBF00000D36 t10740BC600000D37 t10740BA50000A32F

So I can see the 4-byte extended mode timestamps. I also tried with 2, but savvycan still not reading them?

amiralnar commented 1 year ago

Throwing "the application was unable to start" straight away, it's in same folder as all the support code.

It's 32bit exe file. Maybe you trying to place it in 64bit program folder?

amiralnar commented 1 year ago

Went back to the library source, and if I hard-code in the addition of timestamps, and enable _MCP_FAKE_MODE, the sample format changes from

t10440DC90000 t10640BD80000 t105409AA0000 to t10F40DBF00000D36 t10740BC600000D37 t10740BA50000A32F

So I can see the 4-byte extended mode timestamps. I also tried with 2, but savvycan still not reading them?

Wow, you did a great work! Sorry i said it wrong. There is no capture the timestamp in SavvyCAN for now at all Take a look at https://github.com/collin80/SavvyCAN/blob/master/connections/lawicel_serial.cpp 451 You need your own build anyway for now.

amiralnar commented 1 year ago

@lansalot now you can try to use full dev release from my fork: https://github.com/amiralnar/SavvyCAN/releases

lansalot commented 1 year ago

Thanks, heading out to farm soon, will give it a try !

lansalot commented 1 year ago

Worked a treat, thanks!

lansalot commented 1 year ago

Altho, the codes savvycan retrieved weren't the PGNs I was expecting. Truncated to 2 bytes if I remember right? Expecting, for example. 0x18ff4f23

amiralnar commented 1 year ago

Altho, the codes savvycan retrieved weren't the PGNs I was expecting. Truncated to 2 bytes if I remember right? Expecting, for example. 0x18ff4f23

Pls explain more detail. Didn't get it

lansalot commented 1 year ago

I think it's because the middle 2 bytes are being displayed by SavvyCAN, but I see all 4 in Canhacker for example.

eg 0x18ff3423 would show as 8ff3 in SavvyCan?

amiralnar commented 1 year ago

I think it's because the middle 2 bytes are being displayed by SavvyCAN, but I see all 4 in Canhacker for example.

eg 0x18ff3423 would show as 8ff3 in SavvyCan?

Can you show me the screenshot example from canhacker and from savvycan?

lansalot commented 1 year ago

Ah sorry, I was meaning the 29-bit ID. Apologies for delay in reply, changed jobs, life hectic etc.

Still getting connections only occasionally with SavvyCAN but CanHacker always seems to connect, no idea why?

In the console, plenty scrolling past - but nothing in the main window: image