Testing the Modbus Device plugin

One the very useful new plugins is a generic Modbus Device plugin, which allows you to query and define new data sources for devices that don’t yet have a SolarNode plug-in built.  All you need is a RS-485 adapter in your SolarNode, and a 2-wire connection to your device. I won’t go over the wiring aspects and termination involved with RS-485 Modbus RTU devices, but the basic setup assumes that you can connect to your device and read the registers on the device.  As an example, we took a look at a Pyranometer from Rika Sensors called the RK200-03.

This is a thermopile type device that looks very sturdy and ready for outdoor use – to learn more about the way this type of pyranometer actually works, checkout this link.  But most importantly, a pyranometer should produce an instantaneous irradiance value in watts per meter squared, and often you need to place these devices in a shade-free location near your solar array in the horizontal plane – often a long wiring run.  But this is straightforward with a SolarNode – in our case, we used a USB RS485 adapter that shows up as device:


on the SolarNode.  We then connected the pyranometer and powered it with 5VDC – it’s default Modbus ID was set to the value 1.  We could then test that SolarNode could grab data off the single register that held the irradiance value by using mbpoll compiled for ARM with the syntax:

mbpoll -0 -a 1 -b 9600 -m rtu -r 0 -t 4 -P none -4 /dev/ttyUSB0

This returned an integer value that changed with light intensity.  We then installed a new repository on our node under the Settings tab on the SolarNode like so:


and were able to install the generic Modbus Device plugin.  Because this was a brand new SolarNode, it decided that we needed underlying support for serial modbus devices and so it automatically added them. Back in the Settings menu we could see the Components we now had installed and were ready to configure.

To manage the new component, we just clicked on Manage to make sure it used the right Modbus serial port, also defined on this part of the admin interface.  Then we configured the Modbus Device plugin by setting up a new property we called “irradiance”, in this case at address 0 of the Rika sensor. (with other devices such as kilowatt-hour meters or solar inverters, you can add lots of different properties):

And after a few minutes – by default the SolarNode will acquire data every 60 seconds – it had logged a bunch of data from this new modbus device – see that spot value of irradiance=31 in the image below:

Then we set up a SolarConsole dashboard for this node, and for comparison, add some other data sources such as the PV array output near this device. Now we have an updating web app showing you valuable solar information in a visual format – so we’re pretty encouraged by what kind of data sources you can add and compare to others.  The generic Modbus Device plugin feels pretty handy for doing diagnostics or taking a look at a new piece of gear you might want to support!