I am starting a project where I am using CANBUS connected actuated valves. I can operate the valves in Windows using the USBTinViewer and Thomas Fischl's CANBUS adapter. I can also operate the valves in Linux using can-tools (candump and cansend) which are based on SocketCAN and some cheap Chinese MCP2515 based interfaces. This is my starting point.

I want to write my application in Perl on Linux because that is the language and environment I enjoy and I will use the MCP2515 interface because it is cheap and supported. End result of the whole project is the automation of a solar radiant heating system and the valves will dynamically control the zoned hot water flow through the Pex tubing in my floors.

What I cannot find is an example of a Perl script using SocketCAN. There was one mention on the Web of an IO::Socket::CAN module being developed but I cannot find this or any module on CPAN for using SocketCAN or anything CANBUS for that matter. What would I have to do to use SocketCAN in Perl? Would I need to develop a new module? If so, how does one go about this?

Another option I see is to use the socketcand daemon (which I just found and started reading about while writing this post) and connect to this daemon using Perl. Would that be a good or maybe even the best option? Please help to send me down the right path.

Steve


In reply to SocketCAN - Anyone been there? Where do I start? by granitesmasher

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.