You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are many popular industry-grade MODBUS devices that can be used for IoT purposes.
I purchased some of them: energy meters, humidity/temperature sensors, relay boards, UART-RS485 boards, DIN relays, etc.
So that's a pity that it is not supported by Cayenne environment.
So I did some quick setup to test how it works in practice.
I took ESP8266 devkit, ORNO energy meter, relay and built power switch with energy monitor. There are many such devices on Aliexpess, some of them are based on ESP8266. I tested one from Edimax and it works unreliably. While in local network it works just fine, outside of it works sometimes. So it is not the way to go. One idea is to replace the firmware with some alternative, another is to build it. Modbus is already supported by Arduino so why not to try. I connected 15$ energy meter to 2$ ESP8266 devkit, added 1$ UART to RS485 converter, some old Nokia phone charger SMPS board and wrote a few lines of code. I added also mains outlet and 2$ electrical box with DIN rail.
Here is the bricolage
The code is very simple:
result = node.readHoldingRegisters(0, 9);
if (result == node.ku8MBSuccess)
{
Cayenne.virtualWrite(4, (float)node.getResponseBuffer(0x00)/10,"voltage", "Volts"); //voltage
Cayenne.virtualWrite(5, (float)node.getResponseBuffer(0x01)/10, "current", "Ampere");//current
Cayenne.virtualWrite(6, (float)node.getResponseBuffer(0x02)/10, "freq", "Hertz" );//frequency
Cayenne.virtualWrite(7, node.getResponseBuffer(0x03), "pow", "Watts");//Active power
Cayenne.virtualWrite(8, node.getResponseBuffer(0x04), "pow", "Watts");//Reactive power
Cayenne.virtualWrite(9, node.getResponseBuffer(0x05), "pow", "Watts");//Apparent power
Cayenne.virtualWrite(10, (float)node.getResponseBuffer(0x06)/1000);//Power factor
Cayenne.virtualWrite(11, (float)(node.getResponseBuffer(0x07) *256 + node.getResponseBuffer(0x08))/1000);// Active energy
Cayenne.virtualWrite(12, node.getResponseBuffer(0x03), "pow", "Watts");//Active power
}
}
And the result
The text was updated successfully, but these errors were encountered:
There are many popular industry-grade MODBUS devices that can be used for IoT purposes.
I purchased some of them: energy meters, humidity/temperature sensors, relay boards, UART-RS485 boards, DIN relays, etc.
So that's a pity that it is not supported by Cayenne environment.
So I did some quick setup to test how it works in practice.
I took ESP8266 devkit, ORNO energy meter, relay and built power switch with energy monitor. There are many such devices on Aliexpess, some of them are based on ESP8266. I tested one from Edimax and it works unreliably. While in local network it works just fine, outside of it works sometimes. So it is not the way to go. One idea is to replace the firmware with some alternative, another is to build it. Modbus is already supported by Arduino so why not to try. I connected 15$ energy meter to 2$ ESP8266 devkit, added 1$ UART to RS485 converter, some old Nokia phone charger SMPS board and wrote a few lines of code. I added also mains outlet and 2$ electrical box with DIN rail.
Here is the bricolage
The code is very simple:
And the result
The text was updated successfully, but these errors were encountered: