m10k / canny Goto Github PK
View Code? Open in Web Editor NEWSimple CAN-over-IP gateway
License: GNU General Public License v3.0
Simple CAN-over-IP gateway
License: GNU General Public License v3.0
In relation to the CAN bus speed ajustment functionality there is a new CAN FD protocol that deals with faster network and capacity.
It would be nice that canny be able to extend CAN FD over tcp/ip like is does for regular CAN bus
Thanks for your consideration on this feature.
Running canny fails on an raspberry pi:
pi@CANot:~/Downloads/canny $ ./canny -p 1234
bind: Invalid argument
Failed to initialize CAN socket
I have can0
and can1
ports open and simulated traffic (cangen) on can0.
I have a Raspberry Pi and use virtual can interface.
But it not in list of interfaces of struct ifreq
2023-09-22 00:28:36+0200 [INF] Found CAN interface: lo
2023-09-22 00:28:36+0200 [INF] Found CAN interface: eth0
2023-09-22 00:28:36+0200 [INF] Found CAN interface: wlan0
eth0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
ether b8:27:eb:0e:50:e5 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 32 bytes 2682 (2.6 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 32 bytes 2682 (2.6 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
vcan0: flags=193<UP,RUNNING,NOARP> mtu 72
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 1000 (UNSPEC)
RX packets 1268178 bytes 8674723 (8.2 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1268178 bytes 8674723 (8.2 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.3.75 netmask 255.255.255.0 broadcast 192.168.3.255
inet6 fe80::c441:e7:e65d:db09 prefixlen 64 scopeid 0x20<link>
ether b8:27:eb:5b:05:b0 txqueuelen 1000 (Ethernet)
RX packets 64424 bytes 24806192 (23.6 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 73311 bytes 10967443 (10.4 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
This is a bug?
Environment:
CAN-over-IP tunnel
Connect two CAN buses over an IP network, start canny on two different machines like the following example.
Start a canny server on machine A is Canny Server (let's assume its IP is 10.0.0.1):
$ canny -p 1234
Then, start canny as a client on machine B now a Canny Client:
$ canny -c 10.0.0.1 -p 1234
Now, messages received on any CAN interfaces on machine A will be forwarded to all CAN interfaces of machine B, and vice-versa. Again, messages will not be forwarded between different CAN interfaces of the same machine.
Feature
It is a feature and a question at the same time… Maybe the speed already ajusts at connection time.
Add a command line parameter that will instruct canny to test and adjust the CAN bus speed of its CAN controller bus as sensed on the bus.
Use case
In some case, we use CAN bus tools(Canny Server A) that monitor different remote equipements (Canny Client B).
A self speed adjusting CAN bus on the Canny Server A would allow us to change and swap the Server side tool and not to worry about the various default speed they use as some of them are old equipment at lower speed.
A self speed adjusting CAN bus on the Canny Client B would allow us to move and connect the little RPi from CAN bus to Can bus and not to worry about the various default speed they use on their respective bus.
We trust the TCP network will play its role and transparently provide a transparent buffering of the communication between the two ends with no regards on their respective speed.
Right now, the CAN bus speed is determined by either the default or the explicit speed value provided to the MCP2515 Controller at the initiation of the drivers. In my application it is 500 kbps. It works most of the time but there are exception at 200k and new device are coming out at 1meg.
For example I would like to be able to start canny like this:
$ canny –as –p 12334 where –as would mean autospeed
$ canny –as -c 10.0.0.1 -p 1234 where –as would mean autospeed
In that case, canny would adapt to the actual CAN bus speed: 200k 500k, 1M or whatever detected on the interface…
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.