Bu repoda python ile CAN-Bus çalışmalarını nasıl gerçekleyeceğiniz anlatılmaktadır.

Overview

CAN-Bus-with-Python

"CAN Bus 1980'li yıllarda Robert BOSCH tarafından geliştirilmiş bir iletişim protokoldür. Hızlı ve hata oranının çok düşük olması sebebi ile günümüzde otomotiv sektöründe yaygın olarak kullanılmaktadır. Diğer iletişim protokollerine göre farkı; elektronik birimlerin adreslendiği master-slave metodu yerine mesajların adreslendiği multimaster bir yapıda olmasıdır."

"Siz de kendi bilgisayarınızda sanal bir CAN Bus hattı simüle ederek çalışmalarınızı gerçekleştirebilirsiniz"

NOT: CAN Bus hattı linux işletim sistemi üzerinde simüle edilmektedir. Eğer linux işletim sistemi kurulu bir bilgisayarınız yoksa Windows üzerine virtual machine olarak ubuntu kurarak kolayca çalıştırabilirsiniz.

STEP 1

sudo modprobe vcan
sudo ip link add dev vcan0 type vcan
sudo ip link set up vcan0 

"İlk komut satırı ile bilgisarınızda bir nevi can sanal makinası kurdunuz. İkinci komut satırı ile bu sanal makinaya vcan0 adında bir CAN Bus hattı bağlanmanızı sağlar. Üçünü satır ile oluşturduğunuz sanal can hattı etkinleştirilir. "

STEP 2

"Artık sanal CAN hattınızı dinleyebilirsiniz. Yapmanız gereken yeni bir teminal açarak aşağıdaki kodu yazmanız"

candump vcan0

"İlk CAN mesajınızı terminal üzerinden gönderebilirsiniz"

cansend vcan0 001#1234567890ABCDEF

"Yukarıda verilen kod satırı ile can0 hattına 001 adresli 123456789ABCDEF mesajı göndermiş olduk."

Screenshot2021-12-28 21_40_22

STEP 3

"Aşağıdaki komut ile tek tek mesaj yollamak yerine bilgisayarın sizin için rastgele can mesajları göndermesini sağlayabilirsiniz"

cangen vcan0
Screencast2021-12-28.21_50_38.mp4

STEP 4

"python ile CAN Bus operasyonları yapabilmek için python-can kütüphanesini kuralım"

pip install python-can

"Şimdi herhangi bir python dosyası oluşturup aşağıdaki kod ile can hattını dinleyerek yazdırabilirsiniz"

import can 

bus = can.interface.Bus(bustype = "socketcan", channel= "vcan0", bitrate = 250000)

while True:
    msg = bus.recv()
    print(msg)
Screencast2021-12-28.21_52_15.mp4

SON

"Merhaba ben YEC, umarım yardımcı olmuştur. Repoya eklediğim örnek kodları inceleyip python kullanarak mesaj gönderme, alma ve filtreleme gibi birçok farklı çalışma yapabilirsiniz. Linkedin hesabımdan beni takip edebilir ve sorularınızı sorabilirsiniz."

Linkedin

Owner
Yunus Emre Coşkun
Yunus Emre Coşkun
A small project of two newbies, who wanted to learn something about Python language programming, via fun way.

HaveFun A small project of two newbies, who wanted to learn something about Python language programming, via fun way. What's this project about? Well.

Patryk Sobczak 2 Nov 24, 2021
YunoHost is an operating system aiming to simplify as much as possible the administration of a server.

YunoHost is an operating system aiming to simplify as much as possible the administration of a server. This repository corresponds to the core code, written mostly in Python and Bash.

YunoHost 1.5k Jan 09, 2023
A Curated Collection of Awesome Python Scripts

A Curated Collection of Awesome Python Scripts that will make you go wow. This repository will help you in getting those green squares. Hop in and enjoy the journey of open source. 🚀

Prathima Kadari 248 Dec 31, 2022
PwnDatas-DB-Project(PDDP)

PwnDatas-DB-Project PwnDatas-DB-Project(PDDP) 安裝依賴: pip3 install pymediawiki 使用: cd /opt git https://github.com/JustYoomoon/PwnDatas-DB-Project.git c

21 Jul 16, 2021
Howell County, Missouri, COVID-19 data and (unofficial) estimates

COVID-19 in Howell County, Missouri This repository contains the daily data files used to generate my COVID-19 dashboard for Howell County, Missouri,

Jonathan Thornton 0 Jun 18, 2022
Petuhlang is a joke-like language, based on Python.

Petuhlang is a joke-like language, based on Python. It updates builtins to make a new syntax based on operators rewrite.

DenyS 9 Jun 19, 2022
A project for Perotti's MGIS350 for incorporating Flask

MGIS350_5 This is our project for Perotti's MGIS350 for incorporating Flask... RIT Dev Biz Apps Web Project A web-based Inventory system for company o

1 Nov 07, 2021
Stack-overflow-import - Import arbitrary code from Stack Overflow as Python modules.

StackOverflow Importer Do you ever feel like all you’re doing is copy/pasting from Stack Overflow? Let’s take it one step further. from stackoverflow

Filip Haglund 3.7k Jan 08, 2023
Simple Python API for the Ergo Platform Explorer

Ergo is a "Resilient Platform for Contractual Money." It is designed to be a platform for applications with the main focus to provide an efficient, se

7 Jul 06, 2021
Rufus port to linux, writed on Python3

Rufus-for-Linux Rufus port to linux, writed on Python3 Программа будет иметь тот же интерфейс что и оригинал, и тот же функционал. Программа создается

10 May 12, 2022
Estimating the potential photovoltaic production of buildings (in Berlin)

The following people contributed equally to this repository (in alphabetical order): Daniel Bumke JJX Corstiaen Versteegh This repository is forked on

Daniel Bumke 6 Feb 18, 2022
The most widely used Python to C compiler

Welcome to Cython! Cython is a language that makes writing C extensions for Python as easy as Python itself. Cython is based on Pyrex, but supports mo

7.6k Jan 03, 2023
Excel cell checker with python

excel-cell-checker Description This tool checks a given .xlsx file has the struc

Paul Aumann 1 Jan 04, 2022
UF3: a python library for generating ultra-fast interatomic potentials

Ultra-Fast Force Fields (UF3) S. R. Xie, M. Rupp, and R. G. Hennig, "Ultra-fast interpretable machine-learning potentials", preprint arXiv:2110.00624

Ultra-Fast Force Fields 24 Nov 13, 2022
Add your recently blog and douban states in your GitHub Profile

Add your recently blog and douban states in your GitHub Profile

Bingjie Yan 4 Dec 12, 2022
The parser of a timetable of tennis matches for Flashscore website

FlashscoreParser The parser of a timetable of tennis matches for Flashscore website. The program collects the schedule of tennis matches for two days

Valendovsky 1 Jul 15, 2022
This is some simple code to scrape vistbook's system to get an overview of the different cabins availability.

DNT_cabin_availability_system This is some simple code to scrape visbook's system to get an overview of the different cabins availability. The system

Andreas Lorentzen 1 Sep 25, 2022
banking system with python, beginner friendly, preadvanced level

banking-system-python banking system with python, beginner friendly, preadvanced level Used topics Functions else/if/elif dicts methods parameters hol

Razi Falah 1 Feb 03, 2022
Dicionario-git-github - Dictionary created to help train new users of Git and GitHub applications

Dicionário 📕 Dicionário criado com o objetivo de auxiliar no treinamento de nov

Felippe Rafael 1 Feb 07, 2022
Blender addons - A collection of Blender tools I've written for myself over the years.

gret A collection of Blender tools I've written for myself over the years. I use these daily so they should be bug-free, mostly. Feel free to take and

217 Jan 08, 2023