{"id":615971,"date":"2023-03-09T08:49:10","date_gmt":"2023-03-09T14:49:10","guid":{"rendered":"https:\/\/news.sellorbuyhomefast.com\/index.php\/2023\/03\/09\/control-mario-kart-64-with-your-car-over-can-bus-2016\/"},"modified":"2023-03-09T08:49:10","modified_gmt":"2023-03-09T14:49:10","slug":"control-mario-kart-64-with-your-car-over-can-bus-2016","status":"publish","type":"post","link":"https:\/\/newsycanuse.com\/index.php\/2023\/03\/09\/control-mario-kart-64-with-your-car-over-can-bus-2016\/","title":{"rendered":"Control Mario Kart 64 with your car over CAN bus (2016)"},"content":{"rendered":"<div data-target=\"readme-toc.content\">\n<article itemprop=\"text\">\n<h2 tabindex=\"-1\" dir=\"auto\">Catch Me If You CAN<\/h2>\n<p dir=\"auto\">The most realistic Mario Kart 64 simulator ever<\/p>\n<h2 tabindex=\"-1\" dir=\"auto\">Requirements<\/h2>\n<ul dir=\"auto\">\n<li>Python 2.7+<\/li>\n<li><a href=\"https:\/\/github.com\/SavinaRoja\/PyUserInput\">PyKeyboard<\/a><\/li>\n<li><a href=\"http:\/\/m64py.sourceforge.net\/\" rel=\"nofollow\">m64py<\/a> &#8211; A frontend for Mupen64Plus<\/li>\n<li>A copy of Mario Kart 64 as a ROM image<\/li>\n<li>Raspberry Pi + <a href=\"http:\/\/skpang.co.uk\/catalog\/pican2-canbus-board-for-raspberry-pi-2-p-1475.html\" rel=\"nofollow\">PiCAN<\/a><\/li>\n<li><a href=\"https:\/\/www.sparkfun.com\/products\/10087\" rel=\"nofollow\">ODB-II to DB9 cable<\/a> (you can also wire this yourself)<\/li>\n<li>A car (currently only tested on a 2012 Honda CR-V)<\/li>\n<li>A low-latency network connection between your Pi and the laptop running m64py<\/li>\n<\/ul>\n<h2 tabindex=\"-1\" dir=\"auto\">Setup<\/h2>\n<p dir=\"auto\">Install SocketCAN on the Pi according to <a href=\"http:\/\/skpang.co.uk\/blog\/archives\/1165\" rel=\"nofollow\">this guide<\/a>. Connect<br \/>\nthe Pi to your car and verify that <code>.\/candump can0<\/code> prints a stream of data to your screen. If you&#8217;re<br \/>\nusing the ODB-II cable, keep in mind there are 3 jumpers &#8212; SJ1, SJ2, and SJ3 &#8212; that need to be<br \/>\nsoldered on the board (<a href=\"http:\/\/skpang.co.uk\/catalog\/images\/raspberrypi\/pi_2\/PICAN2UGB.pdf\" rel=\"nofollow\">this PDF<\/a><br \/>\nprovides details).<\/p>\n<p dir=\"auto\">Connect the Pi to your laptop. Your network configuration is up to you, but a hard-wired connection is<br \/>\nhighly recommended due to latency concerns. We found that an Ethernet cable running directly from the<br \/>\nPi to the laptop worked best, configured as such:<\/p>\n<ul dir=\"auto\">\n<li>On the Pi: <code>sudo ip ad add 10.0.0.10\/24 dev eth0<\/code><\/li>\n<li>On the laptop: <code>sudo ip ad add 10.0.0.20\/24 dev eth0<\/code><\/li>\n<\/ul>\n<p dir=\"auto\">Assuming this setup, verify that the Pi can ping 10.0.0.20.<\/p>\n<p dir=\"auto\">Launch m64py and load a Mario Kart 64 ROM. Using the default controls, try playing a game to make sure<br \/>\neverything works. Shift\/Ctrl are gas\/brakes respectively, and arrow keys steer.<\/p>\n<h2 tabindex=\"-1\" dir=\"auto\">Usage<\/h2>\n<p dir=\"auto\">Level out your steering wheel as best as you can. <strong>Put the car in park\/neutral and make sure your<br \/>\nparking brake is on.<\/strong> Take your feet off the pedals.<\/p>\n<p dir=\"auto\">On the laptop, start the Python script as a normal user:<\/p>\n<p dir=\"auto\">Start m64py and launch Mario Kart.<\/p>\n<p dir=\"auto\">On the Pi, start candump and have it send relevant data to the laptop:<\/p>\n<div data-snippet-clipboard-copy-content=\".\/candump can0,17c:7FF,1a6:7FF,156:7FF,294:7FF | nc -u 10.0.0.20 1738\">\n<pre><code>.\/candump can0,17c:7FF,1a6:7FF,156:7FF,294:7FF | nc -u 10.0.0.20 1738\n<\/code><\/pre>\n<\/div>\n<p dir=\"auto\">By default, port 1738 is used. You can change this in the script if you experience a conflict.<\/p>\n<p dir=\"auto\">Give focus to the m64py window.<\/p>\n<p dir=\"auto\"><strong>NOTE:<\/strong> Once you start the script on the Pi, the Python script will begin emulating a keyboard. If<br \/>\nyour steering wheel was not level or you had any pedals held down, this will cause key presses to be<br \/>\npassed to the active window. Move your focus to m64py as quickly as possible to avoid confusion.<\/p>\n<p dir=\"auto\">You should be able to navigate the menu using the car. The steering wheel will move you left\/right, and<br \/>\ngas\/brakes will move you up\/down menu trees.<\/p>\n<p dir=\"auto\">Start racing!<\/p>\n<h2 tabindex=\"-1\" dir=\"auto\">Controls<\/h2>\n<ul dir=\"auto\">\n<li>Steering: Turn the steering wheel left\/right.<\/li>\n<li>Acceleration: Hit the gas pedal. Gas is binary in Mario Kart, so more pressure will not increase speed.<\/li>\n<li>Brakes: Hit your brakes. Again, this is a binary input.<\/li>\n<li>Use item: Activate your winshield wipers.<\/li>\n<li>Jump: Toggle your high beams.<\/li>\n<\/ul><\/div>\n<p><a href=\"https:\/\/github.com\/DanH42\/CatchMeIfYouCAN\" class=\"button purchase\" rel=\"nofollow noopener\" target=\"_blank\">Read More<\/a><br \/>\n Zonia Buresh<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Catch Me If You CAN The most realistic Mario Kart 64 simulator ever Requirements Python 2.7+ PyKeyboard m64py &#8211; A frontend for Mupen64Plus A copy of Mario Kart 64 as a ROM image Raspberry Pi + PiCAN ODB-II to DB9 cable (you can also wire this yourself) A car (currently only tested on a 2012<\/p>\n","protected":false},"author":1,"featured_media":615972,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4250,4681,46],"tags":[],"class_list":{"0":"post-615971","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-control","8":"category-mario","9":"category-technology"},"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/newsycanuse.com\/index.php\/wp-json\/wp\/v2\/posts\/615971","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/newsycanuse.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/newsycanuse.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/newsycanuse.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/newsycanuse.com\/index.php\/wp-json\/wp\/v2\/comments?post=615971"}],"version-history":[{"count":0,"href":"https:\/\/newsycanuse.com\/index.php\/wp-json\/wp\/v2\/posts\/615971\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/newsycanuse.com\/index.php\/wp-json\/wp\/v2\/media\/615972"}],"wp:attachment":[{"href":"https:\/\/newsycanuse.com\/index.php\/wp-json\/wp\/v2\/media?parent=615971"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/newsycanuse.com\/index.php\/wp-json\/wp\/v2\/categories?post=615971"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/newsycanuse.com\/index.php\/wp-json\/wp\/v2\/tags?post=615971"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}