LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 12-20-2015, 12:32 PM   #1
Mario Blunk
Member
 
Registered: Dec 2008
Location: Wild Eastern Germany
Distribution: OpenSuse Tumbleweed
Posts: 131

Rep: Reputation: 21
I2C via parallel port and bash script


Hi there,

what is the fastest way to get some I2C commands sent to any hardware connected to the PCs parallel port using i2c-parport (or similar) ?

The wiring as shown at
https://www.kernel.org/doc/Documenta...es/i2c-parport
is easy, so no need to talk about that.

But, I need a bash command like:
Code:
echo "start" "byte1" "byte2" "stop" > /dev/i2c_xyz
Thanks a lot !
 
Old 12-21-2015, 06:49 AM   #2
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,882
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
Quote:
Originally Posted by Mario Blunk View Post
But, I need a bash command like:
Code:
echo "start" "byte1" "byte2" "stop" > /dev/i2c_xyz
Maybe not exactly like what you have there, but "that" is the bash command form you'd use. You very much can echo to a port like ttyS0 for example:
Code:
echo "abc" > /dev/ttyS0
What I think you're looking for is how to echo non-printing characters using echo. I believe you would do something like this:
Code:
echo \x61\x62\x63 > /dev/ttyS0
And that would echo the "abc", but just using HEX. And therefore you could also echo HEX patterns which are non-printable.
 
  


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
Interfacing Web with CGI script for parallel port control (program) quandJe Programming 1 01-25-2012 01:20 AM
how to port bash script to c++? jaepi Programming 6 05-09-2007 09:36 PM
Parallel Port & Serial Port device identification helpmeforlinux Linux - Hardware 3 01-02-2007 01:15 AM
Parallel port/i2c interfacing question Mike Davies Linux - Hardware 0 10-01-2005 08:45 AM
parallel port and shell script legolin Programming 1 09-05-2004 12:53 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 05:02 PM.

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