Sorry I found V_FLOW 34 Flow of water (in meter) S_WATER. What exactly does "in meter" mean?
RWoerz
@RWoerz
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.
Latest posts made by RWoerz
-
ESP32 as a sensor controller
I ran out of I/O pins on a ESP8266 for a project I'm working on. Can I use this MakerFocus ESP32 Development Board Upgraded Version 8MB Flash, ESP32 WiFi Bluetooth, ESP32 OLED 0.96 Inch OLED Display CP2102 Internet for Arduino ESP8266 NodeMCU to control sensors? I went down this path before buying a Arduino Due only to find out it wasn't supported and didn't want to make the same mistake again. Thanks for the help.
-
RE: How to workaround a dead Gateway.
Thanks for the quick reply. I'll have a look.
-
How to workaround a dead Gateway.
I've be working on a my DIY HVAC system for my shop for a couple of years and I'm currently using a ESP8266 for my GW with great success for over a year. Because the heater in the system is a water based solar panel if the sun is out and the water pump doesn't come on I can see temps in the solar panel raise to well over 160° F in no time. This is a real problem!
The other day the GW went on a walkabout to never never land and the Arduino Mega running the solar heater rebooted. The issue is the Mega just sat there waiting for the GW to come back online before it would go about doing it's real job of controlling the solar water heater.
Is there a way that if the GW is offline the sensors will continue to boot/work and from time to time check back in to see if the GW has returned from where every it wandered off to?
-
RE: Solenoid water valve
I've been look at this to do what you're asking.
https://www.amazon.com/gp/product/B06XX2PPGZ/ref=ox_sc_saved_title_2?smid=A20QEF2LEKCK8G&psc=1 -
RE: Any good home automation controllers?
Vera seemed like it would work and did for the one camera I bought that they sell. I couldn't get it to reliably work with MySensors. Could be me but NodeRed works for me.
-
RE: Looking for waterproof connectors
@raptorjr
Electricians use an anti-corrosive grease like stuff in areas of high humidity. You might try smearing the connector inside and out with that and then heat shrink the whole thing. Clean up the outside with alcohol and finish up with electrical tape.Plain old heavy axle grease may also do the trick. Just don't leave any voids, pack it solid.
-
RE: Water pressure sensors?
@gohan
gohan great solution wish I had thought of that! Not sure where I got the info that it wouldn't work. They didn't say how long it would take to get bad readings.
Because the pressure transducer I used is sealed you wouldn't have the same problem. As long as the connection were made watertight the sensor could just be installed at any level and it should work without the extra pump. Assuming you don't install it with the open end pointing down trapping a tiny bit of air in the opening. Not sure that would affect the readings but why take the chance. -
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: 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.
-
Vera Inclusion Issue
Inclusion not working. This seems to happen every time something changes i.e. MySensors version change, my ip scheme changes, phase of the moon, my brain farts etc. I'm guessing this is more a Vera/MySensors plugin issue than a GW problem but I've be wrong at least once in my life. Well maybe a few more times than one, maybe.
The GW and the Vera both responed to a pings.
I started by cleaing the GW's flash. I'm on MySensors 2.2.0 and Vera 1.7.3500. I using an Arduino Genuino Uno as a Eithernet 5100 GW with all the latest Arduino software and I downloaded the latest Arduino/Vera plugin's Ver. 1.5. This has worked in the passed. Normally in the Vera inclusion area the "Stop" button will be lit and when you press the "Start" button it will stay lit for the inclusion time of 60 sec. Right now neither one is lit and neither one will stay lit. They do light up if you hover over one of them. The 5100 is a Shield. The same Setting tab show the following
Connected to: 10.0.0.200:5003
Plugin Version: 1.5
Lib Version:
Unit:At startup Serial Debug shows the following on the GW. As you can see the radio works just fine.
0 MCO:BGN:INIT GW,CP=RNNGA---,VER=2.2.0
3 TSM:INIT
4 TSF:WUR:MS=0
11 TSM:INIT:TSP OK
12 TSM:INIT:GW MODE
14 TSM:READY:ID=0,PAR=0,DIS=0
17 MCO:REG:NOT NEEDED
320 GWT:TIN:IP=10.0.0.200
1323 MCO:BGN:STP
My Vera Gateway V2.1, 4/27/18
1324 MCO:BGN:INIT OK,TSP=1
1329 TSF:MSG:READ,6-6-0,s=0,c=1,t=0,pt=7,l=5,sg=0:33.0
1941 TSF:MSG:READ,25-25-0,s=0,c=1,t=0,pt=7,l=5,sg=0:77.0
1947 TSF:MSG:READ,25-25-0,s=4,c=1,t=0,pt=7,l=5,sg=0:66.2When I start up my Scene controller I see the following in Debug on the GW which is what Vera should need when adding this device.
1104624 TSF:MSG:READ,27-27-0,s=255,c=3,t=24,pt=1,l=1,sg=0:1
1104629 TSF:MSG:PINGED,ID=27,HP=1
1104634 TSF:MSG:SEND,0-0-27-27,s=255,c=3,t=25,pt=1,l=1,sg=0,ft=0,st=OK:1
1104648 TSF:MSG:READ,27-27-0,s=255,c=3,t=15,pt=6,l=2,sg=0:0100
1104690 !TSF:MSG:SEND,0-0-27-27,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=NACK:0100
1106678 TSF:MSG:READ,27-27-0,s=255,c=0,t=18,pt=0,l=5,sg=0:2.2.0
1106691 TSF:MSG:READ,27-27-0,s=255,c=3,t=6,pt=1,l=1,sg=0:0
1108691 TSF:MSG:READ,27-27-0,s=255,c=3,t=11,pt=0,l=14,sg=0:SceneCNTL V2.6
1108702 TSF:MSG:READ,27-27-0,s=255,c=3,t=12,pt=0,l=7,sg=0:4/26/18
1108812 TSF:MSG:READ,27-27-0,s=1,c=0,t=6,pt=0,l=9,sg=0:Shop Temp
1108920 TSF:MSG:READ,27-27-0,s=32,c=0,t=14,pt=0,l=12,sg=0:TempSetPoint
1109028 TSF:MSG:READ,27-27-0,s=50,c=0,t=47,pt=0,l=4,sg=0:Hour
1109136 TSF:MSG:READ,27-27-0,s=51,c=0,t=47,pt=0,l=3,sg=0:Min
1109379 TSF:MSG:READ,27-27-0,s=255,c=3,t=26,pt=1,l=1,sg=0:2
1109386 TSF:MSG:SEND,0-0-27-27,s=255,c=3,t=27,pt=1,l=1,sg=0,ft=0,st=OK:1Here is my GW sketch.
//
// My Vera 5100 GateWay V2.0 3/30/18
// Must have Soft SPI Enabled and the Rasio pins moved
// Also must have UDP Enabled
//
// * The GW code is designed for Arduino 328p / 16MHz. ATmega168 does not have enough memory to run this program.
// *
// * LED purposes:
// * - To use the feature, uncomment WITH_LEDS_BLINKING in MyConfig.h
// * - RX (green) - blink fast on radio message recieved. In inclusion mode will blink fast only on presentation recieved
// * - TX (yellow) - blink fast on radio message transmitted. In inclusion mode will blink slowly
// * - ERR (red) - fast blink on error during transmission error or recieve crc error
// *
// * See http://www.mysensors.org/build/ethernet_gateway for wiring instructions.
// *#define sketchInfo "My Vera Gateway V2.1"
#define sketchDate ", 4/27/18"// Enable debug prints to serial monitor
#define MY_DEBUG// Enable and select radio type attached
#define MY_RADIO_NRF24// Enable gateway ethernet module type
#define MY_GATEWAY_W5100// W5100 Ethernet module SPI enable (optional if using a shield/module that manages SPI_EN signal)
#define MY_W5100_SPI_EN 4// Enable Soft SPI for NRF radio (note different radio wiring is required)
// The W5100 ethernet module seems to have a hard time co-operate with
// radio on the same spi bus.
//#if !defined(MY_W5100_SPI_EN) && !defined(ARDUINO_ARCH_SAMD)
#define MY_SOFTSPI
#define MY_SOFT_SPI_SCK_PIN 14
#define MY_SOFT_SPI_MISO_PIN 16
#define MY_SOFT_SPI_MOSI_PIN 15
//#endif// When W5100 is connected we have to move CE/CSN pins for NRF radio
#ifndef MY_RF24_CE_PIN
#define MY_RF24_CE_PIN 5
#endif
#ifndef MY_RF24_CS_PIN
#define MY_RF24_CS_PIN 6
#endif// Enable to UDP
#define MY_USE_UDP#define MY_IP_ADDRESS 10,0,0,200 // If this is disabled, DHCP is used to retrieve address
// Renewal period if using DHCP
//#define MY_IP_RENEWAL_INTERVAL 60000
// The port to keep open on node server mode / or port to contact in client mode
#define MY_PORT 5003// Controller ip address. Enables client mode (default is "server" mode).
// Also enable this if MY_USE_UDP is used and you want sensor data sent somewhere.
#define MY_CONTROLLER_IP_ADDRESS 10,0,0,7// The MAC address can be anything you want but should be unique on your network.
// Newer boards have a MAC address printed on the underside of the PCB, which you can (optionally) use.
// Note that most of the Ardunio examples use "DEAD BEEF FEED" for the MAC address.
#define MY_MAC_ADDRESS 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0x01// Enable inclusion mode
#define MY_INCLUSION_MODE_FEATURE
// Enable Inclusion mode button on gateway
#define MY_INCLUSION_BUTTON_FEATURE
// Set inclusion mode duration (in seconds)
#define MY_INCLUSION_MODE_DURATION 60
// Digital pin used for inclusion mode button
#define MY_INCLUSION_MODE_BUTTON_PIN 3// Set blinking period
#define MY_DEFAULT_LED_BLINK_PERIOD 300// Flash leds on rx/tx/err
// Uncomment to override default HW configurations
#define MY_DEFAULT_ERR_LED_PIN 7 // Error led pin
#define MY_DEFAULT_RX_LED_PIN 8 // Receive led pin
#define MY_DEFAULT_TX_LED_PIN 9 // Transmit LED#if defined(MY_USE_UDP)
#include <EthernetUdp.h>
#endif
#include <Ethernet.h>
#include <MySensors.h>void setup()
{Serial.print(sketchInfo);
Serial.println(sketchDate);
}void loop() {
}The Vera Advanced Params Tab looks like this.
name MySensors Plugin
device_type urn:schemas-arduino-cc:device:arduino:1
altid
ip 10.0.0.200:5003
mac
manufacturer
model
id_parent 0
nobulk
embedded
disabled
restricted
device_file D_Arduino1.xml
id 246
room 2
impl_file
time_created 1524843290
device_json D_Arduino1.json
local_udn uuid:4d494342-5342-5645-00f6-000002aece62
commUse rs232
category_num 666And the Variables Tab looks like this.
PluginVersion 1.5
GWAddress 10.0.0.200:5003
Unit I