WAS: CAN Sniffing using MCP2515 and MCP2551/2562

Hello!
At the moment I’m waiting for all the parts I ordered to building my own RTK Base (no free service here in northern Germany) and Rover setup in the first step, but I also read almost this whole forum about auto steering and all that things and making plans for the next winter. When thinking about the WAS I’m convinced it would be the best to get it from tractors CAN as each newer (4WD) tractor (like my own JD 6R and Case Puma) has an WAS speaking to the CAN.
I know to interact with the CAN is a very difficult thing, but if you just want to GET data from the tractor, it shouldn’t be too hard. I found this site (GitHub - autowp/arduino-mcp2515: Arduino MCP2515 CAN interface library). It’s an CAN interface library for the MCP2515 wich is a CAN controller with SPI-interface. Next to the CAN controller you also need an CAN transceiver like the MCP2551 or MCP2562 as described on that site. In my opinion it would be nice to apply these parts to the AutoSteerPCB to get an alternative to the WAS as first step and later to get additional information from the tractor or even control things this way. The parts to build this are less than $10 (DigiKey: <$3 for the MCP’s) which could be less than installing an WAS or grab the data directly from the tractors WAS.
Maybe @torriem wants to look into this or could give his opinion about it.

image
(from GitHub - autowp/arduino-mcp2515: Arduino MCP2515 CAN interface library)

1 Like

My thought is that one day, it will surely have to evolve the nano to something more modern, with 2 CAN ports ( like teensy or stm32 …) . In the meantime, I’m using mcp2515 module and arduino pro micro to retrieve information from the CAN. The Micro has a USB port fdti, and can be useful for sending characters to windows, for keyboard shortcuts.

Hello,
For sniffing CAN J1939 and CAN Open, I personnaly use Systec sysWORKS interface directly on PC computer which is more flexible than arduino + MCP2515 (there are also good other ones)
I prefer also to use ISO 1050 which is an insulated transceiver instead of TJA1040 or compatibles.
Has anybody ever investigated CAN on ESP32 ? Is it easy to use ?
francois

1 Like

Not sur , but i think for esp32, you may need to add CAN transceiver

@THiamu, that looks really interesting. Thanks for sharing it. The key here is you need to know the filtering parameters to set on the MCP2515. Then any CAN data that meets those filtering parameters will be sent over to the Arduino for processing. The SPI interface does have a limit on it for bandwidth, so you most likely cannot just see everything going across the CAN bus. All the different forms of CAN shield for Arduino employ similar chips to the MCP2515.

Yes you’re correct, @Tooki57. The Teensy, Due, Esp32, and others with built-in CAN support really means they have a built-in interface like the MCP2515. They still need a CAN transceiver to do the actual interfacing. There are lots of CAN transceiver chips out there. For example, there’s this, based on the SN65HVD30 chip: SN65HVD230 CAN Board Accessory board used for connecting MCUs to the CAN network, 3.3V, ESD protection.

1 Like

I found one arduino library for working with CAN on the Esp32: GitHub - miwagner/ESP32-Arduino-CAN: An Arduino CAN-Bus library for ESP32.

1 Like

Correct me, if I’m wrong, but couldn’t we just try the information from the pdf you postet in Dec (Sniffing the CAN bus with Arduino Due - #3 by torriem)? In there I could find “Steering Wheel Angle” with SPN 1807 and PGN 61449. I think the PGN might work as the filtering parameter (?)

image

Yes that’s the first thing I’d look for. If that fails, then you’d have to resort to looking at everything. You can’t filter on SPN. SPN just tells you how the data is encoded. You filter on src address, destination address, and PGN. Although J1939 is a bit tricky because the src, destination, and PGN are all encoded into the CAN id field, which is generally what CAN chipsets use to filter.

1 Like

Hello,
Tooki57 You must always put a tranceiver behind the processor MCP2515, ESP32 etc etc
torriem Tank you, I’ll have a closer look at this code for ESP32
THiamu For this PGN of course you can filter exactly that one but it seems that this PGN is a RTR one
(PDUS < 240) so I think you must send a RTR frame to PGN61449 and then you’ll get the response
On MCP2515 it sounds that you have 2 independant mailboxes with mask and filter
But for this investigation, try with a CAN interface on a pc and then you’ll find exactly the RTR frame and the response
francois

1 Like

Microchip CAN BUS analyzer

You’ll probably need the wheel angle not the steering wheel angle

PGN SPN
61451 2927 Actual Inner wheel steering angle

3 Likes

Additional info:

C/D-Can = J-1939
H/J-Can ISO-11783

j1939

A dull moment in this search engine
Gave some PGN’s And SPN off interest (searched for guide, angle and steer in the SPN Name field)

PGN’s that could be off interest
2304,8960,9216,43264,44032,44288,56832,61449,61451,61459,61469,61481,61757,64663,65032,65033,65144,65192

PGN PGN Description

SPN	SPN Name

2304 See j1939_dl/ for details

5582	Static Roll Angle	
5583	Static Roll Angle Status

8960 Tractor Implement Management (TIM) Server to TIM Client Status,
Operation and Function messages.
The first byte of the PGN contains the Message code or the TIM function ID.

8665	Auxiliary Valve 0 Flow
8666	Auxiliary Valve 1 Flow
8667	Auxiliary Valve 2 Flow
8668	Auxiliary Valve 3 Flow
8669	Auxiliary Valve 4 Flow
8670	Auxiliary Valve 5 Flow
8671	Auxiliary Valve 6 Flow
8672	Auxiliary Valve 7 Flow
8673	Auxiliary Valve 8 Flow
8674	Auxiliary Valve 9 Flow
8675	Auxiliary Valve 10 Flow
8676	Auxiliary Valve 11 Flow
8677	Auxiliary Valve 12 Flow
8678	Auxiliary Valve 13 Flow
8679	Auxiliary Valve 14 Flow
8680	Auxiliary Valve 15 Flow
8681	Auxiliary Valve 16 Flow
8682	Auxiliary Valve 17 Flow
8683	Auxiliary Valve 18 Flow
8684	Auxiliary Valve 19 Flow
8685	Auxiliary Valve 20 Flow
8686	Auxiliary Valve 21 Flow
8687	Auxiliary Valve 22 Flow
8688	Auxiliary Valve 23 Flow
8689	Auxiliary Valve 24 Flow
8690	Auxiliary Valve 25 Flow
8691	Auxiliary Valve 26 Flow
8692	Auxiliary Valve 27 Flow
8693	Auxiliary Valve 28 Flow
8694	Auxiliary Valve 29 Flow
8695	Auxiliary Valve 30 Flow
8696	Auxiliary Valve 31 Flow
8697	Auxiliary Valve 0 Automation Status
8698	Auxiliary Valve 1 Automation Status
8699	Auxiliary Valve 2 Automation Status
8700	Auxiliary Valve 3 Automation Status
8701	Auxiliary Valve 4 Automation Status
8702	Auxiliary Valve 5 Automation Status
8703	Auxiliary Valve 6 Automation Status
8704	Auxiliary Valve 7 Automation Status
8705	Auxiliary Valve 8 Automation Status
8706	Auxiliary Valve 9 Automation Status
8707	Auxiliary Valve 10 Automation Status
8708	Auxiliary Valve 11 Automation Status
8709	Auxiliary Valve 12 Automation Status
8710	Auxiliary Valve 13 Automation Status
8711	Auxiliary Valve 14 Automation Status
8712	Auxiliary Valve 15 Automation Status
8713	Auxiliary Valve 16 Automation Status
8714	Auxiliary Valve 17 Automation Status
8715	Auxiliary Valve 18 Automation Status
8716	Auxiliary Valve 19 Automation Status
8717	Auxiliary Valve 20 Automation Status
8718	Auxiliary Valve 21 Automation Status
8719	Auxiliary Valve 22 Automation Status
8720	Auxiliary Valve 23 Automation Status
8721	Auxiliary Valve 24 Automation Status
8722	Auxiliary Valve 25 Automation Status
8723	Auxiliary Valve 26 Automation Status
8724	Auxiliary Valve 27 Automation Status
8725	Auxiliary Valve 28 Automation Status
8726	Auxiliary Valve 29 Automation Status
8727	Auxiliary Valve 30 Automation Status
8728	Auxiliary Valve 31 Automation Status
8729	Auxiliary Valve 0 Exit/Reason Code
8730	Auxiliary Valve 1 Exit/Reason Code
8731	Auxiliary Valve 2 Exit/Reason Code
8732	Auxiliary Valve 3 Exit/Reason Code
8733	Auxiliary Valve 4 Exit/Reason Code
8734	Auxiliary Valve 5 Exit/Reason Code
8735	Auxiliary Valve 6 Exit/Reason Code
8736	Auxiliary Valve 7 Exit/Reason Code
8737	Auxiliary Valve 8 Exit/Reason Code
8738	Auxiliary Valve 9 Exit/Reason Code
8739	Auxiliary Valve 10 Exit/Reason Code
8740	Auxiliary Valve 11 Exit/Reason Code
8741	Auxiliary Valve 12 Exit/Reason Code
8742	Auxiliary Valve 13 Exit/Reason Code
8743	Auxiliary Valve 14 Exit/Reason Code
8744	Auxiliary Valve 15 Exit/Reason Code
8745	Auxiliary Valve 16 Exit/Reason Code
8746	Auxiliary Valve 17 Exit/Reason Code
8747	Auxiliary Valve 18 Exit/Reason Code
8748	Auxiliary Valve 19 Exit/Reason Code
8749	Auxiliary Valve 20 Exit/Reason Code
8750	Auxiliary Valve 21 Exit/Reason Code
8751	Auxiliary Valve 22 Exit/Reason Code
8752	Auxiliary Valve 23 Exit/Reason Code
8753	Auxiliary Valve 24 Exit/Reason Code
8754	Auxiliary Valve 25 Exit/Reason Code
8755	Auxiliary Valve 26 Exit/Reason Code
8756	Auxiliary Valve 27 Exit/Reason Code
8757	Auxiliary Valve 28 Exit/Reason Code
8758	Auxiliary Valve 29 Exit/Reason Code
8759	Auxiliary Valve 30 Exit/Reason Code
8760	Auxiliary Valve 31 Exit/Reason Code
8761	Front PTO Output Shaft Speed
8762	Rear PTO Output Shaft Speed
8763	Front PTO Automation Status
8764	Rear PTO Automation Status
8765	Front PTO Exit/Reason Code
8766	Rear PTO Exit/Reason Code
8767	Front Hitch Position
8768	Rear Hitch Position
8769	Front Hitch Automation Status
8770	Rear Hitch Automation Status
8771	Front Hitch Exit/Reason Code
8772	Rear Hitch Exit/Reason Code
8773	Machine Speed
8774	Machine Speed Automation Status
8775	Machine Speed Exit/Reason Code
8776	External Guidance Curvature
8777	External Guidance Automation Status
8778	External Guidance Exit/Reason Code

9216 Tractor Implement Management (TIM) Client to TIM Server Status,
Operation and Function messages.
The first byte of the PGN contains the Message code or the TIM function ID.

8779	Auxiliary Valve 0 Flow Request
8780	Auxiliary Valve 1 Flow Request
8781	Auxiliary Valve 2 Flow Request
8782	Auxiliary Valve 3 Flow Request
8783	Auxiliary Valve 4 Flow Request
8784	Auxiliary Valve 5 Flow Request
8785	Auxiliary Valve 6 Flow Request
8786	Auxiliary Valve 7 Flow Request
8787	Auxiliary Valve 8 Flow Request
8788	Auxiliary Valve 9 Flow Request
8789	Auxiliary Valve 10 Flow Request
8790	Auxiliary Valve 11 Flow Request
8791	Auxiliary Valve 12 Flow Request
8792	Auxiliary Valve 13 Flow Request
8793	Auxiliary Valve 14 Flow Request
8794	Auxiliary Valve 15 Flow Request
8795	Auxiliary Valve 16 Flow Request
8796	Auxiliary Valve 17 Flow Request
8797	Auxiliary Valve 18 Flow Request
8798	Auxiliary Valve 19 Flow Request
8799	Auxiliary Valve 20 Flow Request
8800	Auxiliary Valve 21 Flow Request
8801	Auxiliary Valve 22 Flow Request
8802	Auxiliary Valve 23 Flow Request
8803	Auxiliary Valve 24 Flow Request
8804	Auxiliary Valve 25 Flow Request
8805	Auxiliary Valve 26 Flow Request
8806	Auxiliary Valve 27 Flow Request
8807	Auxiliary Valve 28 Flow Request
8808	Auxiliary Valve 29 Flow Request
8809	Auxiliary Valve 30 Flow Request
8810	Auxiliary Valve 31 Flow Request
8811	Front PTO Output Shaft Speed Request
8812	Rear PTO Output Shaft Speed Request
8813	Front Hitch Position Request
8814	Rear Hitch Position Request
8815	Machine Speed Request
8816	External Guidance Curvature Request

43264 See j1939_dl/ for details

3564	Lane Departure Warning Enable Command	
9751	Lane Keeping Assist Enable Command	
9752	Lane Centering Enable Command	
8133	Current Region	
8134	Current Sub-Region	
9760	Requested Active Steering Driver Preference Mode

44032 Machine system feedback detailing status of machine relative to guidance operation

5238	Guidance estimated curvature
5243	Mechanical system lockout
5242	Guidance steering system readiness
5241	Guidance steering input position status
5240	Guidance request reset command status
5726	Guidance Limit Status
5725	Guidance system command exit/reason code
9726	Guidance system Remote Engage Switch Status

44288 Steering command expressed as desired curvature

5237	Guidance curvature command
5239	Guidance curvature command status

56832 See j1939_dl/ for details

988	Trip Group 1	
989	Trip Group 2 - Proprietary	
1584	Service Component Identification	
1211	Engine Build Hours Reset	
3600	Steering Straight Ahead Position Reset	
6218	Engine Spark Plug Secondary Voltage Tracking Reset	
6219	Engine Ignition Control Maintenance Hours Reset	
6898	Bin Lift Count Reset	
6985	Tire Configuration Information	
6986	Tire Sensor Information

61444 See j1939_dl/ for details

899	Engine Torque Mode	
4154	Actual Engine - Percent Torque (Fractional)	
512	Driver's Demand Engine - Percent Torque	
513	Actual Engine - Percent Torque	
190	Engine Speed	
1483	Source Address of Controlling Device for Engine Control	
1675	Engine Starter Mode	
2432	Engine Demand – Percent Torque

61449 See j1939_dl/ for details

1807	Steering Wheel Angle	
1811	Steering Wheel Turn Counter	
1812	Steering Wheel Angle Sensor Type	
1808	Yaw Rate	
1809	Lateral Acceleration
1810	Longitudinal Acceleration

61451 See j1939_dl/ for details

2927	Actual Inner wheel steering angle	
2928	Axle Location	
2923	Status of Steering Axle	
2922	Steerable Lift Axle Lowering Inhibit	
2924	Steering Type
2925	Type of Steering Forces	
2926	Type of Steering Transmission

61459 See j1939_dl/ for details

3318	Pitch Angle	
3319	Roll Angle	
3322	Pitch Rate	
3323	Pitch Angle Figure of Merit	
3324	Roll Angle Figure of Merit	
3325	Pitch Rate Figure of Merit
3326	Pitch and Roll Compensated	
3327	Roll and Pitch Measurement Latency

61469 See j1939_dl/ for details

3683	Steering Wheel Angle	
3684	Steering Wheel Angle Range Counter	
3685	Steering Wheel Angle Range Counter Type	
3686	Steering Wheel Angle Range	
3687	Steering Angle Sensor Active Mode	
3688	Steering Angle Sensor Calibrated	
3689	Message Counter	
3690	Message Checksum

61481 See j1939_dl/ for details

4976	Pitch Angle (Extended Range)	
4977	Roll Angle (Extended Range)	
4978	Pitch Angle Compensation (Extended Range)	
4979	Pitch Angle Figure of Merit (Extended Range)	
4980	Roll Angle Compensation (Extended Range)	
4981	Roll Angle Figure of Merit (Extended Range)	
4982	Roll and Pitch Measurement Latency (Extended Range)

61757 See j1939_dl/ for details

9753	Lane Keeping Assist Status Right Side	
9754	Lane Keeping Assist Status Left Side	
9755	Lane Keeping Assist Indication Enable Status	
9756	Lane Keeping Assist System State	
9757	Active Steering Driver Preference	
12855	Hands Off Detection Status	
12854	Hands Off Detection Availability	
9758	Lane Centering Indication Enable State	
9759	Lane Centering System Status

64663 See j1939_dl/ for details

6375	Requested Steering Mode	
6376	Front Steering Axle Centered Status	
6377	Rear Steering Axle Centered Status	
6378	2 Wheel Steer Actuator State	
6379	4 Wheel Steer Actuator State	
6380	Circle Steer Mode Actuator State	
6381	Crab Steer Mode Actuator State	
6374	Steering Controller ECU Temperature	
11733	Steering Mode Two Wheel Switch Input	
11734	Steering Mode Crab Switch Input	
11735	Steering Mode Circle Switch Input	
11736	Steering Mode Status

65032 Implement CF or task controller request to the Tractor ECU for
a desired tractor classification and tractor facilities

5233	Speed information - engine speed
5233	Speed information - ground based speed
5233	Speed information - wheel based speed
5233	Power management - maintain power
5233	Power management - maximum time tractor power
5233	Power management - key switch
5232	Tractor ECU class request
5233	Language command storage in Tractor ECU
5233	Lighting - minimal set as existing trailer connector
5233	PTO information - rear shaft engagement
5233	PTO information - rear shaft speed
5233	Hitch information - rear in work
5233	Hitch information - rear position
5233	Estimated or measured auxiliary valve status
5233	Lighting - full implement lighting message set
5233	Additional hitch parameters - rear draft
5233	Speed and distance - wheel-based direction
5233	Speed and distance - wheel-based distance
5233	Speed and distance - ground-based direction
5233	Speed and distance - ground-based distance
5233	Time date
5233	PTO commands - rear PTO mode/gear command
7445	Limit/request status reporting
5233	Auxiliary valve commands
5233	PTO commands - rear PTO engagement command
5233	PTO commands - rear PTO speed command
5233	Hitch commands - rear hitch position
5233	Direction control
5233	Machine selected speed control
5233	Machine selected speed
5233	Operator external light controls
5233	Navigational pseudo-range noise statistics
5233	Navigational system position data
5233	Navigational system high-output position
5233	PTO commands - front PTO engagement command
5233	PTO commands - front PTO speed command
5233	Hitch commands - front hitch position
5233	Additional hitch parameters - front draft
5233	PTO information - front shaft engagement
5233	PTO information - front shaft speed
5233	Hitch information - front in work
5233	Hitch information - front position
5233	Drive Strategy Status and Commands
5233	External Guidance Status and Commands
5233	PTO commands - front PTO mode/gear command
5236	Tractor facility reserved bit indicator

65033 Tractor response to an implement CF or a task controller request for
tractor classification and facilities

5235	Speed information - engine speed
5235	Speed information - ground based speed
5235	Speed information - wheel based speed
5235	Power management - maintain power
5235	Power management - maximum time tractor power
5235	Power management - key switch
5234	Tractor ECU class response
5235	Language command storage in Tractor ECU
5235	Lighting - minimal set as existing trailer connector
5235	PTO information - rear shaft engagement
5235	PTO information - rear shaft speed
5235	Hitch information - rear in work
5235	Hitch information - rear position
5235	Estimated or measured auxiliary valve status
5235	Lighting - full implement lighting message set
5235	Additional hitch parameters - rear draft
5235	Speed and distance - wheel-based direction
5235	Speed and distance - wheel-based distance
5235	Speed and distance - ground-based direction
5235	Speed and distance - ground-based distance
5235	Time date
5235	PTO commands - rear PTO mode/gear command
7444	Tractor Facility Response - Limit/Request Status Reporting
5235	Auxiliary valve commands
5235	PTO commands - rear PTO engagement command
5235	PTO commands - rear PTO speed command
5235	Hitch commands - rear hitch position
5235	Direction control
5235	Machine selected speed control
5235	Machine selected speed
5235	Operator external light controls
5235	Navigational pseudo-range noise statistics
5235	Navigational system position data
5235	Navigational system high-output position
5235	PTO commands - front PTO engagement command
5235	PTO commands - front PTO speed command
5235	Hitch commands - front hitch position
5235	Additional hitch parameters - front draft
5235	PTO information - front shaft engagement
5235	PTO information - front shaft speed
5235	Hitch information - front in work
5235	Hitch information - front position
5235	Drive Strategy Status and Commands
5235	External Guidance Status and Commands
5235	PTO commands - front PTO mode/gear command
5236	Tractor facility reserved bit indicator

65144 See j1939_dl/ for details
39 Tire Pressure Check Interval
466 Steer Channel Mode
1467 Trailer/tag Channel Mode
1468 Drive Channel Mode
1469 PCU Drive Solenoid Status
1470 PCU Steer Solenoid Status
1471 Tire Pressure Supply Switch Status
1472 PCU Deflate Solenoid Status
1473 PCU Control Solenoid Status
1474 PCU Supply Solenoid Status
1475 PCU Trailer, Tag or Push Solenoid Status

65192 See j1939_dl/ for details

1120	Articulation Angle	
9652	Articulation Angular Velocity
2 Likes

https://github.com/eringerli/esp32-aog has some CAN code already built in