Navigation

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

    Posts made by raptorjr

    • Glowing/pulsing yellow LED?

      Hello

      I have a strange problem, My sketch works for maybe half a day and then the yellow LED starts to show a glowing/pulsing light. It is connected to a 5V USB power supply. I don't know how to troubleshoot this since it take so long time for the problem to occur.

      I have enabled a watchdog functionality in the sketch, so why isn't that kicking in if there is any problems?

      It is a MKRNB 1500 board.

      posted in Hardware
      raptorjr
      raptorjr
    • RE: NRF24 init problem

      @yveaux In my outdoor tempsensor everything was working for a while. And to avoid any problems with the initial setup I put a Nano on a breadboard with only the nrf24 connected.
      The first setup could have had some issues that I don’t know of, but strange that my test setup have the same problems? That should have avoided any hidden problems to test everything again in a new setup.

      And Arduino runs on 5V and nrf24 on 3.3V.

      Is there any other way to check the function of a nrf24? Maybe some other sketch that is not mysensor but able to verify the nrf24 works. I need to try to narrow down the problem because it seems strange that all 4 are broken.

      posted in Hardware
      raptorjr
      raptorjr
    • NRF24 init problem

      I have a problem with my NRF24(kind of always had some problems). I have the kind where you can see the IC, not any blob. So I hope they are genuine.
      I have a temperature sensor that worked for a couple of weeks, and then all of a sudden stopped to work. Now I have connected everything so I can see the debug output and get this:

      16 MCO:BGN:INIT NODE,CP=RNNNA---,FQ=16,REL=255,VER=2.3.2
      26 TSM:INIT
      28 TSF:WUR:MS=0
      34 !TSM:INIT:TSP FAIL
      36 TSM:FAIL:CNT=1
      37 TSM:FAIL:DIS
      39 TSF:TDI:TSL
      10041 TSM:FAIL:RE-INIT
      10043 TSM:INIT
      10049 !TSM:INIT:TSP FAIL
      10051 TSM:FAIL:CNT=2
      10053 TSM:FAIL:DIS
      10055 TSF:TDI:TSL
      20058 TSM:FAIL:RE-INIT
      20060 TSM:INIT
      20066 !TSM:INIT:TSP FAIL
      20068 TSM:FAIL:CNT=3
      20070 TSM:FAIL:DIS
      20072 TSF:TDI:TSL
      30075 TSM:FAIL:RE-INIT
      

      I've seen that before and therefore tried to change the NRF24 module to another one. But it didn't work. So just to test I rigged up a testbench with another Arduino and only connected the NRF24, and none of the modules that I have left is working as it should. And the spares I had have only been laying in a box. I don't understand what could be wrong? Can all of them die without ever being used?

      posted in Hardware
      raptorjr
      raptorjr
    • RE: 3.3V water flow meter on batteries?

      Thank you for the answers. Maybe you are right and I don’t need to measure the actual waterflow. I realize now that this could be solved in a smarter way. A way that would give me 6 months of runtime.
      Maybe I need to just start testing and see what works best.

      posted in Hardware
      raptorjr
      raptorjr
    • RE: 3.3V water flow meter on batteries?

      Thank you for the answers.

      Of course I should have been more precise about the usage of the sensor.

      It will be a outside sensor. I want to measure the output of my water cleaning filter for my little fish pond. When the output decreases too much I know it is time to clean the filter.
      I’m guessing that the output with a clean filter is somewhere between 5-10 liters a minute. Hard to estimate. And I also guess when it gets close to 2-3 litres a minute it would be time to clean it.

      The goal would be a sensor that runs on battery for the season which would be about 6 months. During late autumn/winter/early spring the filter will not be used.

      posted in Hardware
      raptorjr
      raptorjr
    • 3.3V water flow meter on batteries?

      Is there a 3.3V water flow sensor available somewhere and is it possible to run one with battery power for atleast 4-6 months?
      I guess I would want to send average values about every 5 minutes.

      posted in Hardware
      raptorjr
      raptorjr
    • RE: Communication problem or?

      @skywatch Thank you for your reply. Of course I should have made a reply about the result.

      A 47uF tantalum capacitor worked. And the node has been working perfect the whole time since the change. Also during the winter in at least -10 C.

      I don’t know if the capacity of ceramic capacitors is enough? The ones I have is pretty small, and it is hard to find bigger and I also find it a little complicated to solder many at the same time to increase the capacity.

      When it comes to the cables all are soldered on the arduino side. Maybe should concider to solder everywhere. The node started as a prototype with the plan to make it properly when I saw it was working. But it is more fun to do something new, at least when the node is working.

      posted in Troubleshooting
      raptorjr
      raptorjr
    • RE: Auto reset node.

      @eric007 It is possible to know if the watchdog have restarted? Otherwise you wont know which solution worked. But that it is working may be good enough 😃

      posted in Troubleshooting
      raptorjr
      raptorjr
    • RE: Auto reset node.

      I would suggest to find the problem instead of treating the symptom.
      I had similar problem with a outside node. Lost contact after 3-4 days. Had to switch from electrolytical capacitor to tantalum on the power of the nrf24 to solve the problem. Of course there can be other causes, but it feels much better when the real problem is solved.

      posted in Troubleshooting
      raptorjr
      raptorjr
    • RE: Water volume widget

      @mfalkvidd Thank you. Will try that and see what happens.

      posted in Domoticz
      raptorjr
      raptorjr
    • Water volume widget

      I tried to ask at the Domoticz forum but I find it hard to get any help there. So I just try and ask the same question here.

      I wonder if anyone knows what kind of values the water volume widget expects in Domoticz?

      I have a sensor that presents water flow and volume every time a valve is opened. It would like to log the amount of water for that session when the valve is open and then closed and also the total volume for each day.

      As it is now I send the increasing total the whole time the valve is open and end with zero when I close it. Don’t know if it is the zero that mess things up? But any suggestion to what kind of values I should send to Domoticz is appreciated.

      posted in Domoticz
      raptorjr
      raptorjr
    • RE: Looking for waterproof connectors

      @johnrob Yes, could be some bad knockoff of the original. Maybe should try another seller.

      posted in Hardware
      raptorjr
      raptorjr
    • RE: Looking for waterproof connectors

      @johnrob I found it hard to make it waterproof where the cables go into the connector. If I have 3 or 4 pin connector it gets very wide so I need a wide pice of shrink plastic(or what is it called in english). But if I use that wide it won’t seal the cable going in since those are often pretty small.

      Also I found it hard to get the pins inside the connector to stay in place after mounting. Many times the pins don’t align exactly with the female and instead get pushed inside into the connector. So the don’t get any contact with the female. Then I need to use a plier to pull the pin out and try again.

      posted in Hardware
      raptorjr
      raptorjr
    • Looking for waterproof connectors

      I wonder if anyone have a good suggestion on waterproof connections? Preferably with different number of pins, like 2,3,4 or 5 pins. I want to use them for outdoor sensors, and sometimes as power supply connection for outdoor sensors.

      I found these: https://www.ebay.com/itm/12-Sets-2-Pin-Waterproof-Wire-Connector-Plug-Electrical-Connection/401442407633?epid=10009606705&hash=item5d77d504d1:g:GS8AAOSwLjxaXPq8&vxp=mtr

      They are available with different amount of pins, but they turned out to be pretty useless. So I'm looking for some better solution and hope that I can get some suggestions.

      posted in Hardware
      raptorjr
      raptorjr
    • RE: 💬 Soil Moisture Sensor

      @neverdie Yes. Works today. Yesterday I got a 404 error.

      posted in Announcements
      raptorjr
      raptorjr
    • RE: 💬 Soil Moisture Sensor

      @ul7aajr The link isn’t working for me.

      posted in Announcements
      raptorjr
      raptorjr
    • RE: Communication problem or?

      I have ordered some bigger tantalum capacitors. But have in the meantime tried with 100 and 220 uF ordinary electrolytic capacitor. But it didn’t make a difference. As soon as it get cold outside it stops working.
      And since it is outside attached to sensors that is hard to take inside it makes it hard to connect a computer and enable and watch debug output.

      But I wonder, is there something else that could be sensitive to the cold? In general -5– -10 cold shouldn’t be a problem for electronics?

      posted in Troubleshooting
      raptorjr
      raptorjr
    • RE: Z-wave question

      @bjacobse Thank you for the links.

      posted in Domoticz
      raptorjr
      raptorjr
    • RE: Z-wave question

      @manutremo Thank you for your answer. I do mention Domiticz several times 😉 Anyway, I like to post here since I think this forum has more kind and helpful people. But I will take a look at the Domoticz forum.

      posted in Domoticz
      raptorjr
      raptorjr
    • Z-wave question

      Hello

      I just got me a Z-wave USB stick and my first Z-wave device (https://www.kjell.com/se/sortiment/el-verktyg/smarta-hem/z-wave/fjarrstrombrytare/fibaro-z-wave-fjarrstrombrytare-med-energimatare-p50884)

      It is working as it should, but it also created some questions.

      In my devices page I got a lot of new devices by just adding this one Fibaro switch. They are of several different types, and some names are Unknown. But some have names as Alarm Type, Alarm Level, Power Management. I just wonder, is there some place where I can read what these different devices do, and how I can use them? Sitting and doing trial and error seems time consuming. And I guess if I buy some other type of Z-wave switch a lot of other devices will pop up in Domoticz.
      Maybe commercial controllers do this in a better way, but I like the open source stuff and hope that there is somewhere I can find explanations about the different features supported by Z-wave devices.

      Also, I actually wanted a switch that could be used outside. This time under a roof but still be able to work in cold weather. But do anyone know if there is Z-wave switches available that is water protected and work in cold weather?

      And last question. Is there some way to group the devices in Domoticz in the Device page? I think that all devices that is for one switch should be shown in one row. Otherwise if I add another 5-10 Z-wave devices the device list will be huge, and almost impossible to manage.

      Appreciate any help.

      posted in Domoticz
      raptorjr
      raptorjr
    • RE: Whole house power monitoring.

      @gohan Just curious, where do you live with those restrictions?

      posted in Hardware
      raptorjr
      raptorjr
    • RE: MYSBootloader 1.3 pre-release & MYSController 1.0.0beta

      @chris83 Yes, as I understand it. But I could be wrong. But it feels logical.

      posted in Development
      raptorjr
      raptorjr
    • RE: MYSBootloader 1.3 pre-release & MYSController 1.0.0beta

      @chris83 Thank you. I use the same version.

      posted in Development
      raptorjr
      raptorjr
    • RE: MYSBootloader 1.3 pre-release & MYSController 1.0.0beta

      @chris83 Which version do you use? I only have the RX line?

      I thought it was for the MYSController, since it is connected to the gateway. Guess the gateway sends it to all connected clients.

      posted in Development
      raptorjr
      raptorjr
    • RE: Communication problem or?

      @mfalkvidd I will try a bigger one. But is there any better quality capacitors to buy that will manage cold weather? I guess that there could be other problems if you just add bigger capacitors?

      posted in Troubleshooting
      raptorjr
      raptorjr
    • RE: Communication problem or?

      @mfalkvidd Thank you for your help. I tried to put the log in the parser, but it didn't help me much. It looked strange when just pasting what I got from the gateway. Only text in the last column, or should it be like that?

      I have two capacitors as recommended, don't remember the values, but one small and one a little bit bigger. It was probably around -2-3 C degrees cold outside when the trouble started this time. Don't know if that was the problem the last time, a restart helped then, but on the other hand maybe it took one day for me to notice so maybe the temperature had changed. Don't know if this would recover by itself if the temperature rise, or if a restart is needed when it happens?

      But what size of capacitor should I try? Should I just add a third bigger one, or replace the biggest that is in place now?

      posted in Troubleshooting
      raptorjr
      raptorjr
    • Communication problem or?

      Hello

      I have a little problem of defining my actual problem, so I apologize for the bad topic title.

      I have a pretty simple node that in the winter does nothing besides measure the temperature in a outside fishtank, where hopefully some fish is trying to survive the winter. Depending on the temperature I turn on a heater manually. Next version will probably be automatic.

      But my problem is that the node is only working for about 3-4 weeks. Then it stops giving me the temperature. I have only had everything connected for about two months. And the last time I had to restart both gateway and node for it to work again.

      This time I thought I should try to narrow it down if it is the node or the gateway that fails. Instead it was me failing since I now have restarted both node and gateway again and it isn't working. And I am not any wiser.

      My gateway is a RaspberryPi ethernet gatway, where I have connected a NRF24. I'm running version 2.1.1 of MySensors on gateway and node.

      The node is a Arduino ProMini powered with a 9V adapter. Everything is outside, but under a roof. Since it is outside it is a bit hard to connect and capture a log from the node. Also because, when it was working it takes a very long time before the problem occurs.

      So far, looking at the output from the mysgw I periodically get these messages.

      mysgw: TSF:MSG:READ,2-2-255,s=255,c=3,t=7,pt=0,l=0,sg=0:
      mysgw: TSF:MSG:BC
      mysgw: TSF:MSG:FPAR REQ,ID=2
      mysgw: TSF:PNG:SEND,TO=0
      mysgw: TSF:CKU:OK
      mysgw: TSF:MSG:GWL OK
      mysgw: !TSF:MSG:SEND,0-0-2-2,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=NACK:0
      mysgw: TSF:MSG:READ,2-2-255,s=255,c=3,t=7,pt=0,l=0,sg=0:
      mysgw: TSF:MSG:BC
      mysgw: TSF:MSG:FPAR REQ,ID=2
      mysgw: TSF:CKU:OK,FCTRL
      mysgw: TSF:MSG:GWL OK
      mysgw: !TSF:MSG:SEND,0-0-2-2,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=NACK:0
      mysgw: TSF:MSG:READ,2-2-255,s=255,c=3,t=7,pt=0,l=0,sg=0:
      mysgw: TSF:MSG:BC
      mysgw: TSF:MSG:FPAR REQ,ID=2
      mysgw: TSF:CKU:OK,FCTRL
      mysgw: TSF:MSG:GWL OK
      mysgw: !TSF:MSG:SEND,0-0-2-2,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=NACK:0
      mysgw: TSF:MSG:READ,2-2-255,s=255,c=3,t=7,pt=0,l=0,sg=0:
      mysgw: TSF:MSG:BC
      mysgw: TSF:MSG:FPAR REQ,ID=2
      mysgw: TSF:CKU:OK,FCTRL
      mysgw: TSF:MSG:GWL OK
      mysgw: !TSF:MSG:SEND,0-0-2-2,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=NACK:0
      

      I think it has something with the node looking for a parent? Or is it only the gateway trying to communicate with the node that isn't answering? I'm not that good with understanding the logs yet.

      I also using MYSController, since it is easier to see what is happening than to use Domoticz for troubleshooting. And the node is not appearing there when I restart the node, and I can't see any communication from the node.

      Since the node is, or was, working twice for 3-4 weeks, I don't think there is a problem with the sketch code.

      Don't know if this is to any help to start and find the problem, but all help is appreciated.

      posted in Troubleshooting
      raptorjr
      raptorjr
    • RE: Adaptive sleep time

      Would it be possible to divide the sleeptime with the voltage? As the voltage is getting lower the sleeptime will be higher?

      Start with a number that after dividing sems good. Then it will automatically increase when voltage decrease.

      posted in Development
      raptorjr
      raptorjr
    • RE: Mail Spam

      @mfalkvidd No, no unsubscribe link.

      posted in General Discussion
      raptorjr
      raptorjr
    • RE: Mail Spam

      @mfalkvidd Got it today, first time.

      0_1512933033814_7A9FF290-1473-4894-85AA-31CD7F246D26.png

      posted in General Discussion
      raptorjr
      raptorjr
    • RE: Mail Spam

      Didn’t know about this, but it took me about 5 seconds to open the forum settings and turn it off. Probably faster than for the OP to start the thread.

      posted in General Discussion
      raptorjr
      raptorjr
    • RE: Battery power outside in the winter?

      @mfalkvidd Thank you. Then there should be no problem.

      posted in Hardware
      raptorjr
      raptorjr
    • RE: Battery power outside in the winter?

      @mfalkvidd Thanks. Good to know that the capacitors can be a problem. And how to solve it. But don't say much about the battery. Will it last over the winter? Because of lower capacity of the battery?

      In the end I guess I'll just have to try 😃

      posted in Hardware
      raptorjr
      raptorjr
    • RE: Battery power outside in the winter?

      @tbowmo Thank you. That sounds good. Maybe my concerns were exaggerated.

      Do you have some kind of logging of the battery so you can see that the voltage drops a little bit during the winter? Or maybe the amps required is so low it isn't noticeable?

      I will have a pro mini,nrf24 and some temperature/humidity sensor.

      posted in Hardware
      raptorjr
      raptorjr
    • Battery power outside in the winter?

      Is it possible to have a battery powered sensor outside in the winter?
      Have anyone tried it? I know that batteries loose some effect when it is cold. But is it still enough with two AA batteries?

      posted in Hardware
      raptorjr
      raptorjr
    • RE: 💬 Log Parser

      @mfalkvidd I'm sorry. Thought it was obviuos since I posted in the comment section of the article where the link was 😃 But I will be more clear if I find a problem some other time.

      Thanks for fixing the link.

      posted in Announcements
      raptorjr
      raptorjr
    • RE: 💬 Log Parser

      The link "More details about the log messages." don't work. 404

      posted in Announcements
      raptorjr
      raptorjr
    • RE: Node only works for a few days

      @gohan

      But if you never open the Arduino IDE it can't get updated? Or are you saying that they get updated through Visual Studio?

      I hadn't used the IDE for several months. Thought I was a step closer to the problem and that it was bugs in older libraries.

      posted in Troubleshooting
      raptorjr
      raptorjr
    • RE: Node only works for a few days

      @Darren-McInnes

      I have 3.7.6 installed. On thing might just be updated libraries. I have been using Visual Studio for development with the plugin from Visual Micro. But then the libraries don't get updated. Had some problems with a update from Visual Micro so I went back to the Arduino IDE.
      Have been running since Monday now. Although it could take more than a week before any problem, but I'm keeping my fingers crossed.

      posted in Troubleshooting
      raptorjr
      raptorjr
    • RE: Node only works for a few days

      @Darren-McInnes said:

      You may want to check which version of the onewire library you are running. I was having exactly the same issue and fixed it by upgrading the onewire library from 2.7.2 (I think?) To the latest version.

      It's been a few weeks now with no crashes.

      In the Arduino IDE version 2.3.2 seems to be the latest. But is there a newer one that I can download and install?

      Maybe should figure out why I don't get any sensor readings when I have sensors.begin() in the setup. Maybe that is a problem also that I have it in the loop()?

      posted in Troubleshooting
      raptorjr
      raptorjr
    • RE: Node only works for a few days

      @gohan

      It is the same sketch as my second post.

      Haven't done anything with the hardware yet. Was following Fabiens advice with using 2.1 on both sketch and gateway. And restart gateway with problem. And then test again and restart node when the problem occurs.

      posted in Troubleshooting
      raptorjr
      raptorjr
    • RE: Node only works for a few days

      @FotoFieber

      That was very advanced 😃 I don't have any high voltage involved. Only have a test setup on a breadboard.

      I tried to move the sensors.begin to the setup, but then I don't get any temperature readings?

      posted in Troubleshooting
      raptorjr
      raptorjr
    • RE: Node only works for a few days

      @Fabien said:

      First switch your gateway to 2.1.0 stable.
      I think sensors.begin must be in setup not in loop.
      And I think you have perhaps TX problem on gateway side (after reading logs).
      Retry with 2.1.0 on both sides, compile node sketch with sensors.begin in setup, turn on log on node and gw.
      When you have failure, try to reboot only gateway and wait until node try to find parent. Make the same test but this time reboot only node.

      Will try this first. To me it feels that if it was something wrong with the hardware in some way it would happen right away, not only after a few days.

      But I'll start with this before I consider to buy new hardware.

      posted in Troubleshooting
      raptorjr
      raptorjr
    • RE: Node only works for a few days

      @Geert-Massa

      Thank you for looking.
      I hope not a repeater is needed. They are only 2-3 meters apart. And that don't explain why it works for a few days after a restart.
      I have capacitors on both node and gateway, so that should not be a problem either.

      posted in Troubleshooting
      raptorjr
      raptorjr
    • RE: Node only works for a few days

      @mfalkvidd

      I enabled debug in my sketch, and captured the output from mysgw. This time it was only running over the night until it failed.
      And if I restart the sketch everything works again. Don't know why it failed faster with debug enabled. Before it has taken a few days until it failed.

      Sketch output:
      0_1484382591964_SketchOutput.txt

      mysgw output:
      0_1484382659338_mysgw.log

      Sketch:

      // Enable serial gateway
      //#define MY_GATEWAY_SERIAL 
      
      // Enable debug prints to serial monitor
      #define MY_DEBUG 
      
      // Enable and select radio type attached
      #define MY_RADIO_NRF24
      
      #include <SPI.h>
      #include <MySensors.h>  
      #include <OneWire.h>
      #include <DallasTemperature.h>
      
      #define TEMP_ID 1
      #define RELAY_ID 2
      #define WATERFLOW_ID 3
      
      //Temperatur sensor
      #define ONE_WIRE_BUS 4
      #define COMPARE_TEMP 1 // Send temperature only if changed? 1 = Yes 0 = No
      float lastTemperature = 0;
      MyMessage tempMsg(TEMP_ID, V_TEMP); // Initialize temperature message
      OneWire oneWire(ONE_WIRE_BUS); // Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
      DallasTemperature sensors(&oneWire); // Pass our oneWire reference to Dallas Temperature. 
      unsigned long SLEEP_TIME = 5000; // Sleep time between reads (in milliseconds)
      
      //Relay to water valve
      #define RELAY_PIN 5  // Arduino Digital I/O pin number for first relay (second on pin+1 etc)
      #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
      
      //Waterflow meter
      #define WATERFLOW_PIN 3
      #define WATERFLOW_INTERRUPT WATERFLOW_PIN - 2
      // The hall-effect flow sensor outputs approximately 4.5 pulses per second per
      // litre/minute of flow.
      float calibrationFactor = 4.5;
      volatile unsigned long pulseCounter = 0;
      float flowRate = 0;
      float lastFlowRate = 0;
      float totalLitres = 0;
      float lastTotalLitres = 0;
      unsigned long oldTime = 0;
      MyMessage flowMsg(WATERFLOW_ID, V_FLOW);
      MyMessage volumeMsg(WATERFLOW_ID, V_VOLUME);
      
      void setup(void)
      {
      	// start serial port
      	Serial.begin(115200);
      
      	pinMode(RELAY_PIN, OUTPUT);
      	digitalWrite(RELAY_PIN, RELAY_OFF);
      
      	pinMode(WATERFLOW_PIN, INPUT);
      	digitalWrite(WATERFLOW_PIN, HIGH);
      
      	// The Hall-effect sensor is connected to pin 2 which uses interrupt 0.
      	// Configured to trigger on a FALLING state change (transition from HIGH
      	// state to LOW state)
      	attachInterrupt(WATERFLOW_INTERRUPT, onPulse, FALLING);
      
      }
      
      void presentation() 
      {
      	// Send the sketch version information to the gateway and Controller
      	sendSketchInfo("FishTank", "1.0");
      
      	present(TEMP_ID, S_TEMP, "Water temperature");
      
      	present(RELAY_ID, S_BINARY, "Water valve");
      
      	present(WATERFLOW_ID, S_WATER, "Water flow");
      
      	send(volumeMsg.set(totalLitres, 2));
      
      }
      
      void loop(void)
      {
      	DeviceAddress tempDeviceAddress; // We'll use this variable to store a found device address    
      	// For testing purposes, reset the bus every loop so we can see if any devices appear or fall off
      	sensors.begin();
      	sensors.requestTemperatures(); // Send the command to get temperatures
      	
      	// Search the wire for address
         if(sensors.getAddress(tempDeviceAddress, 0))
         {
      		float tempC = round(sensors.getTempC(tempDeviceAddress) * 10) / 10.0;
      		////Serial.print("Temperature=");
      		////Serial.print(tempC);
      		////Serial.print(", LastTemp=");
      		////Serial.println(lastTemperature);
      #if COMPARE_TEMP == 1
      		// Only send data if temperature has changed and no error
      		if (lastTemperature != tempC && tempC != -127.00 && tempC != 85.00)
      		{
      #else
      		if (tempC != -127.00 && tempC != 85.00)
      		{
      #endif
      			// Send in the new temperature
      			send(tempMsg.set(tempC, 1));
      			// Save new temperatures for next compare
      			lastTemperature = tempC;
      		}
         } 
      
      	if ((millis() - oldTime) > 1000)    // Only process counters once per second
      	{
      		// Disable the interrupt while calculating flow rate and sending the value to
      		// the host
      		detachInterrupt(WATERFLOW_INTERRUPT);
      
      		// Because this loop may not complete in exactly 1 second intervals we calculate
      		// the number of milliseconds that have passed since the last execution and use
      		// that to scale the output. We also apply the calibrationFactor to scale the output
      		// based on the number of pulses per second per units of measure (litres/minute in
      		// this case) coming from the sensor.
      		flowRate = ((1000.0 / (millis() - oldTime)) * pulseCounter) / calibrationFactor;
      		
      		if(lastFlowRate != flowRate)
      			send(flowMsg.set(flowRate, 2));
      
      		lastFlowRate = flowRate;
      
      		// Note the time this processing pass was executed. Note that because we've
      		// disabled interrupts the millis() function won't actually be incrementing right
      		// at this point, but it will still return the value it was set to just before
      		// interrupts went away.
      		oldTime = millis();
      
      		// Divide the flow rate in litres/minute by 60 to determine how many litres have
      		// passed through the sensor in this 1 second interval.
      		// Add the litres passed in this second to the cumulative total
      		totalLitres += (flowRate / 60);
      
      		if(lastTotalLitres != totalLitres)
      			send(volumeMsg.set(totalLitres, 2));
      
      		lastTotalLitres = totalLitres;
      
      		unsigned int frac;
      
      		// Print the flow rate for this second in litres / minute
      		////Serial.print("Flow rate: ");
      		////Serial.print(int(flowRate));  // Print the integer part of the variable
      		////Serial.print(".");             // Print the decimal point
      												 // Determine the fractional part. The 10 multiplier gives us 1 decimal place.
      		frac = (flowRate - int(flowRate)) * 10;
      		////Serial.print(frac, DEC);      // Print the fractional part of the variable
      		////Serial.print("L/min");
      		// Print the number of litres flowed in this second
      		//Serial.print("  Current Liquid Flowing: ");             // Output separator
      		//Serial.print(flowLitres);
      		//Serial.print("L/Sec");
      
      		// Print the cumulative total of litres flowed since starting
      		////Serial.print("  Output Liquid Quantity: ");             // Output separator
      		////Serial.print(totalLitres);
      		////Serial.println("L");
      
      		// Reset the pulse counter so we can start incrementing again
      		pulseCounter = 0;
      
      		// Enable the interrupt again now that we've finished sending output
      		attachInterrupt(WATERFLOW_INTERRUPT, onPulse, FALLING);
      	}
      
      	wait(SLEEP_TIME);
      }
      
      void receive(const MyMessage &message) 
      {
      	// We only expect one type of message from controller. But we better check anyway.
      	if (message.type == V_STATUS && message.sensor == RELAY_ID)
      	{
      		// Change relay state
      		digitalWrite(RELAY_PIN, message.getBool() ? RELAY_ON : RELAY_OFF);
      		// Write some debug info
      		////Serial.print("Incoming change for sensor:");
      		////Serial.print(message.sensor);
      		////Serial.print(", New status: ");
      		////Serial.println(message.getBool());
      
      		//Reset the total litres, so we can start fresh when we open the valve
      		if (message.getBool() == RELAY_ON) 
      		{
      			totalLitres = 0;
      			send(volumeMsg.set(totalLitres, 2));
      		}
      	}
      }
      
      void onPulse()
      {
      	// Increment the pulse counter
      	pulseCounter++;
      }
      
      posted in Troubleshooting
      raptorjr
      raptorjr
    • Node only works for a few days

      I have a problem with my node. It only works for a few days, then it stops receiving commands. If I restart it, it works immediately. How can I debug this?

      I'm using MySensors 2.1, or maybe some day after that. I downloaded from GitHub a day or two after I saw that 2.1 was released. I'm using a Ethernet gateway on my RPi3, and use Domoticz as controller.

      I think it only lasted from Monday to Wednesday, I saw that the leds on the Arduino board was using a different pattern but forgot to test it. Tested today and the node did not respond to my command.

      posted in Troubleshooting
      raptorjr
      raptorjr
    • RE: Sketch problem

      @AWI

      This is what I get with debug turned on:

      Temperature=25.10, LastTemp=25.10
      Flow rate: 0.0L/min  Output Liquid Quantity: 0.00L
      Temperature=25.00, LastTemp=25.10
      TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=0,pt=7,l=5,sg=0,ft=0,st=OK:25.0
      Flow rate: 0.0L/min  Output Liquid Quantity: 0.00L
      TSF:MSG:READ,0-0-1,s=2,c=1,t=2,pt=0,l=1,sg=0:0
      TSF:MSG:ACK REQ
      TSF:MSG:SEND,1-1-0-0,s=2,c=1,t=2,pt=0,l=1,sg=0,ft=0,st=OK:0
      Incoming change for sensor:2, New status: 0
      Temperature=25.10, LastTemp=25.00
      !TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=0,pt=7,l=5,sg=0,ft=0,st=NACK:25.1
      Flow rate: 0.0L/min  Output Liquid Quantity: 0.00L
      Temperature=25.10, LastTemp=25.10
      Flow rate: 0.0L/min  Output Liquid Quantity: 0.00L
      
      posted in Development
      raptorjr
      raptorjr
    • RE: Sketch problem

      @AWI

      There is something about ACK that I did see in the MYSController. Every relay message has ACK = YES. Can that be a problem, and what can I do about it?

      0_1476613867851_2016-10-16_1230.png

      posted in Development
      raptorjr
      raptorjr
    • RE: Sketch problem

      @AWI

      It is kind of the same thing. Every time I report a temperature, the receive function get triggered. And when temperature is not changed and reported, no message about the relay.

      Temperature=25.10, LastTemp=25.10
      Flow rate: 0.0L/min Output Liquid Quantity: 0.03L
      Temperature=25.20, LastTemp=25.10
      Flow rate: 0.0L/min Output Liquid Quantity: 0.03L
      Incoming change for sensor:2, New status: 0
      Temperature=25.10, LastTemp=25.20
      Flow rate: 0.0L/min Output Liquid Quantity: 0.03L
      Incoming change for sensor:2, New status: 0
      Incoming change for sensor:2, New status: 0
      Temperature=25.10, LastTemp=25.10
      Flow rate: 0.0L/min Output Liquid Quantity: 0.03L
      Temperature=25.10, LastTemp=25.10
      Flow rate: 0.0L/min Output Liquid Quantity: 0.03L
      Temperature=25.10, LastTemp=25.10

      posted in Development
      raptorjr
      raptorjr
    • RE: Sketch problem

      @AWI

      Sure.

      // Enable serial gateway
      //#define MY_GATEWAY_SERIAL 
      
      // Enable debug prints to serial monitor
      //#define MY_DEBUG 
      
      // Enable and select radio type attached
      #define MY_RADIO_NRF24
      
      #include <SPI.h>
      #include <MySensors.h>  
      #include <OneWire.h>
      #include <DallasTemperature.h>
      
      #define TEMP_ID 1
      #define RELAY_ID 2
      #define WATERFLOW_ID 3
      
      //Temperatur sensor
      #define ONE_WIRE_BUS 4
      #define COMPARE_TEMP 1 // Send temperature only if changed? 1 = Yes 0 = No
      float lastTemperature = 0;
      MyMessage tempMsg(TEMP_ID, V_TEMP); // Initialize temperature message
      OneWire oneWire(ONE_WIRE_BUS); // Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
      DallasTemperature sensors(&oneWire); // Pass our oneWire reference to Dallas Temperature. 
      unsigned long SLEEP_TIME = 5000; // Sleep time between reads (in milliseconds)
      
      //Relay to water valve
      #define RELAY_PIN 5  // Arduino Digital I/O pin number for first relay (second on pin+1 etc)
      #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
      
      //Waterflow meter
      #define WATERFLOW_PIN 3
      #define WATERFLOW_INTERRUPT WATERFLOW_PIN - 2
      // The hall-effect flow sensor outputs approximately 4.5 pulses per second per
      // litre/minute of flow.
      float calibrationFactor = 4.5;
      volatile unsigned long pulseCounter = 0;
      float flowRate = 0;
      float flowLitres = 0;
      float totalLitres = 0;
      unsigned long oldTime = 0;
      MyMessage flowMsg(WATERFLOW_ID, V_FLOW);
      MyMessage volumeMsg(WATERFLOW_ID, V_VOLUME);
      
      void setup(void)
      {
      	// start serial port
      	Serial.begin(115200);
      
      	pinMode(RELAY_PIN, OUTPUT);
      	digitalWrite(RELAY_PIN, RELAY_OFF);
      
      	pinMode(WATERFLOW_PIN, INPUT);
      	digitalWrite(WATERFLOW_PIN, HIGH);
      
      	// The Hall-effect sensor is connected to pin 2 which uses interrupt 0.
      	// Configured to trigger on a FALLING state change (transition from HIGH
      	// state to LOW state)
      	attachInterrupt(WATERFLOW_INTERRUPT, onPulse, FALLING);
      
      }
      
      void presentation() 
      {
      	// Send the sketch version information to the gateway and Controller
      	sendSketchInfo("FishTank", "1.0");
      
      	present(TEMP_ID, S_TEMP, "Water temperature");
      
      	present(RELAY_ID, S_BINARY, "Water valve");
      
      	present(WATERFLOW_ID, S_WATER, "Water flow");
      
      	send(volumeMsg.set(totalLitres, 2));
      
      }
      
      void loop(void)
      {
      	DeviceAddress tempDeviceAddress; // We'll use this variable to store a found device address    
      	// For testing purposes, reset the bus every loop so we can see if any devices appear or fall off
      	sensors.begin();
      	sensors.requestTemperatures(); // Send the command to get temperatures
      	
      	// Search the wire for address
         if(sensors.getAddress(tempDeviceAddress, 0))
         {
      		float tempC = round(sensors.getTempC(tempDeviceAddress) * 10) / 10.0;
      		Serial.print("Temperature=");
      		Serial.print(tempC);
      		Serial.print(", LastTemp=");
      		Serial.println(lastTemperature);
      #if COMPARE_TEMP == 1
      		// Only send data if temperature has changed and no error
      		if (lastTemperature != tempC && tempC != -127.00 && tempC != 85.00)
      		{
      #else
      		if (tempC != -127.00 && tempC != 85.00)
      		{
      #endif
      			// Send in the new temperature
      			send(tempMsg.set(tempC, 1));
      			// Save new temperatures for next compare
      			lastTemperature = tempC;
      		}
         } 
      
      	if ((millis() - oldTime) > 1000)    // Only process counters once per second
      	{
      		// Disable the interrupt while calculating flow rate and sending the value to
      		// the host
      		detachInterrupt(WATERFLOW_INTERRUPT);
      
      		// Because this loop may not complete in exactly 1 second intervals we calculate
      		// the number of milliseconds that have passed since the last execution and use
      		// that to scale the output. We also apply the calibrationFactor to scale the output
      		// based on the number of pulses per second per units of measure (litres/minute in
      		// this case) coming from the sensor.
      		flowRate = ((1000.0 / (millis() - oldTime)) * pulseCounter) / calibrationFactor;
      		
      		if(flowRate > 0)
      			send(flowMsg.set(flowRate, 2));
      
      		// Note the time this processing pass was executed. Note that because we've
      		// disabled interrupts the millis() function won't actually be incrementing right
      		// at this point, but it will still return the value it was set to just before
      		// interrupts went away.
      		oldTime = millis();
      
      		// Divide the flow rate in litres/minute by 60 to determine how many litres have
      		// passed through the sensor in this 1 second interval, then multiply by 1000 to
      		// convert to millilitres.
      		flowLitres = (flowRate / 60);
      
      		// Add the millilitres passed in this second to the cumulative total
      		totalLitres += flowLitres;
      
      		if(totalLitres > 0)
      			send(volumeMsg.set(totalLitres, 2));
      
      		unsigned int frac;
      
      		// Print the flow rate for this second in litres / minute
      		Serial.print("Flow rate: ");
      		Serial.print(int(flowRate));  // Print the integer part of the variable
      		Serial.print(".");             // Print the decimal point
      												 // Determine the fractional part. The 10 multiplier gives us 1 decimal place.
      		frac = (flowRate - int(flowRate)) * 10;
      		Serial.print(frac, DEC);      // Print the fractional part of the variable
      		Serial.print("L/min");
      		// Print the number of litres flowed in this second
      		//Serial.print("  Current Liquid Flowing: ");             // Output separator
      		//Serial.print(flowLitres);
      		//Serial.print("L/Sec");
      
      		// Print the cumulative total of litres flowed since starting
      		Serial.print("  Output Liquid Quantity: ");             // Output separator
      		Serial.print(totalLitres);
      		Serial.println("L");
      
      		// Reset the pulse counter so we can start incrementing again
      		pulseCounter = 0;
      
      		// Enable the interrupt again now that we've finished sending output
      		attachInterrupt(WATERFLOW_INTERRUPT, onPulse, FALLING);
      	}
      
      
      	wait(SLEEP_TIME);
      }
      
      void receive(const MyMessage &message) 
      {
      	// We only expect one type of message from controller. But we better check anyway.
      	if (message.type == V_STATUS && message.sensor == RELAY_ID)
      	{
      		// Change relay state
      		digitalWrite(RELAY_PIN, message.getBool() ? RELAY_ON : RELAY_OFF);
      		// Write some debug info
      		Serial.print("Incoming change for sensor:");
      		Serial.print(message.sensor);
      		Serial.print(", New status: ");
      		Serial.println(message.getBool());
      
      		if (message.getBool() == RELAY_ON) //Reset the total litres, so we can start fresh when we open the valve
      		{
      			totalLitres = 0;
      			send(volumeMsg.set(totalLitres, 2));
      		}
      	}
      }
      
      void onPulse()
      {
      	// Increment the pulse counter
      	pulseCounter++;
      }
      
      posted in Development
      raptorjr
      raptorjr
    • Sketch problem

      I have a sketch with some sensors. But the two that plays a part in this drama is the Temperature sensor and a Relay.
      Every time when the sketch report a new temperature value I also get a SET message for the relay.

      If you need to see the whole sketch let me know.

      This is how I report the new temperature.

      MyMessage tempMsg(TEMP_ID, V_TEMP);
      send(tempMsg.set(tempC, 1));
      

      And this is the output from MYSController:

      688	2016-10-16 11:40:33	RX	1 - FishTank	1 - Water temperature	C_SET	NO	V_TEMP	25.7
      690	2016-10-16 11:40:35	RX	1 - FishTank	2 - Water valve	C_SET	YES	V_LIGHT	0
      691	2016-10-16 11:40:39	RX	1 - FishTank	1 - Water temperature	C_SET	NO	V_TEMP	26.2
      692	2016-10-16 11:40:39	RX	1 - FishTank	2 - Water valve	C_SET	YES	V_LIGHT	0
      694	2016-10-16 11:40:45	RX	1 - FishTank	1 - Water temperature	C_SET	NO	V_TEMP	26.1
      695	2016-10-16 11:40:45	RX	1 - FishTank	2 - Water valve	C_SET	YES	V_LIGHT	0
      697	2016-10-16 11:41:03	RX	1 - FishTank	1 - Water temperature	C_SET	NO	V_TEMP	26.0
      698	2016-10-16 11:41:03	RX	1 - FishTank	2 - Water valve	C_SET	YES	V_LIGHT	0
      700	2016-10-16 11:41:09	RX	1 - FishTank	1 - Water temperature	C_SET	NO	V_TEMP	25.9
      701	2016-10-16 11:41:09	RX	1 - FishTank	2 - Water valve	C_SET	YES	V_LIGHT	0
      
      posted in Development
      raptorjr
      raptorjr
    • RE: HomeGenie, experience?

      @hek

      I just got some text and images from the HomeGenie website and put it in a Word document. Maybe it is something you can use?
      I hope the developer of HomeGenie don't mind.

      0_1476565604254_HomeGenie.doc

      posted in HomeGenie
      raptorjr
      raptorjr
    • RE: HomeGenie, experience?

      @hek

      I just found HomeGenie a few days ago, but since I already like it I will do what I can to help. If @mvdarend has the time maybe he can take a look at the Controller Matrix. He has much more knowledge of what HomeGenie can do.

      EDIT: I see now that HomeGenie is already a part of the ControllerMatrix, but no link and information in the list. Will see what I can dig out.

      posted in HomeGenie
      raptorjr
      raptorjr
    • RE: HomeGenie, experience?

      @hek

      It seems that there is some support for MySensors 2.0 in HomeGenie now. Would it be possible to get HomeGenie added to the list of supported controllers?

      Not that I'm that experienced in controllers, but I have tried a few and this one really got me excited. I think it is a good candidate on the list.

      posted in HomeGenie
      raptorjr
      raptorjr
    • RE: HomeGenie, experience?

      @mvdarend

      Yes. The waterflow will be used to make sure that the valve is open and more important is closed when I want it to be. Otherwise notify me. Also a little interesting to see stats on how much water is added.

      posted in HomeGenie
      raptorjr
      raptorjr
    • RE: HomeGenie, experience?

      @mvdarend said:

      @raptorjr said:
      For the water flow meter, could you give me an example of what you have made, and how you would like to see it work within HomeGenie. (comparison to the Domoticz solution would be a good help too)

      What would you like to see here? My sketch for the water flow meter? I can find some image and try to explain how I would like to see it work, to be flexible and usable for others too.

      posted in HomeGenie
      raptorjr
      raptorjr
    • RE: HomeGenie, experience?

      @mvdarend

      Nice. Will have a look at it and see how it works.

      When it comes to hardware I'm currently most into MySensors things. Since it gives me the freedom to do things that is not that easy to buy from a commercial solution. My current project includes a outdoor fishtank and the ability to regulate the temperature in the tank by filling it up with new water. Need support for waterflow meter and water valve for example.

      But I'm not a complete idiot 😃 and have some old programming skills that I maybe could use to help and add support to the gateway for devices I have. But then again HomeGenie needs support for those also. Therefore I was asking about a roadmap.
      Domoticz have support for most of the devices, but on the other hand the developer have made them so specific to the thing he thinks they are used for, and makes it harder to use them for other things.
      Like the water flow gadget in Domoticz is designed for incoming water to a house or something, and not very flexible when you only need to measure the flow in any other environment.

      So if there is only full support for MySensors I would be very happy.

      But I haven't tried HomeGenie so much yet. How is it with automation? Easy/flexible to do? I need some automated way to measure water temperature and open/close water valve accordingly.

      posted in HomeGenie
      raptorjr
      raptorjr
    • RE: HomeGenie, experience?

      @mvdarend

      Sounds good. Looking forward to test it. Are you a developer of HomeGenie or just making a addon?
      Would be nice if there was some kind of roadmap for HomeGenie. It looks good, but need support for the right hardware too 😃

      posted in HomeGenie
      raptorjr
      raptorjr
    • RE: HomeGenie, experience?

      Thank you. Don't know if it is abandoned by the admins. Been waiting 3 days to get access to the forums.

      It looks good, but with such poor support I'll have to continue my search for a good controller.

      posted in HomeGenie
      raptorjr
      raptorjr
    • HomeGenie, experience?

      Does anyone have any experience with HomeGenie? Hard/easy/possible/impossible to get to work with MySensors? Support for different sensors? Anything you can tell 😃

      posted in HomeGenie
      raptorjr
      raptorjr
    • RE: MySensors Raspberry port suggestions

      @marceloaqno

      I think there may be a memory leak in the gateway. While using it as a ethernet gateway I loose about 100Mb every day, if my only node is turned on. After a few days I can't even login with SSH and need to remove the power to my Pi3 to reboot it.

      If I turn off my node, memory usage is normal. So it seems to have something to to when messages is received/transmitted. Is there anything I can do to get more details where the problem could be?

      I'm using the image from Domoticz where everything is installed, and have only added mysGateway.

      posted in Development
      raptorjr
      raptorjr
    • RE: Water flow sensor setup problem

      Well, I cant seem to find a solution to getting the total water volume from my sensor to Domoticz. Thinking about Plan B, is it possible to get the virtual dimmer percentage back to my node? Then I could do the comparison there, where I have total water volume.

      posted in Domoticz
      raptorjr
      raptorjr
    • RE: Added support for local MySensors RPI direct radio connection

      @John

      I'm about to try this and the current version of PiDome looks a little different. Is there anything that have changed about this setup?

      posted in PiDome
      raptorjr
      raptorjr
    • RE: MySensors Raspberry port suggestions

      @marceloaqno

      Wow. That was fast work 😃

      Trying it now and the /dev/ttyMySensorsGateway is created. Followed the guide in the link you provided. Everything goes great until the last step. I don't see the message "Gateway startup complete". So I don't know if I have any communication between PiDome and the gateway?

      I'll start reading forums and see if I can find a solution. Or if I missed something.

      posted in Development
      raptorjr
      raptorjr
    • RE: MySensors Raspberry port suggestions

      @marceloaqno

      I don't really understands what MQTT is and how to use it. But maybe I'll try that. Would like to see how PiDome works and if I like it better than Domoticz.

      posted in Development
      raptorjr
      raptorjr
    • RE: MySensors Raspberry port suggestions

      @marceloaqno

      Thank you. I'll have to wait for pseudo tty or for PiDome to get support for Ethernet gateway.

      posted in Development
      raptorjr
      raptorjr
    • RE: MySensors Raspberry port suggestions

      @marceloaqno

      What does the serial gateway do then? Can I use it as it is today with PiDomo and a RasberryPi? Or do I need to make a dedicated stand-alone serial gateway with a Arduino and a NRF?

      posted in Development
      raptorjr
      raptorjr
    • RE: MySensors Raspberry port suggestions

      @mfalkvidd

      Thank you. Maybe I should just try out PiDome first with serial gateway 😃

      But anyway, I thought that mysGateway would create something like /dev/ttyMySensorsGateway that I could then use, or ln to something like ttyUSB20, and add it in PiDome.

      But after compiling and installing mysGateway with serial support I only get a a error "Unable to open the serial port /dev/ttyUSB0". Am I thinking the wrong way? Isn't mysGateway supposed to work like the old Raspberry MySensors gateway?

      posted in Development
      raptorjr
      raptorjr
    • RE: MySensors Raspberry port suggestions

      Would it be possible to enable both the Serial and Ethernet communication at the same time in the gateway? I'm about to try PiDome as a controller. And it seems that it only have support for Serial gateway. But the Ethernet gateway is so practical to use when I need to debug and use MYScontroller to connect and see what is happening. Or if I would like to try OTA updates of my nodes.

      posted in Development
      raptorjr
      raptorjr
    • RE: Water flow sensor setup problem

      @hek

      Ok. Well I guess this is a pretty new and immature market. Takes a few years before we get to see something good.

      posted in Domoticz
      raptorjr
      raptorjr
    • RE: Water flow sensor setup problem

      @hek

      What do you use? I'm open to suggestions. Domoticz has a pretty bad user interface and many things is made for a very specific purpose, instead of being general and flexible. F.ex. the water meter that only seems to be made for measuring the waterflow of incoming water to a house. Since they even have the price for m3 of water.

      The only thing I really like about Domoticz is not even a part of Domoticz yet. dzVent to make it easier to make Lua scripts.

      posted in Domoticz
      raptorjr
      raptorjr
    • RE: Water flow sensor setup problem

      @hek

      Thank you, of course a dimmer is a good choice. Would have been nice though if I could see the percentage when the dimmer is turned on, instead of just On. But that is a minor detail.

      Any idea on how I could solve the water volume problem?

      posted in Domoticz
      raptorjr
      raptorjr
    • Water flow sensor setup problem

      I have a little water tank outside for fishes. I would like to be able to add water when it gets too hot. I think I have come all the way when it comes to the automatic part, but I would also like to be able to manually add water. And I cant figure it how to do it like I want in Domoticz.

      I have a water flow sensor, and it outputs nice values, current flow and total volume for the current open/close session of my water valve. Have been using MYSController to see the values.

      What I would like to have in Domotics is first some kind if configurable value where I can enter how many liters to fill. Either enter a number or some kind of slider.
      I then need a widget that shows the total volume for this open/close session (of the water valve). When the right amount of water have been filled, the total should be set to zero again.

      To be able to enter a number or using a slider to select amount I have no idea how to fix in Domotics. I asked the question at the Domotics forum and was told to use a Custom virtual sensor. Since I cant find a Custom sensor I asked where to find it and got no more answers. Hoping for a better answer here 😃

      The water flow sensor present it self as some kind of energy meter, and besides that the total value for that added sensor is something crazy high (353876322) and seems not be possible to reset that value for each open/close session of the water valve. Can I solve this by presenting my water flow sensor as something else to Domotics?

      posted in Domoticz
      raptorjr
      raptorjr
    • RE: [SOLVED] Error sending switch command

      @TheoL

      Thank you. That works perfect.

      posted in Domoticz
      raptorjr
      raptorjr
    • RE: [SOLVED] Error sending switch command

      @TheoL

      Sure, here is my sketch:

      // Enable serial gateway
      //#define MY_GATEWAY_SERIAL 
      
      // Enable debug prints to serial monitor
      #define MY_DEBUG 
      
      // Enable and select radio type attached
      #define MY_RADIO_NRF24
      
      #include <SPI.h>
      #include <MySensors.h>  
      #include <OneWire.h>
      #include <DallasTemperature.h>
      
      #define TEMP_ID 1
      #define RELAY_ID 2
      
      //Temperatur sensor
      #define ONE_WIRE_BUS 4
      #define COMPARE_TEMP 0 // Send temperature only if changed? 1 = Yes 0 = No
      float lastTemperature = 0;
      MyMessage tempMsg(TEMP_ID, V_TEMP); // Initialize temperature message
      OneWire oneWire(ONE_WIRE_BUS); // Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
      DallasTemperature sensors(&oneWire); // Pass our oneWire reference to Dallas Temperature. 
      unsigned long SLEEP_TIME = 5000; // Sleep time between reads (in milliseconds)
      
      //Relay to water valve
      #define RELAY_PIN  5  // Arduino Digital I/O pin number for first relay (second on pin+1 etc)
      #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
      
      void setup(void)
      {
      	// start serial port
      	Serial.begin(115200);
      
      	pinMode(RELAY_PIN, OUTPUT);
      	digitalWrite(RELAY_PIN, RELAY_OFF);
      }
      
      void presentation() 
      {
      	// Send the sketch version information to the gateway and Controller
      	sendSketchInfo("FishTank", "1.0");
      
      	present(TEMP_ID, S_TEMP, "Water temperature");
      
      	present(RELAY_ID, S_BINARY, "Water valve");
      }
      
      void loop(void)
      { 
      
      	DeviceAddress tempDeviceAddress; // We'll use this variable to store a found device address    
      	// For testing purposes, reset the bus every loop so we can see if any devices appear or fall off
      	sensors.begin();
      	sensors.requestTemperatures(); // Send the command to get temperatures
      	
      	// Search the wire for address
         if(sensors.getAddress(tempDeviceAddress, 0))
         {
      		float tempC = sensors.getTempC(tempDeviceAddress);
      		//Serial.print("Temperature=");
      		//Serial.println(tempC); 
      #if COMPARE_TEMP == 1
      		// Only send data if temperature has changed and no error
      		if (lastTemperature != tempC && tempC != -127.00 && tempC != 85.00)
      		{
      #else
      		if (tempC != -127.00 && tempC != 85.00)
      		{
      #endif
      			// Send in the new temperature
      			send(tempMsg.set(tempC, 1));
      			// Save new temperatures for next compare
      			lastTemperature = tempC;
      		}
         } 
      
      	delay(SLEEP_TIME);
      }
      
      void receive(const MyMessage &message) 
      {
      	// We only expect one type of message from controller. But we better check anyway.
      	if (message.type == V_STATUS) 
      	{
      		// Change relay state
      		digitalWrite(RELAY_PIN, message.getBool() ? RELAY_ON : RELAY_OFF);
      	}
      }
      

      Maybe a communication problem, but the command does work. Don't really see it as a problem that the gateway has to send the command twice sometimes, there is maybe a 0.5-1s delay because of it. But it is a problem that the controller screams error every time that occurs.

      Don't know how a controller and gateway communicates, but it feels like it should be the gateway that tells the controller that it have failed to send the command. And I can't think that it does that at the same time as it sends the command again to my relay?
      Or is it the controller that timeout to fast even though the gateway haven't reported the right status?

      posted in Domoticz
      raptorjr
      raptorjr
    • [SOLVED] Error sending switch command

      Almost every time when I try to control my relay from Domoticz I get a "Error sending switch command, check device/hardware !" even though the relay turns on/off. There is maybe a 2-3 seconds delay between when I press the switch in Domoticz and when it reacts.

      Don't know if it is the mysGateway not communicating properly with Domoticz or some other problem? Since the command works it seems to me that my sensors is working and talking to each other.

      Any idea on what could be wrong or how to narrow down the problem?

      I was hoping for a logfile for the mysController but haven't found anything. If there is some error between the gateway and the sensor.

      However, watching the messages in MYScontroller I always see the same command sends two times (either on or off) every time when I get the error message in Domoticz. The few times when it works as it should, no error in Domoticz, on/off is only sent one time.

      Don't know if it is possible to configure some more time in Domoticz before it produces a error? Or if the gateway is not communication properly with Domoticz saying "wait a second, need to resend the command", and therefore Domoticz thinks there is a problem with the command? Because it seems to me that the gateway at least understands that it needs to send the command twice sometimes.

      I have capacitors on the NRF, so communication should be good.

      posted in Domoticz
      raptorjr
      raptorjr
    • RE: MySensors Raspberry port suggestions

      @marceloaqno

      Thank you. I thought that the .cfg file contained some information about a log file, but now I know it's purpose 😃

      I'm using a SD card image I found at the Domoticz site, preinstalled with Domoticz.

      Linux raspberrypi 4.1.18-v7+ #846 SMP Thu Feb 25 14:22:53 GMT 2016 armv7l GNU/Linux

      The problem could be with Domoticz also, but since I thought that mysGateway is still kind of beta I would start to look for the problem there.

      Now I found a entry in the Domoticz error log:
      2016-08-26 19:31:00.663 Error: Gateway hardware (4) thread seems to have ended unexpectedly

      So it seems that something maybe happened with the mysController. Maybe not died, but stopped answering and locking the whole Pi?
      Or if that error refers to some internal Domoticz gateway thread.

      posted in Development
      raptorjr
      raptorjr
    • RE: MySensors Raspberry port suggestions

      I'm trying to get this to work, and it looked good. But after a day of running my Pi3 with Domoticz stopped answering to anything. Couldn't even connect with SSH.
      So now I need to start to troubleshoot. But I wonder if mysGateway produces a log somewhere? And where can I find the MySensorGateway.cfg? It is not in /tmp.

      After restart of the Pi3 I always get a error from Domoticz about not being able to send the command, although it does get through anyway.
      Don't know if mysGateway is the problem, but I need to gather all the logs I can find to figure it out.

      posted in Development
      raptorjr
      raptorjr
    • RE: PiSerialGateway and Domoticz

      It works 😃

      posted in Troubleshooting
      raptorjr
      raptorjr
    • RE: PiSerialGateway and Domoticz

      @mfalkvidd

      Thank you, will check it out. Would be sad to leave 2.0. It seems to be a big step forward in the development.

      posted in Troubleshooting
      raptorjr
      raptorjr
    • RE: PiSerialGateway and Domoticz

      @Fat-Fly

      Really? They removed that or is it a bug? Didn't think that 2.0 would be a problem. But could test, but sad to not be able to use the latest version.

      posted in Troubleshooting
      raptorjr
      raptorjr
    • RE: PiSerialGateway and Domoticz

      @Fat-Fly

      But the NRF is connected directly to the Raspberry. There is no Arduino on the gateway. And the output from my node (Arduino and NRF) with sensors is also shown in my first post.

      I'm really lost on what you want me to test.

      posted in Troubleshooting
      raptorjr
      raptorjr
    • RE: PiSerialGateway and Domoticz

      @Fat-Fly
      I don't really understand. The gateway is on a Raspberry Pi, and I have a piece of what is happening in my first post. The output from PiSerialGateway. Otherwise you have to explain a little more on how I should connect my RPi to USB and what to look for.

      posted in Troubleshooting
      raptorjr
      raptorjr
    • RE: PiSerialGateway and Domoticz

      Thank you. Bought some 10µF.

      But I don't see any change in the output from the sensor or the gateway. Have been waiting 5-10 minutes, but nothing appears in Domoticz. Is there anything I can do to try to find the problem? I seem to get the output described on other webpages for working sensor/gateway. But they don't seem to connect.

      And how do I get the log function to work? The few times when a log is created I only see some startup message. Nothing about the communication going on. I have to start PiSerialGateway manually to see any communication output. Or isn't that possible to see in the log file?

      Here is the sensorsketch, if I have forgotten something. Works fine with plain USB connection to my Pi.

      // Enable serial gateway
      //#define MY_GATEWAY_SERIAL 
      
      // Enable debug prints to serial monitor
      #define MY_DEBUG 
      
      // Enable and select radio type attached
      #define MY_RADIO_NRF24
      
      #include <SPI.h>
      #include <MySensors.h>  
      #include <OneWire.h>
      #include <DallasTemperature.h>
      
      #define TEMP_ID 1
      #define RELAY_ID 2
      
      //Temperatur sensor
      #define ONE_WIRE_BUS 4
      #define COMPARE_TEMP 0 // Send temperature only if changed? 1 = Yes 0 = No
      float lastTemperature = 0;
      MyMessage tempMsg(TEMP_ID, V_TEMP); // Initialize temperature message
      OneWire oneWire(ONE_WIRE_BUS); // Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
      DallasTemperature sensors(&oneWire); // Pass our oneWire reference to Dallas Temperature. 
      unsigned long SLEEP_TIME = 5000; // Sleep time between reads (in milliseconds)
      
      //Relay to water valve
      #define RELAY_PIN  5  // Arduino Digital I/O pin number for first relay (second on pin+1 etc)
      #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
      
      void setup(void)
      {
      	// start serial port
      	Serial.begin(115200);
      
      	pinMode(RELAY_PIN, OUTPUT);
      	digitalWrite(RELAY_PIN, RELAY_OFF);
      }
      
      void presentation() 
      {
      	// Send the sketch version information to the gateway and Controller
      	sendSketchInfo("FishTank", "1.0");
      
      	present(TEMP_ID, S_TEMP, "Water temperature");
      
      	present(RELAY_ID, S_BINARY, "Water valve");
      }
      
      void loop(void)
      { 
      
      	DeviceAddress tempDeviceAddress; // We'll use this variable to store a found device address    
      	// For testing purposes, reset the bus every loop so we can see if any devices appear or fall off
      	sensors.begin();
      	sensors.requestTemperatures(); // Send the command to get temperatures
      	
      	// Search the wire for address
         if(sensors.getAddress(tempDeviceAddress, 0))
         {
      		float tempC = sensors.getTempC(tempDeviceAddress);
      		//Serial.print("Temperature=");
      		//Serial.println(tempC); 
      #if COMPARE_TEMP == 1
      		// Only send data if temperature has changed and no error
      		if (lastTemperature != tempC && tempC != -127.00 && tempC != 85.00)
      		{
      #else
      		if (tempC != -127.00 && tempC != 85.00)
      		{
      #endif
      			// Send in the new temperature
      			send(tempMsg.set(tempC, 1));
      			// Save new temperatures for next compare
      			lastTemperature = tempC;
      		}
         } 
      
      	delay(SLEEP_TIME);
      }
      
      void receive(const MyMessage &message) 
      {
      	// We only expect one type of message from controller. But we better check anyway.
      	if (message.type == V_STATUS) 
      	{
      		// Change relay state
      		digitalWrite(RELAY_PIN, message.getBool() ? RELAY_ON : RELAY_OFF);
      		// Write some debug info
      		Serial.print("Incoming change for sensor:");
      		Serial.print(message.sensor);
      		Serial.print(", New status: ");
      		Serial.println(message.getBool());
      	}
      }
      
      posted in Troubleshooting
      raptorjr
      raptorjr
    • PiSerialGateway and Domoticz

      So I'm trying to setup PiSerialGateway with a nrf24l01+. I'm getting some output but I don't understand it. If the sensors only scream out into the air or if they are communicating?

      I know that my sketch is working, because if I attach it to my Pi3 with USB cable as a ordinary SerialGateway my sensors appear in Domoticz.

      This it the output I have from my sketch with debug turned on. Don't know where it starts or ends so I just copy a few lines.

      TSF:MSG:SEND,1-1-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
      TSF:MSG:READ,0-0-1,s=255,c=3,t=8,pt=1,l=1,sg=0:0
      TSF:MSG:FPAR RES,ID=0,D=0
      TSF:MSG:FPAR OK,ID=0,D=1
      TSM:FPAR:OK
      TSM:ID
      TSM:ID:OK,ID=1
      TSM:UPL
      TSF:PING:SEND,TO=0
      TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=OK:1
      TSF:CHKUPL:FAIL
      !TSM:UPL:FAIL
      TSM:FPAR
      TSF:MSG:SEND,1-1-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
      TSF:MSG:READ,0-0-1,s=255,c=3,t=8,pt=1,l=1,sg=0:0
      TSF:MSG:FPAR RES,ID=0,D=0
      TSF:MSG:FPAR OK,ID=0,D=1
      TSM:FPAR:OK
      TSM:ID
      TSM:ID:OK,ID=1
      TSM:UPL
      TSF:PING:SEND,TO=0
      TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=OK:1
      TSF:CHKUPL:FAIL
      !TSM:UPL:FAIL
      TSM:FPAR
      TSF:MSG:SEND,1-1-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
      TSF:MSG:READ,0-0-1,s=255,c=3,t=8,pt=1,l=1,sg=0:0
      TSF:MSG:FPAR RES,ID=0,D=0
      TSF:MSG:FPAR OK,ID=0,D=1
      TSM:FPAR:OK
      TSM:ID
      TSM:ID:OK,ID=1
      TSM:UPL
      TSF:PING:SEND,TO=0
      TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=OK:1
      TSF:CHKUPL:FAIL
      !TSM:UPL:FAIL
      TSM:FPAR
      TSF:MSG:SEND,1-1-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
      TSF:MSG:READ,0-0-1,s=255,c=3,t=8,pt=1,l=1,sg=0:0
      TSF:MSG:FPAR RES,ID=0,D=0
      TSF:MSG:FPAR OK,ID=0,D=1
      TSM:FPAR:OK
      TSM:ID
      TSM:ID:OK,ID=1
      TSM:UPL
      TSF:PING:SEND,TO=0
      

      And this is what the PiSerialGateway "says":

      read: 1-1-0 s=255,c=3,t=24,pt=1,l=1:1
      read: 1-1-255 s=255,c=3,t=7,pt=0,l=0:
      send: 0-0-1-1 s=255,c=3,t=8,pt=1,l=1,st=ok:0
      read: 1-1-0 s=255,c=3,t=24,pt=1,l=1:1
      read: 1-1-255 s=255,c=3,t=7,pt=0,l=0:
      send: 0-0-1-1 s=255,c=3,t=8,pt=1,l=1,st=ok:0
      read: 1-1-0 s=255,c=3,t=24,pt=1,l=1:1
      read: 1-1-255 s=255,c=3,t=7,pt=0,l=0:
      send: 0-0-1-1 s=255,c=3,t=8,pt=1,l=1,st=ok:0
      read: 1-1-0 s=255,c=3,t=24,pt=1,l=1:1
      read: 1-1-255 s=255,c=3,t=7,pt=0,l=0:
      send: 0-0-1-1 s=255,c=3,t=8,pt=1,l=1,st=ok:0
      read: 1-1-0 s=255,c=3,t=24,pt=1,l=1:1
      read: 1-1-255 s=255,c=3,t=7,pt=0,l=0:
      send: 0-0-1-1 s=255,c=3,t=8,pt=1,l=1,st=ok:0
      read: 1-1-0 s=255,c=3,t=24,pt=1,l=1:1
      read: 1-1-255 s=255,c=3,t=7,pt=0,l=0:
      send: 0-0-1-1 s=255,c=3,t=8,pt=1,l=1,st=ok:0
      read: 1-1-0 s=255,c=3,t=24,pt=1,l=1:1
      read: 1-1-255 s=255,c=3,t=7,pt=0,l=0:
      send: 0-0-1-1 s=255,c=3,t=8,pt=1,l=1,st=ok:0
      read: 1-1-0 s=255,c=3,t=24,pt=1,l=1:1
      read: 1-1-255 s=255,c=3,t=7,pt=0,l=0:
      send: 0-0-1-1 s=255,c=3,t=8,pt=1,l=1,st=ok:0
      

      I only had 470µF capacitor, don't know if it is too big and that could be a problem?

      Also, I don't know how to get a decent log file from PiSerialGateway? The only way I can get some output is to start it manually. I've been reading as much as I can find, but don't know how I can get this to work.

      posted in Troubleshooting
      raptorjr
      raptorjr
    • RE: Some beginner questions

      Don't know what I did wrong, but I didn't get the latest git version. I guess I somehow downloaded 2.0 again. But after some investigation I got the latest version and everything seems to be working now 😃

      Thank you for your help.

      posted in Domoticz
      raptorjr
      raptorjr
    • RE: Some beginner questions

      @martinhjelmare

      I choose to download zip from Github. Removed the folder MySensors from libraries, where the Arduino IDE had downloaded and installed the version that is available from the IDE.

      I then unpacked the zip and renamed the folder from MySensors-master to MySensors. I rebuilt my sketch and tried it. But still, presentation function is not executed.

      I have this presentation function:

      void presentation() 
      {
      	// Send the sketch version information to the gateway and Controller
      	sendSketchInfo("Temperature Sensor", "1.1");
      
      	present(TEMP_ID, S_TEMP, "Water temperature", true);
      
      	present(RELAY_ID, S_LIGHT, "Water valve", true);
      
      	Serial.println("presentation");
      
      }
      

      But this is what I get in the serial monitor:

      Port closed
      Opening port
      Port open
      0;255;3;0;14;Gateway startup complete.
      0;1;1;0;0;25.9
      0;1;1;0;0;25.9
      

      Never get a presentation message. So the presentation function is never executed. Is there anything else I need to do or have done wrong?

      posted in Domoticz
      raptorjr
      raptorjr
    • RE: Some beginner questions

      Cool, will try when I get home. Not easy when you are a beginner. Thinking everything is my fault 😃

      posted in Domoticz
      raptorjr
      raptorjr
    • RE: Some beginner questions

      @TheoL

      Thank you for your help.

      I thought that I read in the 2.0 release that S_BINARY should be used instead if S_LIGHT?

      By not seeing a sketch name I meant when I press Setup on my added gateway and see a list with my nodes. Sketch name is Unknown and version is 1.0. Not the same as I have in in my sketch "sendSketchInfo("Temperature Sensor", "1.1");"

      Besides the sketch name I thought I had it working, since I got values from my temperature sensor. That is why I added the relay. But since the relay don't appear I realize that the only reason I saw the temperature sensor is because it sends values and was therefore added as a sensor. But a relay don't send values and don't appear since presentation is not executing. (Or something like that.)

      	sendSketchInfo("Temperature Sensor", "1.1");
      
      	present(TEMP_ID, S_TEMP, "Water temperature", true);
      
      	present(RELAY_ID, S_LIGHT, "Water valve", true);
      

      After changing to this I still don't see the relay and don't get the descriptions of the sensor/relay in neither Domoticz or MYSController.
      I am probably missing something simple. I can't imagine it should be this hard to get things working.

      posted in Domoticz
      raptorjr
      raptorjr
    • RE: Some beginner questions

      The above two questions remain. But I have modified my sketch, and also thought I should test things in MYSController first, to keep it simple.
      And I think that the presentation function never executes. Do I have to do something manually to initiate it? The reason I think it is not executed is not only that I don't get a sketch name, but I also added a relay. And even though I present it it don't appear in MYSController. The only sensor that appears is the temp, and probably only because it sends values.

      // Enable serial gateway
      #define MY_GATEWAY_SERIAL 
      
      #include <SPI.h>
      #include <MySensors.h>  
      #include <OneWire.h>
      #include <DallasTemperature.h>
      
      #define TEMP_ID 1
      #define RELAY_ID 2
      
      //Temperatur sensor
      #define ONE_WIRE_BUS 4
      #define COMPARE_TEMP 0 // Send temperature only if changed? 1 = Yes 0 = No
      float lastTemperature = 0;
      MyMessage tempMsg(TEMP_ID, V_TEMP); // Initialize temperature message
      OneWire oneWire(ONE_WIRE_BUS); // Setup a oneWire instance to communicate with any OneWire devices 
      DallasTemperature sensors(&oneWire); // Pass our oneWire reference to Dallas Temperature. 
      unsigned long SLEEP_TIME = 4000; // Sleep time between reads (in milliseconds)
      
      #define RELAY_PIN  5  // Arduino Digital I/O pin number for first relay (second on pin+1 etc)
      #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
      
      void setup(void)
      {
      	// start serial port
      	Serial.begin(115200);
      
      	pinMode(RELAY_PIN, OUTPUT);
      	digitalWrite(RELAY_PIN, RELAY_OFF);
      }
      
      void presentation() 
      {
      	// Send the sketch version information to the gateway and Controller
      	sendSketchInfo("Temperature Sensor", "1.1");
      
      	present(TEMP_ID, S_TEMP);
      
      	present(RELAY_ID, S_BINARY);
      }
      
      void loop(void)
      { 
      	DeviceAddress tempDeviceAddress; // We'll use this variable to store a found device address    
      
      	// For testing purposes, reset the bus every loop so we can see if any devices appear or fall off
      	sensors.begin();
         
      	sensors.requestTemperatures(); // Send the command to get temperatures
      	
      	// Search the wire for address
         if(sensors.getAddress(tempDeviceAddress, 0))
         {
      		float tempC = sensors.getTempC(tempDeviceAddress);
      		
      		// Only send data if temperature has changed and no error
      #if COMPARE_TEMP == 1
      		if (lastTemperature != tempC && tempC != -127.00 && tempC != 85.00)
      		{
      #else
      		if (tempC != -127.00 && tempC != 85.00)
      		{
      #endif
      			// Send in the new temperature
      			send(tempMsg.set(tempC, 1));
      			// Save new temperatures for next compare
      			lastTemperature = tempC;
      		}
         } 
      
      	delay(SLEEP_TIME);
      }
      
      void receive(const MyMessage &message) 
      {
      	// We only expect one type of message from controller. But we better check anyway.
      	if (message.type == V_LIGHT) 
      	{
      		// Change relay state
      		digitalWrite(RELAY_ID, message.getBool() ? RELAY_ON : RELAY_OFF);
      		// Write some debug info
      		Serial.print("Incoming change for sensor:");
      		Serial.print(message.sensor);
      		Serial.print(", New status: ");
      		Serial.println(message.getBool());
      	}
      }
      posted in Domoticz
      raptorjr
      raptorjr
    • Some beginner questions

      So I'm trying my first SerialGateway with a attached temp sensor. This is my sketch:

      // Enable serial gateway
      #define MY_GATEWAY_SERIAL 
      
      #include <SPI.h>
      #include <MySensors.h>  
      #include <OneWire.h>
      #include <DallasTemperature.h>
      
      //Temperatur sensor
      #define TEMP_SENSOR_ID 1 // childId
      #define ONE_WIRE_BUS 5
      #define COMPARE_TEMP 0 // Send temperature only if changed? 1 = Yes 0 = No
      float lastTemperature = 0;
      MyMessage tempMsg(0, V_TEMP); // Initialize temperature message
      OneWire oneWire(ONE_WIRE_BUS); 
      DallasTemperature sensors(&oneWire); // Pass our oneWire reference to Dallas Temperature. 
      unsigned long SLEEP_TIME = 4000; // Sleep time between reads (in milliseconds)
      
      void setup(void)
      {
      	// start serial port
      	Serial.begin(115200);
      }
      
      void presentation() 
      {
      	// Send the sketch version information to the gateway and Controller
      	sendSketchInfo("Temperature Sensor", "1.1");
      
      	present(TEMP_SENSOR_ID, S_TEMP);
      }
      
      void loop(void)
      { 
      	DeviceAddress tempDeviceAddress; // We'll use this variable to store a found device address    
      
      	// For testing purposes, reset the bus every loop so we can see if any devices appear or fall off
      	sensors.begin();
         
      	sensors.requestTemperatures(); // Send the command to get temperatures
      	
      	// Search the wire for address
         if(sensors.getAddress(tempDeviceAddress, 0))
         {
      		float tempC = sensors.getTempC(tempDeviceAddress);
      		
      		Serial.print("Temperature=");
      		Serial.println(tempC); 
      
      		// Only send data if temperature has changed and no error
      #if COMPARE_TEMP == 1
      		if (lastTemperature != tempC && tempC != -127.00 && tempC != 85.00)
      		{
      #else
      		if (tempC != -127.00 && tempC != 85.00)
      		{
      #endif
      			// Send in the new temperature
      			send(tempMsg.setSensor(0).set(tempC, 1));
      			// Save new temperatures for next compare
      			lastTemperature = tempC;
      		}
         } 
             
      	delay(SLEEP_TIME);
      }
      

      And now the questions:

      1. The node has a Unknown sketch name in Domoticz. Why?
      2. When I select the node in Domotics I see one child as expected, but the Type is Unknown and the Name is empty. (Even though I have given the sensor a name in the Devices view)

      After having used Domoticz for only a few days, and only testing things, it already feels like Domoticz is not very intuitive. Maybe powerful, but the design and usage is all but user friendly.

      posted in Domoticz
      raptorjr
      raptorjr
    • RE: Gateway question

      Well, it is not so much about having to use a wire although I think that when possible things should be wireless. It is more about that I don't have a NRF card but only a ESP card and I would like to get something working since it takes a few weeks to get the NRF cards.

      Arduino+NRF can be used as a node, Arduino+ESP can't. Wasn't even thinking that no one had done that before and that there wasn't any support for it. The only difference in my mind is that the ESP have to be configured to connect to a wireless network first. After that there shouldn't have to be any difference with the communication. But maybe the example above could work?

      But as I said, I have no experience about this and just got my first Arduino a few days ago, so I have no clue about these things.

      posted in General Discussion
      raptorjr
      raptorjr
    • RE: Gateway question

      Thank you, I could look at it, but I think it is way beyond my knowledge level.

      posted in General Discussion
      raptorjr
      raptorjr
    • RE: Gateway question

      @mfalkvidd
      So there isn't really any combination that would work for me?

      I would need a ESP8266Gateway that would talk RS485 to my Arduino with all the sensors?

      posted in General Discussion
      raptorjr
      raptorjr
    • RE: Gateway question

      @mfalkvidd
      Maybe I'm starting to understand now 😃 The RS485 gateway sketch on the Arduino, and then I need a sketch on the ESP that transfer the serial commands from the Arduino through Wifi?

      posted in General Discussion
      raptorjr
      raptorjr
    • RE: Gateway question

      @mfalkvidd
      Since I have ordered a bunch of NRF cards this will not be a problem in a few weeks. Just trying to understand and learn things while waiting.

      I would like to make a node that consist of a arduino nano with sensors attached, and a ESP connected to the arduino for communication. I would then like to add that node to Domoticz running on a Pi3 with Wifi.

      posted in General Discussion
      raptorjr
      raptorjr
    • RE: Gateway question

      This will be far more complicated than I have knowledge for right now.

      I just think it is kind of strange that the combination of a Wifi enabled controller and Wifi enabled node is not supported. For me as a beginner it is just another media for communication.

      posted in General Discussion
      raptorjr
      raptorjr
    • RE: Gateway question

      @mfalkvidd

      So I am really trying to understand how this works, and unfortunately the links don't help that much. Feeling really stupid.

      Either it is possible but no one has done it or I don't understand how it has been done. But after reading everything I can find I still don't understand how it works.

      All the examples about gateways include a NRF module, with exception of having the gateway directly on a ESP8266. But then you get very limited with I/O ports.

      I would like to have a Arduino as a gateway, and instead of using NRF for communication it should use a ESP8266. No sketch or anything on the ESP, only used for communication. All sensors and things should be connected to the Arduino.

      What am I missing?

      posted in General Discussion
      raptorjr
      raptorjr
    • RE: Trying my first temperature sketch

      I found the link to the updated 2.0 sketch and even though I still have problems, this is not one of them anymore 😃
      https://github.com/mysensors/MySensorsArduinoExamples

      posted in Troubleshooting
      raptorjr
      raptorjr
    • RE: Gateway question

      So I realize that I need to do some more shopping. But to avoid to end up short of things again I thought I'd ask what to buy.

      I need NRF for gateway. Is there any benefit of buying one with an antenna for better reception? Or should I just buy a pack of 10 ordinary and that would be enough for the gateway too?

      What kind of Arduinos to use for their nodes? Arduino Pro Mini? Or is Sensebender a better solution? I'm just looking for a decent starting ground to be able to create a few nodes. Don't really have any plans for more nodes right now, just for future ideas.

      Anything else that is good to have?

      posted in General Discussion
      raptorjr
      raptorjr