Sorry I found V_FLOW 34 Flow of water (in meter) S_WATER. What exactly does "in meter" mean?
Best posts made by RWoerz
-
RE: 💬 Serial Protocol - 2.x
-
RE: Water pressure sensors?
I use a pressure sensor on the output of the pump that feeds my solar hot water panel. I think I got mine on Amazon. They use a lot of them in automotive applications. They come in lots of different pressure ranges. On mine I think I first had to figure out how to convert the analog input port reading from a number to a raw voltage. Most important you will first need to take a reading of your sensor in open air. FYI most of these sensors will run with any gas or liquid i.e. air, oil, water, etc.
The math for the sensors looks something like this:
PSI=(Sensor Voltage - open air voltage)/7This is why we need the open air reading. If your current voltage reading and your open air voltage are the same that means you current pressure would be 0 zero, right?
The next part the 7 is a little more complicated but remember it's just a number and I think I got mine right off the spec sheet for the sensor. If you plotted a graph for every reading from 0 psi to the sensors max pressure the slope of that line is where the number 7 comes from. Technically it's the slope of the linear regression. But we don't care how we got it because someone even nerdier than than me did the math and it's on the spec sheet. That's why we buy a new one instead of taking one off an old motor at the junkyard.
With that info I first had to determine the raw sensor voltage. The Arduino returns a value of 0 - 1023 for a voltage of 0 - 5 volts (I mostly use 5V Arduino's) so to find the voltage I use the following line in my code.
First get the raw sensor value.
float rawSensorValue = analogRead(tankPumpPressurePin); // Read Pin A15 Value range 0-1023Then convert that value into a voltage.
float voltage = rawSensorValue * (5.0 / 1023.0);Then to get the actual pressure I had to do a little more math with the following line. On my sensor the open air reading was 109.
tankPumpPressure = ((rawSensorValue - 109) / 7);
The whole thing looks like this.
void readTankPumpPressure()
{
// Read Pin A15 Value range 0-1023
float rawSensorValue = analogRead(tankPumpPressurePin);
float voltage = rawSensorValue * (5.0 / 1023.0);
tankPumpPressure = ((rawSensorValue - 109) / 7); // Should be in PSI.
currentTankPumpPressure = tankPumpPressure; send(msg_tank_pump_pressure.setDestination(GW_ID).setSensor(Tank_Pump_Pressure_ID).set(currentTankPumpPressure, 1));
}I hope this helped I also take flow reading.
-
RE: How to workaround a dead Gateway.
Thanks for the quick reply. I'll have a look.
-
RE: Getting !TSF:ASID:FAIL,ID=0 Error In 2.0 Beta
I cleared the memory but not it seems with the MySensors Sketch so it didn't clear everything out. I ran the MySensors sketch today and everything works thanks.
-
RE: Water pressure sensors?
@rwoerz
Sorry to say you can't use a tube submerged in the water. That will only work for a very short time. I was going to use that method to take a pressure reading to see how much head (water depth) was in my water well. The problem as I was told is the air in the tube is eventually absorbed by the water ending with a pressure of zero. If you had a way of blowing the tube clear of water just before you took each reading that would work. -
RE: GatewayESP8266 Compile problem.
Thanks that seems to have worked. This is what is needed.
In the file MyGatewayTransportEthernet.cpp around line 301 the following changes need to be made. All the [0]'s need to be removed.Old:
#if defined(MY_GATEWAY_ESP8266)
_ethernetServer.read(inputString[0].string, MY_GATEWAY_MAX_RECEIVE_LENGTH);
inputString[0].string[packet_size] = 0;
debug(PSTR("UDP packet received: %s\n"), inputString[0].string);
const bool ok = protocolParse(_ethernetMsg, inputString[0].string);
#elseNew:
#if defined(MY_GATEWAY_ESP8266)
_ethernetServer.read(inputString.string, MY_GATEWAY_MAX_RECEIVE_LENGTH);
inputString.string[packet_size] = 0;
debug(PSTR("UDP packet received: %s\n"), inputString.string);
const bool ok = protocolParse(_ethernetMsg, inputString.string);
#else -
The Magic "void receive(const MyMessage & message)"
Let me start by saying I'm NOT a programmer so if you find something wrong here please let me know. I'm just the hardware guy which in the before time was magnitudes harder than it is today. I'm not dead yet but I'm also not young. So if I missed this information somewher, sorry.
I think it's Magic BUT but I'll talk about that later. There seems to be a lot of outdate information about node to node data transfer. I'll share what I know and then ask some questions. A lot about how this works has changed with newer versions of the MySensors software which makes most of the examples I found most confusing and time consuming.
I would like to thank the person that had this at the bottom of one of their sketchs as it answered a multitude of questions (but not all). I also found it invaluable for trouble shooting. I just need a longer list.
On the receiving end somewhere after void loop.
void receive(const MyMessage & message)
{
Serial.println("received something: ");
Serial.print("message.sender= "); // Node ID of the Sender
Serial.println(message.sender);
Serial.print("message.type= "); //Message type, the number assigned
Serial.println(message.type); // V_TEMP is 0 zero. etc.
Serial.print("message.sensor= "); // Child ID of the Sensor/Device
Serial.println(message.sensor);
Serial.print("message.payload= "); // This is where the wheels fall off
Serial.println(message.getFloat()); // This works great!
Serial.print("message.getBool()= ");
Serial.println(message.getBool()); // I think this does too
}
For me it showed the variable names used to dissect the serial protocal, the orignal was a little differant but I think it was a bit outdated. The big differance was how to read float values that are in the payload, I got the "get.float()" somewhere else. It works perfect if you want to read stuff like temps and humidities but not so great for intergers and strings so far. But being able to take the whole packet apart would be good to. I'm sure there's more. The "command" would also help.So my question is, where is the definitive list of these vairable names. I'm currently trying to send integers, I tried message.getInt() without any luck. The compiler didn't complain but it also didn't work. I think I saw somewhere how to read the "ACK" but that will have to wait for another day.
After a lot of reading and trial and error it turns out to be pretty easy to send data from one node to another and I don't think you even need a gateway? You need three things when you want to send something from one Node another Node. Important Safety Note: I'm pretty sure at least on your recieving Node the repeater feature has to be enabled, NO going to sleep!
Second on your transmitting end you'll need to add the destination Node ID as the second vairable in your send command.
send(msg.setDestination(recieving node ID).set(sensor ID).set(vairable))
This could just be me but a strange thing happened after sending the first message with the new destination, the system set that as its default. So if you wanted it to also go to the the GW you'll have to add a
setDestination( GW_Node_ID) or "0" zero to all of your "normal" send commands.And third on your receiving end you'll need the function: void receive(const MyMessage & message) line followed commands with what you want to do with the data and I've seen some complex ones.
The reason I called it Magic was because I have no clue how it works. As soon as you have the "void receive funtion" added to your scketch the data comes flooding in. If you have debug enabled you'll see packets coming in as soon as #include <MySensors.h> gets executed, it's totaly asynchronous. I've not run into it yet but be careful not to overrun your recieving end.
So if someone can fill in the list for us we would all be a little smarter.
I hope this was helpful to some, I wish I'd read it months ago writen by some one else. Maybe then my family wouldn't have threatened to put me on the cart. Sorry old movie reference for those that have never seen the funnist movie ever made.If you get this far thanks for reading my rantings.