Re: [collectd] Modbus support
Hi Florian, If you have a look at http://en.wikipedia.org/wiki/Modbus you can see the difference in frame format. Basically there are three variants: Modbus RTU - modbus over serial interface, includes using CRC calculations for error checking Modbus RTU over TCP - sends the RTU over a TCP/IP connection to a remote serial interface. Still uses RTU frame format including CRC calculations Modbus/TCP - has a slightly different frame format and doesn't use CRC calculations. Unfortunately the last two variants are often confused :-) libmodbus appears to currently support Modbus RTU and Modbus/TCP. Regards, Matt Hi Matt, On Fri, Jan 07, 2011 at 10:33:34PM +1030, Matt Baker wrote: Unfortunately though I discovered that the device I am using to do the Modbus conversion supports Modbus/TCP for interfaces connected directly, but provides a Modbus RTU over TCP for other external Modbus serial devices. I thought that's what Modbus/TCP was, the Modbus protocol encapsulated in a TCP stream rather than written to a serial interface. How is this RTU over TCP thing different? Is there an additional protocol layer? Before I start going into this too far I was wondering if you had any thoughts on how difficult it would be to modify collectd to do this? I'd actually implement this for libmodbus first, then adapt collectd / the Modbus plugin if necessary. Author and maintainer of libmodbus is Stéphane Raimbault who is very likely a much better help with anything Modbus related than I am ;) Best regards, —octo -- Florian octo Forster Hacker in training GnuPG: 0x0C705A15 http://octo.it/ ___ collectd mailing list collectd@verplant.org http://mailman.verplant.org/listinfo/collectd
Re: [collectd] Modbus support
Hi Matt, On Fri, Jan 07, 2011 at 10:33:34PM +1030, Matt Baker wrote: Unfortunately though I discovered that the device I am using to do the Modbus conversion supports Modbus/TCP for interfaces connected directly, but provides a Modbus RTU over TCP for other external Modbus serial devices. I thought that's what Modbus/TCP was, the Modbus protocol encapsulated in a TCP stream rather than written to a serial interface. How is this RTU over TCP thing different? Is there an additional protocol layer? Before I start going into this too far I was wondering if you had any thoughts on how difficult it would be to modify collectd to do this? I'd actually implement this for libmodbus first, then adapt collectd / the Modbus plugin if necessary. Author and maintainer of libmodbus is Stéphane Raimbault who is very likely a much better help with anything Modbus related than I am ;) Best regards, —octo -- Florian octo Forster Hacker in training GnuPG: 0x0C705A15 http://octo.it/ signature.asc Description: Digital signature ___ collectd mailing list collectd@verplant.org http://mailman.verplant.org/listinfo/collectd
Re: [collectd] Modbus support
Hi Florian, I managed to build against modbus 2.0.3 using the code checked out using the Git repository and this appears to function just fine. Unfortunately though I discovered that the device I am using to do the Modbus conversion supports Modbus/TCP for interfaces connected directly, but provides a Modbus RTU over TCP for other external Modbus serial devices. I am looking at either writing some code on the device to do a Modbus TCP to Modbus RTU conversion, or maybe it is possible to use the libmodbus in RTU mode over a TCP connection? Before I start going into this too far I was wondering if you had any thoughts on how difficult it would be to modify collectd to do this? Cheers, Matt Hi Matt, On Wed, Jan 05, 2011 at 09:25:00PM +1030, Matt Baker wrote: Initially I tried against the latest unstable version of libmodbus, 4.9.2 but found that running configure of collectd did not find the modbus libraries unless I used 'force'. unfortunately, the author of libmodbus breaks backwards compatibility often, especially in the releases after 2.0.3 which are marked experimental. That's why those newer versions will only be supported when another stable version emerges. The current master branch contains some compatibility code with 2.9.2, but this will be updated as libmodbus changes. Use 2.0.3 for now to be safe. Switching to libmodbus 2.0.3 and the configure run found everything okay, but the compile is resulting in: A fixed version of the code is available in the Git repository and will be released as 4.10.3 eventually. The commit fixing this is 491712a [0], you can download the fixed file from [1]. Just out of curiosity, can you share what you're using the plugin for? Best regards, —octo [0] https://github.com/octo/collectd/commit/491712ab7dd36eb58fba23942f5edf4b76b50361 [1] https://github.com/octo/collectd/raw/491712ab7dd36eb58fba23942f5edf4b76b50361/src/modbus.c -- Florian octo Forster Hacker in training GnuPG: 0x0C705A15 http://octo.it/ ___ collectd mailing list collectd@verplant.org http://mailman.verplant.org/listinfo/collectd
Re: [collectd] Modbus support
Hi Octo, Thankyou for getting back to me so quickly and your help. I will give the updated code a try later today. The plan in regards to the modbus plugin was to use Collectd as part of a building management system. At the moment we have some airconditioning and power systems connected by modbus to a serial/ethernet gateway unit. This device [0] already allows us to map modbus registers through to snmp which we monitor using Nagios and graph using pnp4nagios. This works well, but we are limited to the number of registers we can map through to snmp. Instead I was looking at talking direct modbus/tcp to the gateway with collectd, and then use collectd-nagios to send through to Nagios warnings if values fall out of range. cheers, Matt [0] http://www.barix.com/Barionet_100/511/ Hi Matt, On Wed, Jan 05, 2011 at 09:25:00PM +1030, Matt Baker wrote: Initially I tried against the latest unstable version of libmodbus, 4.9.2 but found that running configure of collectd did not find the modbus libraries unless I used 'force'. unfortunately, the author of libmodbus breaks backwards compatibility often, especially in the releases after 2.0.3 which are marked experimental. That's why those newer versions will only be supported when another stable version emerges. The current master branch contains some compatibility code with 2.9.2, but this will be updated as libmodbus changes. Use 2.0.3 for now to be safe. Switching to libmodbus 2.0.3 and the configure run found everything okay, but the compile is resulting in: A fixed version of the code is available in the Git repository and will be released as 4.10.3 eventually. The commit fixing this is 491712a [0], you can download the fixed file from [1]. Just out of curiosity, can you share what you're using the plugin for? Best regards, —octo [0] https://github.com/octo/collectd/commit/491712ab7dd36eb58fba23942f5edf4b76b50361 [1] https://github.com/octo/collectd/raw/491712ab7dd36eb58fba23942f5edf4b76b50361/src/modbus.c -- Florian octo Forster Hacker in training GnuPG: 0x0C705A15 http://octo.it/ ___ collectd mailing list collectd@verplant.org http://mailman.verplant.org/listinfo/collectd