Navigation

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

    parachutesj

    @parachutesj

    43
    Reputation
    155
    Posts
    1029
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    parachutesj Follow

    Best posts made by parachutesj

    • Mysensorized Roomba

      Hi,
      just wanted to share my POC:
      We're having a cleaning robot since years. It has built in scheduler and cleans based on that no matter if anyone is home or not.
      I wanted to change that; I do have the status of precence in OpenHAB.
      I have just created a simple mySensor node (based on a light switch) which sends 3 different commands to roomba:
      clean
      dock
      stop

      In openHAB it is just defined as a light switch and I can build up a schedule and if someone is home, it delays the start of cleaning until all are gone.

      ToDo:
      See if I can fit the parts inside of the cleaning robot but for POC I am happy

      alt text

      
      // Enable debug prints to serial monitor
      #define MY_DEBUG
      
      // Enable and select radio type attached
      #define MY_RADIO_NRF24
      //#define MY_RADIO_RFM69
      
      // Enable repeater functionality for this node
      #define MY_REPEATER_FEATURE
      
      #include <MySensors.h>
      #include <SoftwareSerial.h>
      
      #define RELAY_1  5  // Arduino Digital I/O pin number for first relay (second on pin+1 etc)
      #define NUMBER_OF_RELAYS 2 // Total number of attached relays
      #define RELAY_ON 1  // GPIO value to write to turn on attached relay
      #define RELAY_OFF 0 // GPIO value to write to turn off attached relay
      
      int rxPin = 3;
      int txPin = 4;
      int ledPin = 13;
      
      SoftwareSerial Roomba(rxPin, txPin);
      
      #define bumpright (sensorbytes[0] & 0x01)
      #define bumpleft  (sensorbytes[0] & 0x02)
      
      void setup() {
        pinMode(ledPin, OUTPUT);   // sets the pins as output
        Serial.begin(115200);
        Roomba.begin(115200);
        digitalWrite(ledPin, HIGH); // say we're alive
        Serial.println ("Sending start command...");
        delay (1000);
        // set up ROI to receive commands
        Roomba.write(128);  // START
        delay(150);
        Serial.println ("Sending Safe Mode command...");
        delay (1000);
        Roomba.write(131);  // CONTROL
        delay(150);
        digitalWrite(ledPin, LOW);  // say we've finished setup
        Serial.println ("Ready to go!");
        delay (5000);
      }
      
      void presentation()
      {
        // Send the sketch version information to the gateway and Controller
        sendSketchInfo("Roomba", "1.0");
      
        for (int sensor = 1, pin = RELAY_1; sensor <= NUMBER_OF_RELAYS; sensor++, pin++) {
          // Register all sensors to gw (they will be created as child devices)
          present(sensor, S_BINARY);
        }
      }
      
      void loop() {
      
      }
      
      
      void receive(const MyMessage &message) {
        // We only expect one type of message from controller. But we better check anyway.
        if (message.type == V_LIGHT) {
          int mySensor = message.sensor;
          int myComand = message.getBool();
      
          //Serial.print(message.sensor-1+RELAY_1);
      
          if (mySensor == 0) {
            if (myComand == 1) {
              Serial.println("Clean");
              clean();
            }
            else {
              Serial.println("Stopp1");
              halt();
            }
          }
      
          if (mySensor == 1) {
            if (myComand == 1) {
              Serial.println("dock");
              dock();
            }
            else {
              Serial.println("Stopp2");
              halt();
            }
          }
      
        }
      }
      
      void halt() {
        ;
        Roomba.write(131);  // SAFE
        byte j = 0x00;
        Roomba.write(137);
        Roomba.write(j);
        Roomba.write(j);
        Roomba.write(j);
        Roomba.write(j);
      }
      
      void dock() {
        delay(1000);
        Roomba.write(143);
      }
      
      void clean() {
        delay(1000);
        Roomba.write(135);
      }
      
      

      Cheers,
      SJ

      posted in My Project
      parachutesj
      parachutesj
    • RE: Why I quit using MySensors for actuators

      update on my above post:
      Another node started to act crazy, had to restart it several times (simple relay with one lamp attached). Then my gateway failed shortly after. I had to restart everything. By chance I realigned the antenna and since then all runs quite stable. This drives me crazy...

      Regarding the "new" solution I am currently trying: Exchanged one of the problematic nodes with a Wemos D1 mini. Runs without any issue since 2 months.

      posted in General Discussion
      parachutesj
      parachutesj
    • RE: fallback MQTT gateway

      I didn't find a solution to this on gateway code. What I did and seems to be working more or less.

      I have two instances running MQTT and OpenHAB. One is active, other is inactive. Both obviously do have separate IP addresses, however I have managed with "keepalive" to put a virtual IP in front. All I had to do was reflashing my gateway to the virtual IP.
      So if one of the nodes is going down, the other one becomes the master and binds to the virtual IP.
      In addition to have this seemless, the MQTT servers have a subscription to the other one. This solves the issue, that in case of a failure, there is no current data on that instance.
      OpenHAB itself was always setup in a manner that I am able to run two instances (development and production) side by side and get updates on stats of all items.

      On hardware level, I run a server on Ubuntu with VirtualBox where the instances run. On top, I have another standy node running on a RasPi.

      posted in Feature Requests
      parachutesj
      parachutesj
    • RE: upgrading to 2.0

      @TheoL & @sundberg84
      I updated my serial GW to 2.0 successfully. Just uploaded the code from the samle page and adjusted to my environment. All 1.x sensors seem to work after 24h.
      The issue from above is also solved, so 2.0 sketch works as well now.

      posted in Development
      parachutesj
      parachutesj
    • Why I quit using MySensors for actuators

      It's been a while since I started with MySensors and had quite some troubles and eventually figured everything out. In the meantime I have a lot of sensors all over the place but I am a bit biased about the results.

      One one side, all the sensors (door, window, temp, sun, water, humitdity etc) they work flawless. I have some very low power sensors on batteries which run "forever" and they update quite frequent and once started they just do what they need to do: send sensor data to my gateway. Perfect!
      As a sensor platform, I am very happy with the results.
      On the other side, I also have a few actuators. Mainly rollershutters, a few LED-dimmers and light switches.
      As the light and dimmers (mostly) work, the results with the rollershutters are bad. First the good part: I do have two window motors in quite remote places, they work. Built with relays for up/down movement. No troubles.
      Then a few other rollershutters which are actually quite close to the gateway, they fail. every now and then the signal from gateway fails. I do not know why. I have changed everything in the meantime: Antennas, radios, power supplys, relais, arduinos, new circuits, other electronic parts (first a bunch of Nanos, then proMini) nothing gives reliable results. I tried to tweak the software as best as it goes, added sensors to send "alive" messages like temperature but then again after one day or one week or two weeks, it fails again. sometimes I only need to trigger a manual switch to get it back, then I have to power cycle.
      So after more than one year, I am done with testing. I need to get something stable now. Moving on...

      Some facts:
      I use NRF24 radios, maybe others would deliver better results. But I am not willing to waste another year.
      I am on latest stable release.
      My gateway has been changed as well. Currently an "official" arduino Uno with amplified radio and external 10A power supply to have enough juice.
      I am doing electronics since many years, but no expert but think I know mostly what I am doing.

      Thank you for all your help, will stick around for additional sensor only devices, as this seems to work (for me).

      Cheers,
      SJ

      posted in General Discussion
      parachutesj
      parachutesj
    • RE: HLK-PM01 reliability and experience

      all,
      after a few months of testing, another HLK-PM01 died. I ordered a new batch which seem to be ok after 5 weeks.
      However for my other node, I replaced it with an IRM-05-5 from Meanwell. Which is of course more powerfull at 5W but very stable.
      If size matters, the IRM is not for you, they are about 1.5 the size of the HLK in each direction.
      I just ordered some HLK-5m05 which are also 5W and smaller. Let's see how they perform.

      posted in Hardware
      parachutesj
      parachutesj
    • RE: Can one arduino present multiple devices?

      @zboblamont I have to agree to this.
      With OpenHAB, every child is more or less treated as an individual device (item). No matter if there is one or 100 connected to one arduino.
      On the other hand, I do not think that more powerful devices will change dramatically. I think with sensor networks, decentralization and loose coupling with a gateway which just translates it into a common language is what is key. Putting additional intelligence into the nodes or gateways is not what I would expect and want.
      I am running a lot on mySensors. But I also do have other brands deplyed. It is quite easy to exchange one against the other. The logic and intelligence is in the controller which makes it most flexible.

      posted in General Discussion
      parachutesj
      parachutesj
    • RE: Recommendation for motorized roller blinds solution (actual motor, like somfy, rollertrol, ebay...)

      @dakipro why bother with individual sensors at the windows? You can calculate the sun position (azimuth and elevation) any time during the day and check if it would be possible for the sun to shine into the room. And in second step you only need to know if sun is shining or it is cloudy. Simplest way is using an online weather service. However I noted that this is not very reliable. My solution is based on MySensors:
      It is a weather station with some sensors (rain, temp, pressure). I've started with a light sensor but found it very unreliable also protection from environment is difficult.

      So at the end my sun senors is quite simple. One dallas sensor exposed to the sun and a second one in the shade. If the difference is high enough, sun is shining. Depending on your geographical location and preferences values might vary but for me (Zurich, CH) 10 degree celsius seems to be a good value.

      posted in Hardware
      parachutesj
      parachutesj
    • RE: Multiple sensor node freeze

      @siod I changed most of the power supplies for the nodes with relays. Seems to be fixed. All simple switches or sensors with temp etc. never hang. It is only with actuators and relays. Also upgrading to latest version might have improved the situation. But I am almost certain that I had a few bad power supplies.

      posted in Bug Reports
      parachutesj
      parachutesj
    • RE: Dimensional Sensor

      @Andres-Lanza have you seen this? https://www.mysensors.org/build/distance

      posted in General Discussion
      parachutesj
      parachutesj

    Latest posts made by parachutesj

    • RE: fallback MQTT gateway

      I didn't find a solution to this on gateway code. What I did and seems to be working more or less.

      I have two instances running MQTT and OpenHAB. One is active, other is inactive. Both obviously do have separate IP addresses, however I have managed with "keepalive" to put a virtual IP in front. All I had to do was reflashing my gateway to the virtual IP.
      So if one of the nodes is going down, the other one becomes the master and binds to the virtual IP.
      In addition to have this seemless, the MQTT servers have a subscription to the other one. This solves the issue, that in case of a failure, there is no current data on that instance.
      OpenHAB itself was always setup in a manner that I am able to run two instances (development and production) side by side and get updates on stats of all items.

      On hardware level, I run a server on Ubuntu with VirtualBox where the instances run. On top, I have another standy node running on a RasPi.

      posted in Feature Requests
      parachutesj
      parachutesj
    • RE: MySensors --> MQTT --> OpenHab 2.5

      @TRS-80 sorry should have been more specific and edited my post above. I don't know if it still sucks but in the beginning it wasn't working very well and I didn't want to change all my configuration just to have exactly the same. Still a question of time.
      So I stick with MQTT 1 without MySensors binding - same, just what you have started with, stick with it until there is a real need.

      posted in OpenHAB
      parachutesj
      parachutesj
    • RE: MySensors --> MQTT --> OpenHab 2.5

      @TRS-80 true, MQTT v1. The updated binding sucks IMHO
      EDIT: I should have been more specific. The MQTT binding was not migrated to 2.x for a long time and over time I got a lot of connected things via MQTT. Once 2.x was released it wasn't really stable in the beginning and later it was just not worth to do the upgrade IMHO. Once OH 3.x comes out and we have to adapt again, I might think about a migration but until then, I am happy with MQTT 1

      posted in OpenHAB
      parachutesj
      parachutesj
    • RE: Looking for recommendations, advice, and insights

      @iamtheghost I am running exactly what you tried. Started with OpenHAB 1.x and migrated to 2.x. The serial gateway was exchanged with MQTT due to "open standard". I struggled a lot with hardware issues for actuators with relays but besides it always worked very well and reliable.
      Just for sensor data, I cannot think of something better than MySensors.

      posted in General Discussion
      parachutesj
      parachutesj
    • RE: Looking for a door monitor setup/circuit

      @jamzm what are you looking for in particular?
      I use a ProMini with the Door/Window/Button switch. The sketch is modified to always sleep and wake up on change. (https://www.mysensors.org/build/binary), with a reed switch (https://www.aliexpress.com/item/32468849883.html?spm=a2g0s.9042311.0.0.27424c4dYn4UwZ)

      The sensor is powered with two AAA batteries. The case is actually from a real door/alarm system from aliexpress which I first wanted to hack but then decided to strip the electrnics out and build it myself. I use a NC reed switch to save additional power (when door is closed mainly).

      If you are interested more in the other part of my answer, I use OpenHAB as a controller. I have extensive rules to react base on an "uncontrolled" opening of a door or window.
      This could be anything from turning lights on to send an email to your phone, triggering an external security company or enabling your sprinkler 😉

      posted in General Discussion
      parachutesj
      parachutesj
    • RE: Looking for a door monitor setup/circuit

      I have multiple door/window sensors on 2 AAA batteries and they last forever. They permanently sleep and only send an update on change (open or close) and go back to sleep immediately. Within my controller I can track or take further actions e.g. trigger an alarm, send an email or turn lights on or whatever can be imagined. I would not mix up „dumb“ sensors with piezo buzzers etc. this will need additional power and space at the door/window and at the end it is much more efficient if you have a central control.

      posted in General Discussion
      parachutesj
      parachutesj
    • RE: MySensors --> MQTT --> OpenHab 2.5

      @P72endragon
      I also use MQTT instead of the binding. Major reason: when I started, it wasn't out and I had the serialGW connected. Once realized I want the controller in a different place, I switched to MQTT and never regret. I feel I have more control with the text files than I have with the UI-driven way.

      First of all, I highly recommend you download MQTT-spy or similar, this will help a lot in figuring out the right notation in OpenHAB. It will just listen to the traffic and log it. You could also use it to send test messages etc.

      Example:
      Gateway configuration

      // Set this node's subscribe and publish topic prefix
      #define MY_MQTT_PUBLISH_TOPIC_PREFIX "hefti-out"
      #define MY_MQTT_SUBSCRIBE_TOPIC_PREFIX "hefti-in"
      
      // Set MQTT client id
      #define MY_MQTT_CLIENT_ID "hefti-1"
      

      Node configuration (temperature sensor)

      #define CHILD_ID_TEMP 1
      MyMessage msgTemp(CHILD_ID_TEMP, V_TEMP);
      present(CHILD_ID_TEMP, S_TEMP);
      

      OH example.items

      Number  roofTemp01              "Temperature roof [%.1f °C]" <temperature> (Temperature, Outdoor) {mqtt="<[mosquitto:hefti-out/101/1/1/0/0:state:default]"}
      

      MQTT spy of a recent message:
      mqtt-spy.JPG
      That is basically it. Depending on how you want to display the result (sitemap, PaperUI etc). As you see, the item is displayed in Temperature and Outdoor but you could also specify it directly in the sitemap but I guess this is going too far here.
      Hope that helped.

      posted in OpenHAB
      parachutesj
      parachutesj
    • RE: Serial GW and motion sensor functionning, but no activity between them

      @Rolland don't bother with official Arduino (imho). the clones work flawless. I have a lot here in my home and they work well. It is just not worth it to pay 10x the price

      posted in Troubleshooting
      parachutesj
      parachutesj
    • RE: Serial GW and motion sensor functionning, but no activity between them

      @Rolland unfortunately I have to confirm what @skywatch said: the radios are crap. I had those and never made good experience with them. Also the amplified long range radios are not really needed in most cases and if, then they need a really good power source to run otherwise I never got stable connections.
      Besides, any cheap NRF24 from China worked quite well for me. Some very few were faulty but if you get 10 for 7 USD you can live with that
      https://www.aliexpress.com/item/32518935864.html?spm=a2g0o.productlist.0.0.686fe77cXL8wSb&algo_pvid=ad7873cd-c5ff-4de5-8f42-f1648f896a0b&algo_expid=ad7873cd-c5ff-4de5-8f42-f1648f896a0b-1&btsid=0ab6d70515882563711402031e6ae8&ws_ab_test=searchweb0_0,searchweb201602_,searchweb201603_
      Not saying those are the best, but easier than the PA-ones.

      posted in Troubleshooting
      parachutesj
      parachutesj
    • RE: Serial GW and motion sensor functionning, but no activity between them

      almost forgot:
      to just eliminate the issues with ID, missing controller etc. You could test the radios with a simple NRF24 test script, just google "NRF24 test code" and you will find a bunch to test if the communication works between nodes and radios are ok.

      posted in Troubleshooting
      parachutesj
      parachutesj