-
Notifications
You must be signed in to change notification settings - Fork 59
Add RTR frames to TCP messages #24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
47dbff6
d488f03
6da4fd1
dbf4276
41cf7d6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
Running on Raspberry PI | ||
=================== | ||
|
||
For this example used adapter-board: https://www.waveshare.com/rs485-can-hat.htm you can find it on aliexpress too. | ||
After flashing Raspberry image to SD card modify 'config.txt', uncomment this line: | ||
|
||
dtparam=spi=on | ||
|
||
Add this line: | ||
|
||
dtoverlay=mcp2515-can0,oscillator=12000000,interrupt=25,spimaxfrequency=5000000 | ||
|
||
Save file and create empty 'SSH' file if you want to remotely login over ethenet to pi. | ||
For Windows (10+) use: | ||
|
||
ssh raspberrypi.local -l pi | ||
|
||
Password: raspberry | ||
|
||
You can check if CAN driver initialized successfully with: | ||
|
||
dmesg | grep -i '\(can\|spi\)' | ||
|
||
Prepare something needed for build | ||
|
||
sudo apt-get install libconfig-dev | ||
|
||
Now lets clone socketcand to sd card and build it | ||
|
||
cd boot | ||
sudo git clone https://github.com/linux-can/socketcand.git | ||
cd socketcand | ||
sudo ./autogen.sh | ||
sudo ./configure | ||
sudo make | ||
|
||
Now you can install it into system | ||
|
||
sudo make install | ||
|
||
After that you may want to make it run on boot as service, run this command to edit it | ||
|
||
sudo systemctl edit --force --full socketcand.service | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please name the file |
||
|
||
Replace content with this rescription: | ||
|
||
[Unit] | ||
Description=CAN ethernet | ||
After=server.service multi-user.target | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
What about:
|
||
|
||
[Service] | ||
ExecStart= | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do you need the empty line? What about adding the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i have no idea! its a linux magic There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You don't need that empty line. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. in this case this thing gonna yell at me that im passing arguments in excutable. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What does it say exactly? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Service has more than one ExecStart= setting, which is only allowed for Type=oneshot services. Refusing. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you get this error message you might have a drop-in file in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what makes my option more noob proof. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Proper instructions are a good starting point to learn more, if someone is interested. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you can update it in a commit |
||
ExecStart=-/usr/local/bin/socketcand -i can0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Man i described the way it worked. it took me half day long to make it work. i dont want to try over again |
||
Restart=always | ||
TimeoutSec=10 | ||
|
||
[Install] | ||
WantedBy=multi-user.target | ||
|
||
Try to start it with | ||
|
||
sudo systemctl daemon-reload | ||
sudo systemctl start socketcand.service | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
And listen on UDP default port 42000 for discovery message. | ||
|
||
<CANBeacon name="raspberrypi" type="SocketCAN" description="socketcand"> | ||
<URL>can://192.168.1.221:29536</URL><Bus name="can0"/></CANBeacon> | ||
|
||
Note that it should say 'can0' and not 'vcan0'. | ||
If everything ok so far, what is quite suprisingly, then run this command to activate service on boot. | ||
|
||
sudo systemctl enable socketcand.service | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
sudo reboot | ||
|
||
Check for discovery again. | ||
Now you can connect to IP: raspberrypi.local on TCP port 29536 (default) to start working with remote CAN. Check protocol file for commands and its description. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no
sudo
for those above neededThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for ssh needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or for sd card access. i dont know, other way it throws errors
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, only use
sudo make install
all others don't need root permission.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I see where the problem is. Don't change to
/boot
. You can directly start thegit clone
in your home directory.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't do this in
/boot
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why s that? its easy to copypaste files from my windows machine
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Under Linux
/boot
is for booting the system. A mistake there might lead to an unbootable system. This is why normal users don't have write permission there. Your home directory is where you can and should do your things.