Skip to content
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
R

RWoerz

@RWoerz
  • Getting Started
  • Controller
  • Build
  • Hardware
  • Download/API
  • Forum
  • Store
About
Posts
51
Topics
13
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • ESP32 as a sensor controller
    R RWoerz

    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.

    Hardware

  • How to workaround a dead Gateway.
    R RWoerz

    Thanks for the quick reply. I'll have a look.

    Development

  • How to workaround a dead Gateway.
    R RWoerz

    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?

    Development

  • Solenoid water valve
    R RWoerz

    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

    General Discussion

  • Any good home automation controllers?
    R RWoerz

    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.

    Controllers

  • Looking for waterproof connectors
    R RWoerz

    @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.

    Hardware

  • Water pressure sensors?
    R RWoerz

    @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.

    Hardware

  • Water pressure sensors?
    R RWoerz

    @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.

    Hardware

  • Water pressure sensors?
    R RWoerz

    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)/7

    This 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-1023

    Then 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.

    Hardware

  • Vera Inclusion Issue
    R RWoerz

    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.2

    When 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:1

    Here 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 666

    And the Variables Tab looks like this.
    PluginVersion 1.5
    GWAddress 10.0.0.200:5003
    Unit I

    Troubleshooting

  • The Magic "void receive(const MyMessage & message)"
    R RWoerz

    Gohan thanks for the link https://www.mysensors.org/download/sensor_api_20. I’ve been on that page many times so not sure how I missed it. That said and the fact I'm not a programmer some working examples for each would be most useful. I wrote tons of 8080 assembly code back in the day but my only official programming class was Fortran (you know the before time). C++ has not been an easy language to learn.

    I’ve been looking for a replacement to the Arduino IDE for the past year. Every time I install one the steep learning curve keeps me from getting work done so I end up back where I started. I had much better tools back in the 70's working in assembly. At well over 1000 line of code and 21 tabs in just my Mega sketch I can use all the help I can get.

    0_1524074215568_Capture.PNG

    To be honest I’m about to give up on the whole Arduino thing so this project may be my last using this old 8 bit technology. Will Visual Studio Community Edition work with the newer micro controllers and maybe Python? Only my 5th or 6th programing language I'll have to learn.

    Thanks again for the help. I’ll try and figure out why the getInt() isn’t working for me.

    Troubleshooting

  • The Magic "void receive(const MyMessage & message)"
    R RWoerz

    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.

    Troubleshooting

  • atmega328p small (SMD) alternative with more memory?
    R RWoerz

    @tochinet
    If you don't need a lot of them use a Mega it has lots more memory. They're much cheaper than they used to be. Of course an ESP8266 will also work if you don't need all the pins.

    Hardware

  • 💬 Building a WiFi Gateway using ESP8266
    R RWoerz

    Sorry about the typing. I also have a question about radio pins. The ESP8266 sketch shows different pins for the radio then "Connecting the Radio". I don't see the pins defined in the sketch so where do I go to change them?

    Announcements

  • 💬 Building a WiFi Gateway using ESP8266
    R RWoerz

    One for thing will this work with a ESP32?

    Announcements

  • 💬 Building a WiFi Gateway using ESP8266
    R RWoerz

    Sorry but can someone explain the differance between "Server" and "Client" modes. I got my ESP8266 working with my Vera but then I install a RPi 3 I'm using for MQTT. Do I need 2 gateways, one for the Vera and another for MQTT? Even though I'm moving away from the Vera it's still usfull. Thanks for the help.

    Announcements

  • 💬 Sensebender Micro
    R RWoerz

    Can somebody please post what this boards current draw is at 8Mz w/wo a radio. Because it will live in a crawl space It's going to be plugged in. I've also added a very simple water detector.

    OpenHardware.io temperature atmega328 atsha204a humidity flash mysensors

  • [SOLVED] Sensebender Micro Baud Rate Issue.
    R RWoerz

    Thanks for the explanation. Makes perfect sense. In the past if there was a processor mismatch the programs would not download.

    Troubleshooting

  • [SOLVED] Sensebender Micro Baud Rate Issue.
    R RWoerz

    Sorry that was a Nano.

    Troubleshooting

  • [SOLVED] Sensebender Micro Baud Rate Issue.
    R RWoerz

    My grandfather told me not to get old you forget stuff. Sorry to say I lead you on a wild goose chase. Thanks for the help ends up I had an Arduino Micro hooked up on my bench I'd forgotten about. Looks like if you define it as a Sensebender Micro it will only talk to you at 230400, go figure.

    Thanks again. I know this will cost me some cred points but I hope I won't lose my secret handshake.

    Thanks again guys.

    Troubleshooting
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular