Navigation

    • Register
    • Login
    • Search
    • OpenHardware.io
    • Categories
    • Recent
    • Tags
    • Popular
    1. Home
    2. boanjo
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    boanjo

    @boanjo

    20
    Reputation
    25
    Posts
    631
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online
    Website boan.dyndns.org Location LinkΓΆping, Sweden

    boanjo Follow

    Best posts made by boanjo

    • Christmas Tree watering node - seasonal greetings

      How to make your Christmas tree to remain green for several weeks? Plenty of water!

      Here is a project that will take care of the watering for You. Of course it can run without radio or mysensors but is great for monitoring and remote control (And you han add some extra alarms and safety nets)

      But be careful! We are dealing with water on places where we don't want any spill or leaks!

      0_1545469851948_IMG_20181220_211036.jpg

      A simple water sensor to measure the level in the base of the christmas tree. Normally i use etape for working with water levels but i considered it to be a bit too pricy (range 40-60$) for this project.

      0_1545468736650_water_sensor.JPG

      The level is checked roughly every second but the current is only on for 10ms to decrease the corrosion of the sensor. I think it will last one christmas at least ☺

      To fill the base i use a Peristaltic Liquid Pump. You can pick one up from your local Adafruit dealer or from ebay for ~15$. The pump can move 100ml / minute (i.e. like dripping once every two seconds or so) which is a very nice speed for this type of project. The sound level is like a brand new sewing machine so it's not supernoisy but nut supersilent either. I use a 5liter bucket with lid and all tubes are connected under the lid so if one gets disconnected it should stay in the bucket. Then both the tube and the water sensor is striped or taped to the tree.

      In my setup the pump works for just above one minute so it has then filled up around 100ml (but that depends on the thresholds you set of course)

      You can see the sensor box below and it's pretty simple don't think there is a need for schematics. Use a diode and a TIP120 to control the DC motor like below (I have a step up circuit from 5V to 12V)

      0_1545478676207_IMG_20181220_211319.jpg
      0_1545478544563_tip120-solenoid.png

      #define MY_DEBUG
      #define MY_RADIO_RFM69
      #define MY_IS_RFM69HW
      #define MY_RFM69_FREQUENCY RFM69_433MHZ // RFM69_433MHZ for development branch, RF69_433MHZ for master
      #define MY_RFM69_NEW_DRIVER
      
      #define MY_REPEATER_FEATURE
      #define MY_NODE_ID 42
      
      #define MY_RFM69_NETWORKID (170)
      
      #define CHILD_ID_LEVEL 2        
      #define CHILD_ID_PUMP  3       
      
      #include <MySensors.h>
      
      MyMessage levelMsg(CHILD_ID_LEVEL,V_LEVEL);
      MyMessage pumpMsg(CHILD_ID_PUMP, V_TRIPPED);
      
      long double HEARTBEAT_TIME = 60000;
      long double last_heartbeat_time = millis();
      const int read = A0; //Sensor AO pin to Arduino pin A0
      const int sensor_enable = 6;
      
      int value = -1;
      int readValue;
      int prevSentValue = -1;
      
      #define FILL_PIN 8
      #define STATE_IDLE 0
      #define STATE_FILL 1
      int state = STATE_IDLE;
      
      void before()
      {
        pinMode(sensor_enable, OUTPUT);
        digitalWrite(sensor_enable, LOW);
        pinMode(FILL_PIN, OUTPUT);
        digitalWrite(FILL_PIN, LOW);
      }
      
      void setup()
      {
      
      }
      
      void presentation()
      {
          // Send the sketch version information to the gateway and Controller
          sendSketchInfo("Cristmas Tree", "1.0");
      
          present(CHILD_ID_PUMP, S_BINARY);
          // Register this device as dust sensor as that seems easiest to map
          // to whatever you want (we want adc value)
          present(CHILD_ID_LEVEL, S_DUST);
      }
      
      
      void loop()
      {
      
        // No need to update more frequently than every second (or some more)
        wait(1000);
      
        // Enable the current in the water (Reduce corrosion compared to
        // continous 3.3V)
        digitalWrite(sensor_enable, HIGH);
        wait(10);
        readValue = analogRead(read);
        digitalWrite(sensor_enable, LOW);
        Serial.print("readValue = ");
        Serial.print(readValue);
      
        // Do some simple averaging unless first sample
        if(value == -1) {
          value = readValue;
        } else {
            value = readValue + value;
            value = value / 2;
        }
        Serial.print(", value = ");
        Serial.println(value);
      
        if(state == STATE_IDLE) {
          // The adc reading goes from 0 to ~150 when first in contact with water
          // 150-200 is within the first millimeter. Then the values increase in
          // a more linear manner.
          if(value < 200) {
            state = STATE_FILL;
            digitalWrite(FILL_PIN, HIGH);
            // Send both the level and the on so we can monitor for how long we
            // fill and are idle
            send(pumpMsg.set(state==STATE_FILL));
            send(levelMsg.set(value));
            prevSentValue = value;
          }
        }
        else if(state == STATE_FILL) {
          // Threshold at 360 (which is roughly half way on the mm scale
          // on the sensor ~20mm from empty) 
          // Note that since we are taking an average it will take a few seconds  
          // until we stop and so the value will be higher ~420
          if(value > 360) {
            state = STATE_IDLE;
            digitalWrite(FILL_PIN, LOW);
            // Send both the level and the on so we can monitor for how long we
            // fill and are idle
            send(pumpMsg.set(state==STATE_FILL));
            send(levelMsg.set(value));
            prevSentValue = value;
          }
        }
      
        int diff = value - prevSentValue;
        // Allow some jitter
        if(diff < 15 && diff > -15) {
      
          // no change but send anyway
          long double temp = (millis() - last_heartbeat_time);
          if (temp > HEARTBEAT_TIME) {
            // If it exceeds the heartbeat time then send a level anyway
            last_heartbeat_time = millis();
            send(levelMsg.set(value));
            prevSentValue = value;
      
          }
        } else {
          send(levelMsg.set(value));
          prevSentValue = value;
        }
      
      
      }
      
      void receive(const MyMessage &message)
      {
        Serial.print("msg");
          // We only expect one type of message from controller. But we better check anyway.
          if (message.type==V_STATUS) {
             // pulse = true;
              Serial.print("Incoming change for sensor:");
          }
      }
      

      If you hook up the sensor to your Homeautomation you should be able to monitor the sensor in action. You can then also take measures if the fill state (on) is longer than expected and raise an alarm and possibly to stop the watering all together.

      0_1545484636146_63bd7c01-d29e-460c-b2d4-2f65387a12cb-image.png

      As you can see the "normal" periodicity for me is watering every 3-4 hours and it fills for 1 to 1Β½ minute.

      0_1545484452499_chart.jpeg

      Wrap everything up in a nice present and enjoy! πŸ€—

      0_1545478963716_IMG_20181220_211359.jpg

      posted in My Project
      boanjo
      boanjo
    • flic.io -> homeautomation -> Garage Door node

      There are lots of Mysensors solutions for opening your garage here in this forum and here is another one πŸ˜€ . The Garage opener in itself is nothing strange (Pretty simple and naive approach to reuse a remote unit) but for me the missing piece of the puzzle was how to interact with the opener from my cars, and in the house. I then came across the flic.io buttons which I would like to share. Yes they are a bit too pricy πŸ˜• - but at least for me the biggest reason why to use mysensors is not to get the cheapest solutions (even if that is most often the case) but rather to build the exact solution I want and to have full control over it!

      The code can be found in my git repo: https://github.com/epkboan/myhome/tree/master/garage_door were also the text below is copied from

      Garage Door Opener
      Maybe you have an old motorized garage that you would like to control in a more flexible way? Or maybe you have lost one remote unit or the number of cars are more than the remotes. And after all it sort of defies the purpose of having a garage door opener if you have to leave the car to enter a code on the keylock :)...

      Here is a simple solution to pimp your system without having to hack the central control unit for the garage opener (and still be able to use the keypad if you have one of those). It requires you to strip one of your remote units for the garage door system and use a relay to emulate the button push. In my case the remote unit used a 12V battery so I added a step up from 5V to 12V to never have to bother about the battery life. But the battery could have stayed if you don't want the step up.

      I started out using my own built remote unit (a mysensors button node in low powered mode, deep sleep until button is pressed) but I then came across (flic.io) and then I just had to have some. You can then open the garage door at a longer distance from the house (think of all the seconds you don't have to wait in the car before the door is fully up. You are actually making money from the investment ;-)) as it communicates via your phone via Bluetooth and they are really small (size of a coin cell * 9mm) and nice looking.

      1

      I use 2 magnetic door/window switches for the door state. It then shows the state in Domoticz (or whatever home automation system you have), but i also have a small web interface (html page with a button to control it and a picture of the garage depending on its state CLOSED, OPEN, OPENING, STOPPED & CLOSING). I have considered having logic to exactly control the state of the door in the mysensors node but since I still allow the keylock (directly connected to the garage door system) it might still be a bit confusing and lots of corner cases. For me this works!

      2

      3

      BOM:

      • Arduino Mini pro ~$2
      • RFM69HW ~$2
      • Step up 5v to 12v ~$3
      • Box ~$5
      • Relay module ~$3
      • 2 window/door magnetic switches ~$1

      So you should be able to build this for around $15.

      Then to get this really nice and user friendly i recommend getting something like the flic.io buttons. They will cost you at least $20 each but they are sooo worth it. Stick it to the dashboard of your car, next to the door before you leave the house and you can reuse the buttons for other automation tasks too. Works with Low power Bluetooth together with your phone(s) via an app that support all sorts of requests (hue, IFTTT, web req....)

      4

      posted in My Project
      boanjo
      boanjo
    • High-end Weather Station

      ws - Weather Station

      alt text

      WS is a graphical frontend to be used on top of existing homeautomation (or it can be used standalone) like Domoticz or HomeAssistant and your own sensor network with MySensors. It is NOT a homeautomation controller but simply a listener on weather related sensors. To enable this listener pattern you need to have your MySensors hooked up via MQTT which is a popular way of disconnecting sensor networks and controller. It has a hardcoded web interface (even if it is of course possible for you to change) and the reason for this is that it has been satisfactory for a number of deployments over a number of years. What is a nice looking GUI is of course in the eyes of the beholder but for some reason i still think this is the best GUI for me with clear information without distracting details. It is also possile to read from a larger distance which i also consider important. The ws page runs on any server locally (including raspberry pi) or remote and to be displayed continously on a 10" tablet. I have a number of these systems that have been up for more than 5 years. You can use an app like the "Fully Kiosk Browser" on android. I have made my own simple app that switches webviews after fully loaded periodically every 30 sec which makes a seemless and very smooth UI experience. It also handles loss of wifi and other quirks that might happen. If there is an interest in the APP let me know and i can fix that!

      Here is a YouTube video where i'm going through the setup: https://youtu.be/JygoxuusSYA

      I have made a few architectural desicions:

      • I only support MQTT gateway (for example how to build one https://github.com/boanjo/myhome/tree/master/gateway_mqtt) and that is to be able to listen on the gateway and controller and only act as an addon for both new and existing systems. I also have a few systems that run over mobile internet without possibility to do port forwarding (which from security perspective should be avoided too if possible) hence keeping the web interface off site makes life easier for me to manage the systems.
      • I am using both polling the database and listen to websockets MQTT messages. This might seem a tad overcomplicated, but i want as fast feedback on the sensors as possible (especially wind gust and rain). In one prototype i used database only but with frequent polling. This didn't scale very well and caused quite high load on the mysqld and to my surprise also influxdbd even if only polling every 1-3 seconds or so. And vice versa it's not possible to only use mqtt as it doesn't store state. I.e. you need to be able to fetch the previous values anyway.
      • Keeping the webserver on a web host provider scales better if you have many listeners (like your whole neighbourhood ;-)) of the weather information
      • Quite many parameters are configurable in cfg directory. Change the names to suite your needs and let it be reflected in your docker-compose.yml file. I this example i have added two of my systems as inspiration. In many cases it's easier to do changes or extensions in the mqtt app (ws.py) or web app/template (app.py or weather.html)

      The MySensors network produces data continously (especially the wind (anemometer) which reports every 5 seconds (in case of change) for both speed and direction.

      1. This is reported from the gataway to the mosquitto MQTT server.
      2. The data is picked up by your controller (Domoticz, HA..) if you subscribe to the topic and the same infromation is then also picked up by the WS MQTT app. This is a python client using paho library to listen and send MQTT messages.
      3. The MQTT app translates the data into a more readable format and republishes it under a new topic (that you decide in your config.json)
      4. The MQTT app also stores the data in a MySql database (could just as well been an influxdb) with the exception of wind that is stored less frequent like wind speed peak every 30 sec and median direction every 15 min.
      5. The Web client continously listens for changes one the WS topic (sent in 4) via MQTT over websockets. This allows to have "realtime" changes to the data. So when you hear the wind gust you will see the speed on your display within max 5 seconds (i.e. the max time between wind speed samples).
      6. On every page load the values are fetched from the database. Outdoor Temp, Indoor Temp, Rain (by fetching min max to diff) plus wind speed and direction. Also the last weeks min max values for temp outdoor and rain is fetched to be shown in the chart. As mentioned in 5 changes appear instantly and in case of rain it will also trigger a new fetch from the database. The Flask web app renders the web UI that is displayed on the tablet, phone or browser. As i mentioned above i use my own android app for full control but a app like the Full Kiosk Browser should do the trick too.
        2

      Example setup #1 (my personal setup):

      I have connected a modified RainWise raingauge to this node with my own 3D printed Stevenson Screen for outdoor temperature. https://github.com/boanjo/myhome/blob/master/weather_station_dc/. The biggest reason i have the sensor dc powered is the outdoor temperature which also has a small DC fan connected to it to ensure ventilation of the Stevenson Cage also on really sunny days (it's extra precausion but it dont' really know if it is needed)

      Rain - If you want to pole mount the RainWise raingauge see here for a model you can print (or if you want to have it as a separate sensor node) https://github.com/boanjo/myhome/tree/master/rain_gauge
      Out Temp - Here is the printable https://www.thingiverse.com/thing:4645989 and also a YouTube video of the making.

      Here is a fusion 360 rendering of the setup (no it's not my garden view πŸ˜‰
      3

      Wind - On my roof i have the Davis instruments anemometer (i only use the HW and own MySensors radio) https://github.com/boanjo/myhome/tree/master/anemometer. It's solar powered and i'd say it's a must for an anemometer.

      Indoor temperature - https://github.com/boanjo/myhome/tree/master/temp_indoor_dc (or the battery powered version https://github.com/boanjo/myhome/tree/master/temp_indoor) which is my favorite case for indoor sensors. Previously i've always found it difficult to make beautiful 433MHz sensors due to the antennas - but this i like πŸ™‚

      Example setup #2:

      All Sensors (Rain, Wind, Temperature) hooked up to the same weather_stataion:
      https://github.com/boanjo/myhome/blob/master/weather_station_dc/

      Example setup #3:

      All sensors are their own nodes - see myhome for all sensors (with separate README.md descriptions) https://github.com/boanjo/myhome

      Parts and rough BOM for this WS project

      • RainWise RainGauge ~100 USD here in Europe (cheaper in the US) (https://github.com/boanjo/myhome/blob/master/rain_gauge/)
      • RainWise Mounting ~15USD PLA/PETG and metal rods (https://www.thingiverse.com/thing:4641372)
      • Davis Anemometer ~150 USD here in Europe (cheaper in the US) (https://github.com/boanjo/myhome/blob/master/anemometer/)
      • Stevenson Screen ~15 USD of PETG plastic, rods and electronics (https://www.thingiverse.com/thing:4645989)
      • Weather Station box ~10 USD PETG and electronics (https://github.com/boanjo/myhome/blob/master/weather_station_dc/)
      • Indoor Temperature ~15 USD PLA and electronics (Si7021 temp + hum is ~7USD) (https://github.com/boanjo/myhome/tree/master/temp_indoor_dc)
      • MQTT GW ~10 USD PLA and electronics (https://github.com/boanjo/myhome/blob/master/gateway_mqtt/)

      A total of around 320 USD and you will have a really reliable and nice weatherstation setup. I like being able to build things from "scratch" but I have chosen to use the Davis and RainWise for wind and rain as they are proven reliable and is well worth the investment. I've have tried numerous other solutions over the years and this is the best quality vs cost (including continous troubleshooting of other poor HW) combo i have experienced.

      4

      Then of course you need a RPI or other server HW for the actual WS applications and also a cheap tablet (But nice and clear display) for showing the results in realtime.

      This is how i can look a few days before Christmas πŸ™‚ in the south of Sweden - a few degrees and rain!

      5

      posted in My Project
      boanjo
      boanjo
    • RE: How can I choose a controller?

      @Feliw05 Selecting the "right" controller is of course a matter of opinion and depends how far you want to go into the homeautomation swamp πŸ˜‰ . Normally i don't give advice like this (and i agree with @mfalkvidd - It's great to discuss with a friend!) but here a my 2 cents... I think i've tried them all in the table but i always return to 2 alternatives: homeassistant and domoticz. If you want the fastest way to get started with good trend charts i still think Domoticz is a great choise. The UI is not the prettiest (even if you can fix that by setting up custom dashboards like dashticz or so) but it's very functional and i think it has a good default setup with trendlines per sensor for day/month/year using highcharts. I have a few weather station systems running remote and then i use domoticz in docker containers on off site servers (but i've also had it running on rasberry PIs). Very light weight.
      ec6576da-d173-4cf3-b72b-db0aab14717e-image.png
      Another alternative (maybe obvious) is homeassistant but it might be a bit overwelming since it's very flexible and can be run in so many different ways so you will find tons of howtos that doesn't work anymore. It has a very active community that isn't afraid of changing core concepts when needed which is both a strength and sometimes a weakness. For my personal homeautomation i have moved over completely to homeassistant and it's possible to create beautiful dashboards with little effort. Is has integrations for more or less everything and if not there will be soon or you can add it yourself.

      Example dashboard that i have in the house with car heating/charging, cameras and tons of sensors and zigbee devices. Actually used and appretiated by everyone in the house 🎯

      081afea4-49ce-409f-965d-9950f828aad8-image.png

      It's a bumpier ride at least at first but i think homeassistant wins in the long run - and it's open source!

      posted in Controllers
      boanjo
      boanjo
    • RE: Christmas Tree watering node - seasonal greetings

      Just a follow-up 2 years later... Still no water incidents and the simple watersensor still looks surprisingly good! A very satisfying feeling for the third year in a row to just fill the bucket with water and plug it in and it just works πŸ™‚

      The biggest problem now is that it's become harder to argue with the kids that we need to get rid of the spruce tree as it loses very little needles...

      posted in My Project
      boanjo
      boanjo
    • RE: 3D printed housing for an MQTT-GW

      Hi,

      If there is interest here is a model that i've made for MQTT-GW targeting the Wemos D1 Mini and RFM69 radios. https://www.thingiverse.com/thing:4657916

      It's a pack with two models for table or wall mounting.

      BR
      //Anders

      posted in Enclosures / 3D Printing
      boanjo
      boanjo
    • Pond Control

      Here is a garden automation project i completed before the summer. It is centred around our garden KOI pond and includes:
      Water temp (for feeding frequency)
      PH measurment
      Measure water level
      Fill water level (+-5mm) to keep surface high
      Fish Feeder
      Water sprinkler for surrounding plats and bushes

      It's a self regulating system, but can be controlled and observed in realtime via a web gui.

      Have a look at:
      https://github.com/epkboan/pc

      posted in My Project
      boanjo
      boanjo
    • RE: 3D printed housing for an MQTT-GW

      @evb Thanks, yes my wife liked it too so all good πŸ˜„

      Unfortunately Thingiverse looses track on many designs so i only see half of my own designs even if the direct links work, so nice to see that someone found it anyway. The last batch of Minis i use is these ones https://www.ebay.com/itm/323377378845 but it's the same 8MHz 3.3V that i've used for several years. I've probably consumed 40-50 in various projects and i haven't had a single failure. The voltage regulators are crap of course but following the normal mysensor battery powered recommendations you will remove that. https://www.youtube.com/watch?v=91aFByn90RY here is another video where i'm looking more in detail on the DC powered temp sensor that gets a nice ldo low quiescent voltage regulator. Then it's at 120uA but that is the plain MySensors temp sketch with no modifications.

      120uA will probably take you quite far if your sensor is not reporting too frequently any if you need to go even lower then you need even better step up or LDO and also patch some MySensor behaviours. I've built sensors before with a sleep current of 4uA following the exellent tips of Nick Gammon http://www.gammon.com.au/forum/?id=11497 but again that was not using MySensors or RFM69 chips but rather plain ook chips like this one (https://github.com/boanjo/rain_sensor). But i try to stay at master MySensor and take a small hit in sleep current as it's good enough in most cases

      Cool! I need to read up on that long thread :)!

      posted in Enclosures / 3D Printing
      boanjo
      boanjo
    • RE: Can't get ESP8266 gateway to work anymore

      @mfalkvidd @Zwer2k
      I also had sneaky symptoms today when I was about to upgrade my WP5100 gateway to and Wemos D1 mini MQTT gw. The problem was that I just changed PC and installed both platformio (which is my new #1 choice) but also Arduino and then gets the latest and greatest by default. Everything compiled and uploaded fine on 3.0.1 but then nothing happened. Complete silence even in before() if Mysensors.h was included and I haven't seen that before. Changing the include to Arduino.h worked fine. What led me on the right track was that I by chance did the same operation on my old PC (that still was using the older esp versions) and found it working. Or actually it probably led me on another wild goose chase for a while...

      Works! (I know the release note says ESP8266: Update to 2.6.1)

      • framework-arduinoespressif8266 3.20704.0 (2.7.4)

      Unresponsive ESP after upload/boot!

      • framework-arduinoespressif8266 3.30001.210627 (3.0.1)

      Not sure if the runtime mismatch could be flagged in some way. I for sure spent a few hours on this even if I have hundreds of MySensors hours and nodes in me so I expect others will too. I actually saw the posts about compilation errors, but didn't make the connection and it was now first when I found the issue and was going to share my experiences I stumbled on your post πŸ™‚

      It's hard enough to maintain a project like MySensors even without the world changing around you (new lib / frameworks versions) and even if it might be possible to add to version mismatch error/warning somewhere it's probably better to try ad inspire the esp library to fix what is broken. Now when I know I'm not alone about the problem it's more motivating to find out why it behaved like this πŸ˜‰

      posted in My Project
      boanjo
      boanjo

    Latest posts made by boanjo

    • RE: How can I choose a controller?

      @Feliw05 Selecting the "right" controller is of course a matter of opinion and depends how far you want to go into the homeautomation swamp πŸ˜‰ . Normally i don't give advice like this (and i agree with @mfalkvidd - It's great to discuss with a friend!) but here a my 2 cents... I think i've tried them all in the table but i always return to 2 alternatives: homeassistant and domoticz. If you want the fastest way to get started with good trend charts i still think Domoticz is a great choise. The UI is not the prettiest (even if you can fix that by setting up custom dashboards like dashticz or so) but it's very functional and i think it has a good default setup with trendlines per sensor for day/month/year using highcharts. I have a few weather station systems running remote and then i use domoticz in docker containers on off site servers (but i've also had it running on rasberry PIs). Very light weight.
      ec6576da-d173-4cf3-b72b-db0aab14717e-image.png
      Another alternative (maybe obvious) is homeassistant but it might be a bit overwelming since it's very flexible and can be run in so many different ways so you will find tons of howtos that doesn't work anymore. It has a very active community that isn't afraid of changing core concepts when needed which is both a strength and sometimes a weakness. For my personal homeautomation i have moved over completely to homeassistant and it's possible to create beautiful dashboards with little effort. Is has integrations for more or less everything and if not there will be soon or you can add it yourself.

      Example dashboard that i have in the house with car heating/charging, cameras and tons of sensors and zigbee devices. Actually used and appretiated by everyone in the house 🎯

      081afea4-49ce-409f-965d-9950f828aad8-image.png

      It's a bumpier ride at least at first but i think homeassistant wins in the long run - and it's open source!

      posted in Controllers
      boanjo
      boanjo
    • RE: Can't get ESP8266 gateway to work anymore

      @mfalkvidd @Zwer2k
      I also had sneaky symptoms today when I was about to upgrade my WP5100 gateway to and Wemos D1 mini MQTT gw. The problem was that I just changed PC and installed both platformio (which is my new #1 choice) but also Arduino and then gets the latest and greatest by default. Everything compiled and uploaded fine on 3.0.1 but then nothing happened. Complete silence even in before() if Mysensors.h was included and I haven't seen that before. Changing the include to Arduino.h worked fine. What led me on the right track was that I by chance did the same operation on my old PC (that still was using the older esp versions) and found it working. Or actually it probably led me on another wild goose chase for a while...

      Works! (I know the release note says ESP8266: Update to 2.6.1)

      • framework-arduinoespressif8266 3.20704.0 (2.7.4)

      Unresponsive ESP after upload/boot!

      • framework-arduinoespressif8266 3.30001.210627 (3.0.1)

      Not sure if the runtime mismatch could be flagged in some way. I for sure spent a few hours on this even if I have hundreds of MySensors hours and nodes in me so I expect others will too. I actually saw the posts about compilation errors, but didn't make the connection and it was now first when I found the issue and was going to share my experiences I stumbled on your post πŸ™‚

      It's hard enough to maintain a project like MySensors even without the world changing around you (new lib / frameworks versions) and even if it might be possible to add to version mismatch error/warning somewhere it's probably better to try ad inspire the esp library to fix what is broken. Now when I know I'm not alone about the problem it's more motivating to find out why it behaved like this πŸ˜‰

      posted in My Project
      boanjo
      boanjo
    • RE: I need to measure microamper current with low noise

      I have both the uCurrent gold as suggested by @evb and also the "current ranger" https://lowpowerlab.com/shop/product/152 which is my first choice. It has a small display which makes it easier to use. But both are great products based on the same ideas from Evblog. Then to measure transient current you can hook up an oscilloscope to the output of any of the two.

      posted in Troubleshooting
      boanjo
      boanjo
    • RE: RFM69 Range issues

      @evb Yes, i agree your 868MHz doesn't look that busy and shouldn't be the root cause. Have you been able to establish the specific sensor that you have range issues with (i.e. how it look in the spectrum analyzer)? This is a bit easier when working with "dumb" sensors that sends repeatedly every minute or so. Might be a good idea to add a frequent send (just temporarily while troubleshooting this).

      posted in Troubleshooting
      boanjo
      boanjo
    • RE: High-end Weather Station

      @Yveaux Thanks!

      I've had one of the temp sensors out for two seasons and i haven't noticed any brittle tendecies. The prinouts are covered in a few layers of sparypaint so the colors still look great (as i imagine they wouldn't if not painted). But printing in ABS is of course the safest route to take.

      posted in My Project
      boanjo
      boanjo
    • High-end Weather Station

      ws - Weather Station

      alt text

      WS is a graphical frontend to be used on top of existing homeautomation (or it can be used standalone) like Domoticz or HomeAssistant and your own sensor network with MySensors. It is NOT a homeautomation controller but simply a listener on weather related sensors. To enable this listener pattern you need to have your MySensors hooked up via MQTT which is a popular way of disconnecting sensor networks and controller. It has a hardcoded web interface (even if it is of course possible for you to change) and the reason for this is that it has been satisfactory for a number of deployments over a number of years. What is a nice looking GUI is of course in the eyes of the beholder but for some reason i still think this is the best GUI for me with clear information without distracting details. It is also possile to read from a larger distance which i also consider important. The ws page runs on any server locally (including raspberry pi) or remote and to be displayed continously on a 10" tablet. I have a number of these systems that have been up for more than 5 years. You can use an app like the "Fully Kiosk Browser" on android. I have made my own simple app that switches webviews after fully loaded periodically every 30 sec which makes a seemless and very smooth UI experience. It also handles loss of wifi and other quirks that might happen. If there is an interest in the APP let me know and i can fix that!

      Here is a YouTube video where i'm going through the setup: https://youtu.be/JygoxuusSYA

      I have made a few architectural desicions:

      • I only support MQTT gateway (for example how to build one https://github.com/boanjo/myhome/tree/master/gateway_mqtt) and that is to be able to listen on the gateway and controller and only act as an addon for both new and existing systems. I also have a few systems that run over mobile internet without possibility to do port forwarding (which from security perspective should be avoided too if possible) hence keeping the web interface off site makes life easier for me to manage the systems.
      • I am using both polling the database and listen to websockets MQTT messages. This might seem a tad overcomplicated, but i want as fast feedback on the sensors as possible (especially wind gust and rain). In one prototype i used database only but with frequent polling. This didn't scale very well and caused quite high load on the mysqld and to my surprise also influxdbd even if only polling every 1-3 seconds or so. And vice versa it's not possible to only use mqtt as it doesn't store state. I.e. you need to be able to fetch the previous values anyway.
      • Keeping the webserver on a web host provider scales better if you have many listeners (like your whole neighbourhood ;-)) of the weather information
      • Quite many parameters are configurable in cfg directory. Change the names to suite your needs and let it be reflected in your docker-compose.yml file. I this example i have added two of my systems as inspiration. In many cases it's easier to do changes or extensions in the mqtt app (ws.py) or web app/template (app.py or weather.html)

      The MySensors network produces data continously (especially the wind (anemometer) which reports every 5 seconds (in case of change) for both speed and direction.

      1. This is reported from the gataway to the mosquitto MQTT server.
      2. The data is picked up by your controller (Domoticz, HA..) if you subscribe to the topic and the same infromation is then also picked up by the WS MQTT app. This is a python client using paho library to listen and send MQTT messages.
      3. The MQTT app translates the data into a more readable format and republishes it under a new topic (that you decide in your config.json)
      4. The MQTT app also stores the data in a MySql database (could just as well been an influxdb) with the exception of wind that is stored less frequent like wind speed peak every 30 sec and median direction every 15 min.
      5. The Web client continously listens for changes one the WS topic (sent in 4) via MQTT over websockets. This allows to have "realtime" changes to the data. So when you hear the wind gust you will see the speed on your display within max 5 seconds (i.e. the max time between wind speed samples).
      6. On every page load the values are fetched from the database. Outdoor Temp, Indoor Temp, Rain (by fetching min max to diff) plus wind speed and direction. Also the last weeks min max values for temp outdoor and rain is fetched to be shown in the chart. As mentioned in 5 changes appear instantly and in case of rain it will also trigger a new fetch from the database. The Flask web app renders the web UI that is displayed on the tablet, phone or browser. As i mentioned above i use my own android app for full control but a app like the Full Kiosk Browser should do the trick too.
        2

      Example setup #1 (my personal setup):

      I have connected a modified RainWise raingauge to this node with my own 3D printed Stevenson Screen for outdoor temperature. https://github.com/boanjo/myhome/blob/master/weather_station_dc/. The biggest reason i have the sensor dc powered is the outdoor temperature which also has a small DC fan connected to it to ensure ventilation of the Stevenson Cage also on really sunny days (it's extra precausion but it dont' really know if it is needed)

      Rain - If you want to pole mount the RainWise raingauge see here for a model you can print (or if you want to have it as a separate sensor node) https://github.com/boanjo/myhome/tree/master/rain_gauge
      Out Temp - Here is the printable https://www.thingiverse.com/thing:4645989 and also a YouTube video of the making.

      Here is a fusion 360 rendering of the setup (no it's not my garden view πŸ˜‰
      3

      Wind - On my roof i have the Davis instruments anemometer (i only use the HW and own MySensors radio) https://github.com/boanjo/myhome/tree/master/anemometer. It's solar powered and i'd say it's a must for an anemometer.

      Indoor temperature - https://github.com/boanjo/myhome/tree/master/temp_indoor_dc (or the battery powered version https://github.com/boanjo/myhome/tree/master/temp_indoor) which is my favorite case for indoor sensors. Previously i've always found it difficult to make beautiful 433MHz sensors due to the antennas - but this i like πŸ™‚

      Example setup #2:

      All Sensors (Rain, Wind, Temperature) hooked up to the same weather_stataion:
      https://github.com/boanjo/myhome/blob/master/weather_station_dc/

      Example setup #3:

      All sensors are their own nodes - see myhome for all sensors (with separate README.md descriptions) https://github.com/boanjo/myhome

      Parts and rough BOM for this WS project

      • RainWise RainGauge ~100 USD here in Europe (cheaper in the US) (https://github.com/boanjo/myhome/blob/master/rain_gauge/)
      • RainWise Mounting ~15USD PLA/PETG and metal rods (https://www.thingiverse.com/thing:4641372)
      • Davis Anemometer ~150 USD here in Europe (cheaper in the US) (https://github.com/boanjo/myhome/blob/master/anemometer/)
      • Stevenson Screen ~15 USD of PETG plastic, rods and electronics (https://www.thingiverse.com/thing:4645989)
      • Weather Station box ~10 USD PETG and electronics (https://github.com/boanjo/myhome/blob/master/weather_station_dc/)
      • Indoor Temperature ~15 USD PLA and electronics (Si7021 temp + hum is ~7USD) (https://github.com/boanjo/myhome/tree/master/temp_indoor_dc)
      • MQTT GW ~10 USD PLA and electronics (https://github.com/boanjo/myhome/blob/master/gateway_mqtt/)

      A total of around 320 USD and you will have a really reliable and nice weatherstation setup. I like being able to build things from "scratch" but I have chosen to use the Davis and RainWise for wind and rain as they are proven reliable and is well worth the investment. I've have tried numerous other solutions over the years and this is the best quality vs cost (including continous troubleshooting of other poor HW) combo i have experienced.

      4

      Then of course you need a RPI or other server HW for the actual WS applications and also a cheap tablet (But nice and clear display) for showing the results in realtime.

      This is how i can look a few days before Christmas πŸ™‚ in the south of Sweden - a few degrees and rain!

      5

      posted in My Project
      boanjo
      boanjo
    • RE: RFM69 Range issues

      @evb Ah, sorry i ment to write which models i used too... No i have only tried the really cheap ones πŸ™‚

      Here are the ones i've used:
      20210101_133218.jpg

      The mini is just crap if you compare it with the two bigger sized dongles so i didn't link to it. The two bigger ones work well so it's more up to you what kind of antenna connector you want (and price). See the links for more details
      RTL-SDR.COM is ~28$
      https://www.ebay.com/itm/272411458376

      The middle DVB-T TV kit is ~11$
      https://www.ebay.ca/itm/USB2-0-Digital-DVB-T-SDR-DAB-FM-TV-Tuner-Receiver-Stick-RTL2832U-FC0012-Z-/124383617220?oid=182403360614

      The how part i actually not much harder than to hook it upp connect to the device, turn the frequency to the wanted range and view the energy mass on the center frequency (it's often good to set the decay a bit longer so the eye can capture the peaks). But if there are questions feel free to ask!

      posted in Troubleshooting
      boanjo
      boanjo
    • RE: RFM69 Range issues

      I agree with @Yveaux that it's a good idea to fire up the RTL-SDR dongle if you have one. I've been using it quite extensively in the past when working with more plain OOK devices and it's a real eye-opener when you see the spectrum. A lot of noise and garbage where i live at least in the 433Mhz spectrum. In the 868MHz you "shouldn't" have that much (mainly your own devices) perhaps. I used mainly SDR# (SDRSHARP) which (IMHO) is the best option if you run windows. GQRX (linux) does the job too but is a bit harder i think. Move the RTL dongle around (close to GW etc) to see if the actual GW is radiating or if you pick up some other sources.

      posted in Troubleshooting
      boanjo
      boanjo
    • RE: 3D printed housing for an MQTT-GW

      @evb Thanks, yes my wife liked it too so all good πŸ˜„

      Unfortunately Thingiverse looses track on many designs so i only see half of my own designs even if the direct links work, so nice to see that someone found it anyway. The last batch of Minis i use is these ones https://www.ebay.com/itm/323377378845 but it's the same 8MHz 3.3V that i've used for several years. I've probably consumed 40-50 in various projects and i haven't had a single failure. The voltage regulators are crap of course but following the normal mysensor battery powered recommendations you will remove that. https://www.youtube.com/watch?v=91aFByn90RY here is another video where i'm looking more in detail on the DC powered temp sensor that gets a nice ldo low quiescent voltage regulator. Then it's at 120uA but that is the plain MySensors temp sketch with no modifications.

      120uA will probably take you quite far if your sensor is not reporting too frequently any if you need to go even lower then you need even better step up or LDO and also patch some MySensor behaviours. I've built sensors before with a sleep current of 4uA following the exellent tips of Nick Gammon http://www.gammon.com.au/forum/?id=11497 but again that was not using MySensors or RFM69 chips but rather plain ook chips like this one (https://github.com/boanjo/rain_sensor). But i try to stay at master MySensor and take a small hit in sleep current as it's good enough in most cases

      Cool! I need to read up on that long thread :)!

      posted in Enclosures / 3D Printing
      boanjo
      boanjo