Ankit6277/can-j1939-engine-simulator ? reverse-engineered prompt
Reverse engineered prompt
Build me a small Python app that simulates a two node SAE J1939 network in software only. I want one virtual Engine ECU that periodically sends engine speed and coolant temperature, and one Gauge Cluster that listens and shows the decoded values correctly.
Please use the Python CAN virtual interface so it runs without any hardware, and make sure the messages use 29 bit extended CAN frames. The engine speed should follow the normal J1939 scaling for SPN 190, and coolant temperature should follow the usual scaling for SPN 110, including the offset. I want the encoding and decoding to be correct, not just fake numbers.
Keep it simple and easy to run from one script, and include clear console output so I can see both the transmitted messages and the decoded values in real time. If anything about the J1939 message format is unclear, look up the current docs online and use the standard behavior.
Are you gonna build this?
make sure you review the code using coderabbit