LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-13-2020, 07:15 AM   #1
WarumLinuxBesserIst
LQ Newbie
 
Registered: Mar 2016
Location: Germany
Distribution: Ubuntu
Posts: 5

Rep: Reputation: Disabled
Question Send command to ELM327 via USB and get the answer in a $VAR?


Hello,

I am looking for a solution, to send a command to my ELM327 device, connected via /dev/ttyUSB0

I figured out, that I can connect by the command:
screen /dev/ttyUSB0

There I can type a for example: 01 01
and I will receive an answer.

But I am looking for a solution, to send this 01 01 command via bash script and fetch the answer in a $VAR
so I can analyze this data in a bash script.

And idea?

Thanks Alex
 
Old 12-13-2020, 08:31 AM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,821

Rep: Reputation: 5960Reputation: 5960Reputation: 5960Reputation: 5960Reputation: 5960Reputation: 5960Reputation: 5960Reputation: 5960Reputation: 5960Reputation: 5960Reputation: 5960
I have always found communications more reliable using a "real" programming language with a serial port. I would suggest trying python and it is possible to write a script to just send and receive data to be processed by bash. What makes serial communications difficult in bash is determining if you have received all of the bytes as sent by the device.

There is existing software for reading OBD data and it looks like this works with the ELM327.

http://www.obdtester.com/pyobd
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ELM327 Clone Scantool !.1.5 FTDI USB interface bgovan Linux - Hardware 0 08-04-2014 06:44 AM
[SOLVED] I accidentally removed all contents of /var/log - please send me your /var/log hearthstone Debian 6 12-18-2012 08:09 PM
I accidentally removed all contents of /var/log - please send me your /var/log (OT) syg00 Debian 1 12-16-2012 07:16 AM
[SOLVED] get var value when var name is part of another var bilyboy65 Linux - Newbie 9 10-21-2012 09:32 AM
notation difference: var=`command` and var=$(command) ? ldp Linux - General 8 06-26-2006 06:32 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:33 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration