libmodbus-dev

Christian Ehrhardt christian.ehrhardt at canonical.com
Mon Jan 16 06:42:48 UTC 2023


On Sat, Jan 14, 2023 at 10:35 PM walter graham
<walter_graham at hotmail.com> wrote:
>
>
>
> Hi there!
>
> I installed libmodbus-dev from https://libmodbus.org/getting_started/
>
> However, I am new to this and have no idea how to "run" libmodbus or even what the command is.
> Can you point me in the right direction?  The website seems like it's only for installing.

Hi Walter,
libmoddbus is "only" a library, it won't do much for you on its own.
Packages with the -dev suffix [1] in particular are usually containing
headers, pkgconfig, and man pages of that library, so that you can
start to write a program that uses it.
The actual library [2] with code is currently in the `libmodbus5`
package, but again - a library on its own won't do much.

Since you seem to look for a tool, more than a library we can have a
look which packages in the Ubuntu Archive use that library via

$ reverse-depends --release=lunar libmodbus5
Reverse-Recommends
* collectd
Reverse-Depends
* libmodbus-dev
* linuxcnc-uspace
* mbpoll
* nut-modbus
* zabbix-agent

Of these, description-wise, mbpoll might be closer to what you look for:

$ apt-cache show mbpoll
...
Description-en: command line utility to communicate with ModBus slave
(RTU or TCP)
 mbpoll uses libmodbus (http://libmodbus.org/).
 Although the syntax of these options is very close modpoll proconX program,
 it is a completely independent project.
 .
 mbpoll can:
 .
  - read discrete inputs
  - read and write binary outputs (coil)
  - read input registers
  - read and write output registers (holding register)
 .
 The reading and writing registers may be in decimal, hexadecimal or
 floating single precision.

Not sure if that was the tool you were looking for, but understanding
the difference between library and programs will be an important step
#1 in any case.

[1]: https://www.debian.org/doc/debian-policy/ch-sharedlibs.html#development-files
[2]: https://www.debian.org/doc/debian-policy/ch-sharedlibs.html#shared-libraries


> My only experience is setting up master and slave back in 1993 on msdos.  I am not quite sure where to start with Linux.
>
> I could not find anything in my desktop start menu so tried Terminal command line using libmodbus and libmodbus-dev and those commands are not found.  I re-installed libmodbus-dev using Synaptic Package manager and no change.
>
> Thank you,
> Walt
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> "They ceased to wear their prosperity with moderation and the universe struck them down" Plato
>
> --
> Ubuntu-devel-discuss mailing list
> Ubuntu-devel-discuss at lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel-discuss



--
Christian Ehrhardt
Senior Staff Engineer, Ubuntu Server
Canonical Ltd



More information about the Ubuntu-devel-discuss mailing list