GithubHelp home page GithubHelp logo

redragonx / can2rnet Goto Github PK

View Code? Open in Web Editor NEW
65.0 19.0 25.0 13.66 MB

This repo has code and documentation to control power-wheelchairs with R-Net electronics.

License: GNU General Public License v3.0

Python 100.00%
powerwheelchairs python reverse-engineering hacking raspberry-pi raspberrypi rnet r-net can canbus defcon pgdt electronics medical

can2rnet's Introduction

PGDT R-Net CAN library for power-wheelchairs with R-Net electronics

By Stephen Chavez & Specter

Discord server (2021 update)

I don't know what happened, but can2RNET has gotten a lot of attention lately. It's a good thing. However, various people forked my project and done different things over the years. Nobody has really wanted to contribute publicly. So, to help with that. I started a Discord Server. Please join it.

https://discord.gg/mYqJSS5

Projects that use this

Raspberry PI setup

To install PiCan2 on pi3, add to /boot/config.txt:

dtparam=spi=on 

dtoverlay=mcp2515-can0,oscillator=16000000,interrupt=25         
dtoverlay=spi-bcm2835

R-Net Wiring Pinout to CAN inferface

  1. Strip a R-Net wire in half.
  2. Connect the wire with this pinout:
white is can high
blue is can low
black is gnd
red is +vin

SocketCAN setup

Add the following lines under file /etc/network/interfaces

allow-hotplug can0
iface can0 can static
        bitrate 125000
        up /sbin/ip link set $IFACE down
        up /sbin/ip link set $IFACE up

Add these kernel modules under /etc/modules

mcp251x
can_dev

Reboot the pi! Then you should see an can0 interface listed under the command ifconfig

Install CAN-UTILS

$ git clone https://github.com/linux-can/can-utils
or sudo apt-get install can-utils

R-Net command examples from the terminal

$ candump can0 -L   # -L puts in log format
(1469933235.191687) can0 00C#
(1469933235.212450) can0 00E#08901C8A00000000
(1469933235.212822) can0 7B3#
(1469933235.251708) can0 7B3#

$ cansend can0 181C0D00#0840085008440840  #play a tune

$ cangen can0 -e -g 10  -v -v     #fuzz buss with random extended frames+data

$ candump -n 1 can0,7b3:7ff     #wait for can id 7B3

Or run python3 JoyLocal.py to control a R-Net based PWC using any usb gamepad connected to the pi3.

Python 3 is required.

can2rnet's People

Contributors

redragonx avatar ysshah avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

can2rnet's Issues

Cosindering making a core library (Intergrating Smart Wheels) into can2RNET

What do you think guys? @ysshah I think we should.

I am thinking that we can make a modularized plugin base system that allows for adding input systems easily. Like the April Tag sensor/section of smart wheels. And then make it easy to add other subsystems.

Ideally, I want to implement Bluetooth Beacon tracking via phone or any other BT device. This would be easier to use around people and doesn't rely on camera tracking. The chair PI would have multiple BT adapters to track the signal and to figure out direction/distance. And with additional external sensors to detect the environment around the chair. This is what can2RNET was originally designed for anyway, so I would like to start on this soon. :D

Joy Module

Thanks for your great work! I am currently working on an invacare power wheelchair with Linx electronics. I want to receive data and control the wheelchair remotely. This is a work in the scope of my phd thesis, but it is also a personal project, because I have 2 sisters who use wheelchairs ๐Ÿ™‚

So far I am simply using arduino mega, interfacing with the wheelchair bus, using the chip MCP2515 (Can High, Can Low to SPI interface). I'm already able to read some frames, but I still can't decrypt them totally. I would like to send some of these messages to the bus to decrypt which frame can wake up the wheelchair, or make some engine work, but the joystick module shows an error and the system turns off.

Now I was wondering, because I saw in a project that use can2rnet that joystick is induced to error and to be able to communicate with the power module in its place.... is this the only way? because I wanted my joystick to work normally as it controls the state of the batteries and charges for example.

Also, do you think wireshark could help me better decipher some of this information? I think I would receive the same data, but maybe with less losses.

Thank you so much!

Remove "-overlay" from config.txt lines

We had to remove the "-overlay" from these lines in /boot/config.txt

dtoverlay=mcp2515-can0-overlay,oscillator=16000000,interrupt=25         
dtoverlay=spi-bcm2835-overlay

so it became

dtoverlay=mcp2515-can0,oscillator=16000000,interrupt=25         
dtoverlay=spi-bcm2835

for it to work. Maybe it was due to a Raspbian update?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.