Navigation

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

    Best posts made by kimot

    • RE: CAN bus transport implementation for MYS

      @gonzalonal
      Yes I am.
      But I have got a lot of other works, so It's going slowly.
      The problem is, that CAN can transfer only 29 bits ID ( 3 bytes + 5 bits ) and max. 8 bytes of data.
      MySensors message has got max. 32 bytes ( 7 bytes header and 25 bytes of data ).
      I must either send MySensors message like 3 packets of CAN messages or limit properties of MySensors protocol.
      Now I am working on second variant.
      I am able code to one CAN message:
      6 bits - destination
      6 bis - sender
      (gateway, broadcast, 62 nodes - it is enough for me for one bus. I plane three buses and gateway can " translate " or "expand" nodes ID from and to controller )
      1 bit - RACK
      1 bit - IS ACK
      3 bits - command
      6 bits - type ( MY sensors has 56 types max. now )
      6 bits - sensor id ( only 64 sensors per node ... )
      3 bits - payload type ( int, uint, long .... )

      The sum of these is not 29, but 32 so I am using a little "hacking" data length field in CAN frame to obtain additional 3 bits.
      For data I have got 8 bytes.
      It is enough for conventional data types from char to floating point.
      Only text messages are limited to 8 bytes. But for us, old boys, who remember old DOS file names, it is enough.

      In this time, I am able send and receive packets in that format between nodes and now I am working on transfer RS485 library to CAN library.
      The problem is, that RS485 library sends destination address, node id, length of message and then MySensors message, witch "surprisingly" contain again destination and sender bytes. A little bit redundant for me.
      So I must remove some fields from MySensors message, put it to CAN ID and send only payload in CAN data fields.
      When I receive CAN message, I must again assemble correct MySensors message format and put it to MySensors system.
      But unfortunately only documentation is library code itself :o(

      I try a "stress test" like here:
      https://forum.mysensors.org/topic/5051/rs485-stress-test

      I send 10 000 messages from two nodes to "gateway" ( 22kbps ).
      Result - zero messages lost.
      But it is expectable with CAN.

      posted in My Project
      kimot
      kimot
    • RE: remote control design idea

      Why sleep?
      Switch it completely off.
      Use button with two pairs of contacts.
      One pair on each button connect battery + pole with processor power pin.
      Second pairs to different inputs pins.
      You push button, processor will start execute program, immediately read inputs status,
      then send command and when you release button, it will be switched off.
      If you need longer processing time and do not want hold button all this time, then processor can hold power itself by logical output with connected transistor. When work will be done, then switch itself off.
      Your car remote key works the same way.

      posted in Development
      kimot
      kimot
    • RE: Problems with the neighbours

      @stevanov
      It seems, that both of you use MySensors in "outofbox" state.
      You do not write which radio module are using.
      If RFM69 - change netwotk ID, with NRF24 change channel or network ID
      Somewhere in config files.

      MyConfig.h

      #define MY_RF24_CHANNEL (76)
      /**
       * @def MY_RF24_BASE_RADIO_ID
       * @brief RF24 radio network identifier.
       *
       * This acts as base value for sensor nodeId addresses. Change this (or channel) if you have more
       * than one sensor network.
       */
      #ifndef MY_RF24_BASE_RADIO_ID
      #define MY_RF24_BASE_RADIO_ID 0x00,0xFC,0xE1,0xA8,0xA8
      #endif
      
      /**
       * @def MY_RFM69_NETWORKID
       * @brief RFM69 Network ID. Use the same for all nodes that will talk to each other.
       */
      #ifndef MY_RFM69_NETWORKID
      #define MY_RFM69_NETWORKID (100)
      #endif
      
      

      Of course you must reprogram all nodes and gateway :o(

      Or talk with your neighbours and ask them using different network ID if they only starting building their network and have got smaller number of sensors.

      posted in General Discussion
      kimot
      kimot
    • RE: Domoticz data timeout

      @gbuico
      tmr.now() is LUA function
      NodeMCU LUA is firmware, which you load to your NodeMCU ( or other ESP2866 ) and then write your programs in LUA scripts, which stores in ESP2866.

      MySensors is writen In Ardfuino language ( C++ ), so Arduino IDE compile your program and load it to ESP2866. And there is not tmr.now(). Use millis() instead off.

      ESPeasy is firemware to load to ESP2866.
      It runs on ESP2866 and you can create sensors and write simple "program" when connected to ESP webpage.
      There are any timeouts, you can send message one per day or month, no problem.
      You do not need compile ESPeasy itself. Use compiled file and download it to your ESP2866.

      First you create your sensors in Domoticz as "Dummy" devices and remembers their "idx".
      Then connect with browser to your sensor with ESPeasy running and through its webpage you can define different sensors ( sensor type, GPIO where connected, its domoticz idx , sending interval, etc )
      For example, for DS18b20 you select pin for 1-wire bus, then you can see all sensors on this bus and select which you need. Temperature is automatically send to Domoticz.
      Different sensor - no problem, select for example pins for i2c bus, discover this bus and then select sensor.
      Display - select i2c address and it is done.
      But what I really love on ESPeasy is its communication model.
      If you cannot send some info through ESPeasy autmatically, you can write json command and send to Domotic whateverelse.
      Need send data from Domoticz to your ESPeasy - no problem.
      You can send commands from Domoticz with parameters and receive it in ESPeasy.
      You can transfer everything this way.
      No compilation, only write in your browser and hit "Apply" button.

      I like MySensors very much, but for wi-fi connected single sensors exists easier ways.

      But my dream is feature for MySensor ethernet gateway, when I can send to gateway something like this:
      http://gatewayip/control?cmd=23;5;24.5
      which means = to_node, sensor_id, value.

      Or opposite way, send from sensor to gateway command with domoticz sensor idx, type of domoticz value (svalue or nvalue ) and value itself and gateway will send to domoticz appropriate json command.

      posted in Domoticz
      kimot
      kimot
    • RE: Nano minimum voltage

      Why "plus" 7805.
      Nano has got voltage regulator on board.
      Original Arduinos 7805 I think, clones LM1117 usually.

      posted in Hardware
      kimot
      kimot
    • RE: 💬 Leaky - water detector

      @Sixkillers
      You can wake up every hour, but hold wifi modem off, increment "wake up counter" and go to deep sleep.
      Running time between deep sleeps will be very short
      And connect to wifi one per day for example.
      And make some tweaks for wifi connection:
      For inspiration from Step 6 here:

      https://www.instructables.com/ESP8266-Pro-Tips/

      And final tweak here:

      https://www.bakke.online/index.php/2017/06/24/esp8266-wifi-power-reduction-avoiding-network-scan/

      posted in OpenHardware.io
      kimot
      kimot
    • RE: best solution to monitor and log power usage

      Some Sonoff switching devices has got power metering.
      Upload ESPeasy or Tasmota firmware and connect with HA....

      posted in General Discussion
      kimot
      kimot
    • RE: Reset values measured by Power Meter Pulse?

      @koewacko
      You can set negative offset 86kWh in Domoticz counter setup.

      posted in Domoticz
      kimot
      kimot
    • RE: Nano minimum voltage

      @bjacobse said in Nano minimum voltage:

      Datasheet: The device operates between 1.8-5.5 volts.
      and this means to bypass/remove the voltage regulator on the Nano board

      But it do NOT means with 16Mhz crystal on Arduino Nano ...

      posted in Hardware
      kimot
      kimot
    • RE: ds18b20 on 2xAAA battery

      @pihome
      very power hungry (Quiescent current 13uA) ?
      And do you know, that with AAA (1000 mAh) it is 8 years in standby?
      Maybe self discharge is greater.
      Alternetively use 3xAAA with low quiescent current 3.3V LDO.

      posted in Troubleshooting
      kimot
      kimot
    • RE: Combining MySensors examples

      @bluezr1
      Do you see "MockMySensors" example sketch which comes with MySensors library?
      There are all sensors in one sketch together.
      Presentation, sending its values, receiving ....

      posted in Development
      kimot
      kimot
    • RE: Using an 802.11g wifi transport

      If you plan using ESP chips or Raspberry as your sensors node, I think better way is ESPeasy or similar sw for ESPs.

      posted in MyController.org
      kimot
      kimot
    • RE: Looking to switch automation controller software

      @dbemowsk You can use NODE RED as a translator between your hardware and protokol and then send translated messages to Domoticz ( for example). I think NODE RED + any sw controller is very powerfull combination.

      posted in General Discussion
      kimot
      kimot
    • RE: help for step by step wiring and configure a gateway with RS485 module and raspberry pi 3

      @Reza
      Remeber, that GPIO Uart on RPi3 is not ttyAMA0 like with RPi2( it is bluetooth now ).
      GPIO is ttyS0 on RPi3.

      http://raspberrypi.stackexchange.com/questions/45570/how-do-i-make-serial-work-on-the-raspberry-pi3

      Or read this thread too:
      https://forum.mysensors.org/topic/6015/serial-gateway-connect-problem-ttyama0

      posted in Troubleshooting
      kimot
      kimot
    • RE: RS485/RS232/Serial transport class for mysensors.org

      I think, that CAN transceiver chip is better then RS485 transceiver chip.
      Then we dont need direction setting pin and bus state is better determined, becose CAn bus is prepered for bus collisions, RS485 not.
      I mean only CAN bus transceiver, not CAN controller ! For example MCP2551 or MCP2562.
      And we can use normal serial library.

      posted in Development
      kimot
      kimot
    • RE: Breaduino (Atmega328p) as Mysensors Node (NRF24L01+) - will it work?

      @petr-nosek said in Breaduino (Atmega328p) as Mysensors Node (NRF24L01+) - will it work?:

      Atmega328P
      It must work on breadboard.
      And you cannot damage Arduino Pro Mini by removing LED only.

      16MHz and 3.3 V is out of specification.
      Therefore Arduino for 3.3v uses 8MHz.

      https://www.ebay.com/itm/NEW-Pro-Mini-ATMEGA328P-5V-16M-3-3V-8M-Optional-Arduino-PRO-mini-Compatible/322733156356?hash=item4b24652804â“‚mu7vfkUp6EGgxFbtG1p2IDQ

      NEW Pro Mini ATMEGA328P 5V/16M 3.3V/8M Optional Arduino PRO mini Compatible

      $2.65
      Sold out
      posted in Hardware
      kimot
      kimot
    • RE: rs485 on nano

      @Reza
      Maybe stupid question from me, but have got you connected ground wires between nodes?
      Not only A and B?
      http://www.chipkin.com/rs485-cables-why-you-need-3-wires-for-2-two-wire-rs485/

      posted in General Discussion
      kimot
      kimot
    • RE: Domoticz TEXT sensor triggering

      @alowhum

      bool MySensorsBase::WriteToHardware(const char *pdata, const unsigned char length)
      {
      	const tRBUF *pCmd = reinterpret_cast<const tRBUF *>(pdata);
      	unsigned char packettype = pCmd->ICMND.packettype;
      	unsigned char subtype = pCmd->ICMND.subtype;
      
      	if (packettype == pTypeLighting2)
      	{
      		//Light command
      
      		int node_id = pCmd->LIGHTING2.id4;
      		int child_sensor_id = pCmd->LIGHTING2.unitcode;
      
      		if (_tMySensorNode *pNode = FindNode(node_id))
      		{
      			_tMySensorChild *pChild = pNode->FindChild(child_sensor_id);
      			if (!pChild)
      			{
      				_log.Log(LOG_ERROR, "MySensors: Light command received for unknown node_id: %d, child_id: %d", node_id, child_sensor_id);
      				return false;
      			}
      
      			int light_command = pCmd->LIGHTING2.cmnd;
      			if ((pCmd->LIGHTING2.cmnd == light2_sSetLevel) && (pCmd->LIGHTING2.level == 0))
      			{
      				light_command = light2_sOff;
      			}
      			else if ((pCmd->LIGHTING2.cmnd == light2_sSetLevel) && (pCmd->LIGHTING2.level == 255))
      			{
      				light_command = light2_sOn;
      			}
      
      			if ((light_command == light2_sOn) || (light_command == light2_sOff))
      			{
      				std::string lState = (light_command == light2_sOn) ? "1" : "0";
      				if (pChild->presType == S_LOCK)
      				{
      					//Door lock/contact
      					return SendNodeSetCommand(node_id, child_sensor_id, MT_Set, V_LOCK_STATUS, lState, pChild->useAck, pChild->ackTimeout);
      				}
      				else if (pChild->presType == S_SCENE_CONTROLLER)
      				{
      					//Scene Controller
      					return SendNodeSetCommand(node_id, child_sensor_id, MT_Set, (light_command == light2_sOn) ? V_SCENE_ON : V_SCENE_OFF, lState, pChild->useAck, pChild->ackTimeout);
      				}
      				else
      				{
      					//normal
      					return SendNodeSetCommand(node_id, child_sensor_id, MT_Set, V_STATUS, lState, pChild->useAck, pChild->ackTimeout);
      				}
      			}
      			else if (light_command == light2_sSetLevel)
      			{
      				float fvalue = (100.0f / 14.0f)*float(pCmd->LIGHTING2.level);
      				if (fvalue > 100.0f)
      					fvalue = 100.0f; //99 is fully on
      				int svalue = round(fvalue);
      
      				std::stringstream sstr;
      				sstr << svalue;
      				return SendNodeSetCommand(node_id, child_sensor_id, MT_Set, V_PERCENTAGE, sstr.str(), pChild->useAck, pChild->ackTimeout);
      			}
      		}
      		else {
      			_log.Log(LOG_ERROR, "MySensors: Light command received for unknown node_id: %d", node_id);
      			return false;
      		}
      	}
      	else if (packettype == pTypeLimitlessLights)
      	{
      		//RGW/RGBW command
      		_tLimitlessLights *pLed = (_tLimitlessLights *)pdata;
      		//unsigned char ID1 = (unsigned char)((pLed->id & 0xFF000000) >> 24);
      		//unsigned char ID2 = (unsigned char)((pLed->id & 0x00FF0000) >> 16);
      		unsigned char ID3 = (unsigned char)((pLed->id & 0x0000FF00) >> 8);
      		unsigned char ID4 = (unsigned char)pLed->id & 0x000000FF;
      
      		int node_id = (ID3 << 8) | ID4;
      		int child_sensor_id = pLed->dunit;
      
      		if (_tMySensorNode *pNode = FindNode(node_id))
      		{
      			_tMySensorChild *pChild = pNode->FindChild(child_sensor_id);
      			if (!pChild)
      			{
      				_log.Log(LOG_ERROR, "MySensors: Light command received for unknown node_id: %d, child_id: %d", node_id, child_sensor_id);
      				return false;
      			}
      
      			bool bIsRGBW = (pNode->FindChildWithPresentationType(child_sensor_id, S_RGBW_LIGHT) != NULL);
      			if (pLed->command == Limitless_SetRGBColour)
      			{
      				int red, green, blue;
      
      				float cHue = (360.0f / 255.0f)*float(pLed->value);//hue given was in range of 0-255
      				int Brightness = 100;
      				int dMax = round((255.0f / 100.0f)*float(Brightness));
      				hue2rgb(cHue, red, green, blue, dMax);
      				std::stringstream sstr;
      				sstr << std::setw(2) << std::uppercase << std::hex << std::setfill('0') << std::hex << red
      					<< std::setw(2) << std::uppercase << std::hex << std::setfill('0') << std::hex << green
      					<< std::setw(2) << std::uppercase << std::hex << std::setfill('0') << std::hex << blue;
      				return SendNodeSetCommand(node_id, child_sensor_id, MT_Set, (bIsRGBW == true) ? V_RGBW : V_RGB, sstr.str(), pChild->useAck, pChild->ackTimeout);
      			}
      			else if (pLed->command == Limitless_SetColorToWhite)
      			{
      				std::stringstream sstr;
      				int Brightness = 100;
      				int wWhite = round((255.0f / 100.0f)*float(Brightness));
      				if (!bIsRGBW)
      				{
      					sstr << std::setw(2) << std::uppercase << std::hex << std::setfill('0') << std::hex << wWhite
      						<< std::setw(2) << std::uppercase << std::hex << std::setfill('0') << std::hex << wWhite
      						<< std::setw(2) << std::uppercase << std::hex << std::setfill('0') << std::hex << wWhite;
      				}
      				else
      				{
      					sstr << "#000000"
      						<< std::setw(2) << std::uppercase << std::hex << std::setfill('0') << std::hex << wWhite;
      				}
      				return SendNodeSetCommand(node_id, child_sensor_id, MT_Set, (bIsRGBW == true) ? V_RGBW : V_RGB, sstr.str(), pChild->useAck, pChild->ackTimeout);
      			}
      			else if (pLed->command == Limitless_SetBrightnessLevel)
      			{
      				float fvalue = pLed->value;
      				int svalue = round(fvalue);
      				if (svalue > 100)
      					svalue = 100;
      				std::stringstream sstr;
      				sstr << svalue;
      				return SendNodeSetCommand(node_id, child_sensor_id, MT_Set, V_PERCENTAGE, sstr.str(), pChild->useAck, pChild->ackTimeout);
      			}
      			else if ((pLed->command == Limitless_LedOff) || (pLed->command == Limitless_LedOn))
      			{
      				std::string lState = (pLed->command == Limitless_LedOn) ? "1" : "0";
      				return SendNodeSetCommand(node_id, child_sensor_id, MT_Set, V_STATUS, lState, pChild->useAck, pChild->ackTimeout);
      			}
      		}
      		else
      		{
      			_log.Log(LOG_ERROR, "MySensors: Light command received for unknown node_id: %d", node_id);
      			return false;
      		}
      	}
      	else if (packettype == pTypeBlinds)
      	{
      		//Blinds/Window command
      		int node_id = pCmd->BLINDS1.id3;
      		int child_sensor_id = pCmd->BLINDS1.unitcode;
      
      		if (_tMySensorNode *pNode = FindNode(node_id))
      		{
      			_tMySensorChild *pChild = pNode->FindChild(child_sensor_id);
      			if (!pChild)
      			{
      				_log.Log(LOG_ERROR, "MySensors: Light command received for unknown node_id: %d, child_id: %d", node_id, child_sensor_id);
      				return false;
      			}
      
      			if (pCmd->BLINDS1.cmnd == blinds_sOpen)
      			{
      				return SendNodeSetCommand(node_id, child_sensor_id, MT_Set, V_UP, "", pChild->useAck, pChild->ackTimeout);
      			}
      			else if (pCmd->BLINDS1.cmnd == blinds_sClose)
      			{
      				return SendNodeSetCommand(node_id, child_sensor_id, MT_Set, V_DOWN, "", pChild->useAck, pChild->ackTimeout);
      			}
      			else if (pCmd->BLINDS1.cmnd == blinds_sStop)
      			{
      				return SendNodeSetCommand(node_id, child_sensor_id, MT_Set, V_STOP, "", pChild->useAck, pChild->ackTimeout);
      			}
      		}
      		else {
      			_log.Log(LOG_ERROR, "MySensors: Blinds/Window command received for unknown node_id: %d", node_id);
      			return false;
      		}
      	}
      	else if ((packettype == pTypeThermostat) && (subtype == sTypeThermSetpoint))
      	{
      		//Set Point
      		const _tThermostat *pMeter = reinterpret_cast<const _tThermostat *>(pCmd);
      
      		int node_id = pMeter->id2;
      		int child_sensor_id = pMeter->id3;
      		_eSetType vtype_id = (_eSetType)pMeter->id4;
      
      		if (_tMySensorNode *pNode = FindNode(node_id))
      		{
      			_tMySensorChild *pChild = pNode->FindChild(child_sensor_id);
      			if (!pChild)
      			{
      				_log.Log(LOG_ERROR, "MySensors: Light command received for unknown node_id: %d, child_id: %d", node_id, child_sensor_id);
      				return false;
      			}
      
      			char szTmp[10];
      			sprintf(szTmp, "%.1f", pMeter->temp);
      			return SendNodeSetCommand(node_id, child_sensor_id, MT_Set, vtype_id, szTmp, pChild->useAck, pChild->ackTimeout);
      		}
      		else {
      			_log.Log(LOG_ERROR, "MySensors: Blinds/Window command received for unknown node_id: %d", node_id);
      			return false;
      		}
      	}
      	else if (packettype == pTypeGeneralSwitch)
      	{
      		//Used to store IR codes
      		const _tGeneralSwitch *pSwitch= reinterpret_cast<const _tGeneralSwitch *>(pCmd);
      
      		int node_id = pSwitch->unitcode;
      		unsigned int ir_code = pSwitch->id;
      
      		if (_tMySensorNode *pNode = FindNode(node_id))
      		{
      			_tMySensorChild* pChild = pNode->FindChildByValueType(V_IR_RECEIVE);
      			if (pChild)
      			{
      				std::stringstream sstr;
      				sstr << ir_code;
      				return SendNodeSetCommand(node_id, pChild->childID, MT_Set, V_IR_SEND, sstr.str(), pChild->useAck, pChild->ackTimeout);
      			}
      		}
      		else {
      			_log.Log(LOG_ERROR, "MySensors: Blinds/Window command received for unknown node_id: %d", node_id);
      			return false;
      		}
      	}
      	else
      	{
      		_log.Log(LOG_ERROR, "MySensors: Unknown action received");
      		return false;
      	}
      	return true;
      }```
      posted in Troubleshooting
      kimot
      kimot
    • RE: RS485/RS232/Serial transport class for mysensors.org

      @andriej
      RS485 was not designet for multimaster communication, where 2 devices can communicate on the bus at same time. RS485 bus state at this time is not defined. For example if node on RS485 on one end of bus sends message end perform "control" lisening on bus if recieve the same message( what is with correct circuit of RS485 transsiever immposible ), then this received message can be the same. But if in the same time another node on oposite end of bus sends different message, then node on the middle of bus recieves something random.
      But CAN bus has allways defined state. It has dominate state and recesive state, so node witch send dominate bit cannot be pushed yb node witch at the same time sends recesive bit. I now, thet this feature we cannot use with normal serial communication, but still we can controll correct sending of datagram by lisening bus by sender. If we recieve the same message what we send, there is 100% shure, that the same message lisens every node on CAN bus. On RS485 this is not garanted. Bus topology is the same end we dont need "dePin". So we can use normal serial library. And CAN transciever is not so expensive as wrote LeoDesigner. Look here:

      http://www.ebay.com/itm/10PCS-MCP2551-I-SN-IC-TRANSCEIVER-CAN-HI-SPD-8-SOIC-NEW-/171541737564?hash=item27f0af305c:g:nbQAAOSwIBBUZU~k

      And sorry for my english

      10PCS MCP2551-I/SN IC TRANSCEIVER CAN HI-SPD 8-SOIC NEW

      $4.52
      59 available
      posted in Development
      kimot
      kimot
    • RE: Running a 5v Arduino at 3.3v on battery

      @thecricketer
      Problem is, that you want something like perpetuum mobile.

      Arduino on 5v at 16MHz has got higher power consumption than on 3V at 8MHz.

      Step up VR or not - simply higher.
      Plus VR has its own not 100% efficiency and power consumption.
      Still you wont the same battery life?

      Therefore people maybe suggest you reprogram fuses on your Arduinos and use internal oscilator and run on 3.3V

      posted in Hardware
      kimot
      kimot
    • RE: why mysensors is based on nrf24?

      And do not forgot about law restrictions in some countries, EU and etc.
      For example with 868 Mhz your device can transmitting max 1% of time per one hour.
      Maybe problem for gateway node?
      2,4 GHZ is relatively free all over the world.
      Page 7 here

      posted in General Discussion
      kimot
      kimot
    • RE: [SOLVED] Puzzle over water meter .sensor

      @zboblamont
      I'm sorry to let you know that you are using Atmega328p outside the manufacturer-guaranteed specifications.
      My apology again
      But your super "Whisper NODE AVR" with onboard booster is very nice, but this booster "boost" to 3,3V.
      And 16Mhz is out of range for ATmega328p at 3.3V
      It wants a lot of courage to sell such a product for boys from Wisen

      Look at circuit diagram:
      https://bitbucket.org/talk2/whisper-node-avr/src/bad0f4f997dc9bae952d9aafd13397e1015eb602/Documentation/Whisper_Node-AVR_0.3.pdf?at=master&fileviewer=file-view-default

      I believe that it works in most cases, but there can be situations - noise, EMI, when a problem occurs for this reason.
      Something like PRO-MINI with 8MHz is safer for me and I do not have problems with random events.

      posted in Troubleshooting
      kimot
      kimot
    • RE: RS485/RS232/Serial transport class for mysensors.org

      @andriej
      It is a pity that not paying more attention mysensors.org for nodes interconnected by wires. But it is very difficult to find peer-to-peer protocol for RS485. Mainly because of solving collisions on the bus when multiple sensors. But it is very difficult to find peer-to-peer protocol for RS485. Mainly because of solving collisions on the bus when multiple sensors. I think that used ICSC library does not address this matter satisfactorily and with a larger number of sensor problems arise. ICSC library uses a Serial Software library by heavyweight each node on the bus, because all must be checke every bit transmitted on the bus. Look at different implementation:

      www.mrbus.org

      I think, thet using hardware UART is absolutely necessary.
      Or why when we use a separate module for radio transmission, we use the special module for robust message transfer over the wired bus? CAN controllers are not so expensive in this days:

      http://www.ebay.com/itm/MCP2515-CAN-Bus-Module-Board-TJA1050-receiver-SPI-For-51-MCU-ARM-controller-M2-/381500570180?hash=item58d334ba44:g:OhcAAOSw3KFWfANk

      After correct CAN controller configuration, we simply write a message to the CAN controller and forgot about it. No check or bus arbitration. And through interrupt pin from the controller just pick up the incoming message with our ID or broadcast.

      I know it's not as simple as using only RS485 transmitter itself, but we are guaranteed connecting maximum of 110 nodes and various libraries for Arduino for this CAN controller exist.

      MCP2515 CAN Bus Module Board TJA1050 receiver SPI For 51 MCU ARM controller M2

      $2.28
      Sold out
      posted in Development
      kimot
      kimot
    • RE: How to protect rain sensor from oxidation?

      https://www.letscontrolit.com/forum/viewtopic.php?f=2&t=6540

      posted in Hardware
      kimot
      kimot
    • RE: Central Heating modernisation..

      I made heating as simply as possible - with good house insulation ( 20cm foam PVC for walls and 40 cm for roof ).
      I am using el. floor heating ( cables ) on both floors + fireplace like backup for unpredicable situations and for fun.
      I know, that heating cost me 2 or 3 times more than with heatpump, but consuption is low and investition was really very low too.
      ( cca 600 euros all heating cables and I made all work myself )
      Regulation in this time ( and last winter ) by cheap Wemos with relay board and ESPeasy firmware on it in each room.
      It can regulate room or floor temperature ( I am using floor temperature regulation ) .
      Mode of operation and temperature setting are made from Domoticz, but regulation is made by Wemos itself - not running Domoticz needed.
      Temperatures and energy consumption are reported back to Domoticz.
      It was very funny two weekends project. One weekend familiarization with ESPeasy and next weekend regulator and Domoticz integration making.
      But it is not final stage, because ESP is very energy "hungry" and 4 lines of my UTP cable is not enough for cca 7 Wemos with relays on each part of bus.
      And I do not want wi-fi using for my sensors.
      But I need quick solution and it was.

      posted in General Discussion
      kimot
      kimot
    • RE: Problem with sensors on arduino and domoticz

      @hyperflemme
      Than in your second sketch ( with sensors )
      define MY_GATEWAY_SERIAL
      is missing.
      This sketch works like normal node without this, not as gateway with sensors connected.

      posted in Troubleshooting
      kimot
      kimot
    • RE: What are these bad practices ?

      @lrtsenar
      "multiple definition of"
      I got too when experimenting with some libraries.
      For example I edit my version "mcp_can.cpp" and rename original version to "mcp_can_old.cpp"
      ( and leave it in original library directory )
      Then when compiling I got this "multiple definition of" error.
      When I rename original to "mcp_can.xxx" compilation works ok.
      "mcp_can_old.cpp" is not included in any place in the code.
      It seems that Arduino IDE uses at first ( for preprocessor ? ) all .h and .cpp files in the library directory.

      posted in Development
      kimot
      kimot
    • RE: RF Nano = Nano + NRF24, for just $3,50 on Aliexpress

      @alowhum
      For me top user friendly is ESPeasy.
      Through web interface selecting which sensors on which pins connected and to which controller send data.
      When user become more experienced, he can use rules to write some "programs".
      No recompilation needed.
      But not useful for battery powered nodes which needs receive some data.

      posted in Hardware
      kimot
      kimot
    • RE: Interrupts on Gateway

      @smartalek
      https://www.arduino.cc/reference/en/language/functions/external-interrupts/attachinterrupt/

      posted in General Discussion
      kimot
      kimot
    • RE: Problem with sensors on arduino and domoticz

      I think we still do not know the topology of your network and we use different terms.
      For most of us a "sensor" is - temperature sensor, humidity sensor, pressure sensor, etc. These sensors are connected to Arduino, which we call the "node".
      These node are connected through radio or RS485 to Arduino which works like gateway and send received messages from nodes to controller ( Rpi with Domoticz ).
      Usually gateway have got no sensors and you can use pure gateway sketch from examples.
      But you can connect sensors directly to gateway, but you must modify gateway sketch then.

      • setup your sensors
      • present your sensors
      • send values form your sensors.

      And of course NO SLEEP FUNCTION in sensor send code.

      Places, where put it is marked by comments in gateway sketch:

      void setup()
      {
          // Setup locally attached sensors
      }
      
      void presentation()
      {
          // Present locally attached sensors
      }
      
      void loop()
      {
          // Send locally attached sensor data here
      }
      

      Usual topology:
      0_1551265556965_IMG_20190227_113409.jpg

      I think your topology:
      0_1551265601343_IMG_20190227_113420.jpg

      posted in Troubleshooting
      kimot
      kimot
    • RE: MySensors - Get Temperature value from another node through the Gateway

      @joe13
      I think, you must send temperature ( for later resending) to domoticz like V_VAR1 for storing it, and then requested it again like V_VAR1. Do not use V_TEMP for this.
      Look at V_VAR like universal variable for storing anything.
      At your code examples is not evident, what you put to V_VAR1 first, maybe nothing, so do not be disappointed, if you read 0 back.
      At EnergyCounter Sensor you can see:

      MyMessage wattMsg(CHILD_ID,V_WATT);
      MyMessage kwhMsg(CHILD_ID,V_KWH);
      MyMessage pcMsg(CHILD_ID,V_VAR1);    !!!!!!
      ....
      
      send(wattMsg.set(watt));
      send(kwhMsg.set(kwh, 4));  // Send kwh value to gw
      send(pcMsg.set(pulseCount));  // Send pulse count value to gw         !!!!!!
       .....
      
      request(CHILD_ID, V_VAR1);
      
      
      

      So it sends to domoticz not only W and kWh for displaying it, but pulse for storing and reading later too.

      But like wrote gohan, I think better way is sending temperature from node twice - to domoticz and to LCD node. This will work even if domoticz will bee down.

      posted in Development
      kimot
      kimot
    • RE: Solar powered node, that should only send occasionally

      I am using HC-SR04 for reading water level too.
      My measuring range is 110 cm = empty tank, 2 cm = full tank. ( this is now ).

      Only problem I have got - when it is raining, some water drops condenses on sensor at night and sensor sends zero value.
      Or I need better cover for my sensor ...
      I eliminate by Domoticz code these bad readings.

      I send to Domoticz actual distance and battery voltage every 10 minutes and calculate volume in m3 and percentage and water influx or consumption.

      I am using battery powered Arduino Mini with MySensors network.
      Only power led removed - consumption in sleep 70microA.
      I am cutting off power for SR04 during sleep with small relay too and then it power on again.
      There is a little delay before distance measuring and I read three times distance and use only last reading, because independently on delay time, first readings returns zero value sometimes after power on sr04...

      Another problem is, that I power SR04 directly from battery, which voltage changes a little according ambient temperature.
      Using voltage stabilizer for SR04 will be necessarily.
      It was very quick project ...

      0_1557057629950_IMG_20190501_191554.jpg

      0_1557057657405_Nadrz.png

      0_1557057674836_Distance.png

      0_1557057690245_Volume.png

      posted in Hardware
      kimot
      kimot
    • RE: WAF in jeopardy today

      @dbemowsk
      It is from here:
      https://github.com/letscontrolit/ESPEasy/releases/tag/v2.0-20180322

      I connect it like you wrote.

      posted in General Discussion
      kimot
      kimot
    • RE: Atmega328P + RFM69HW(868) not working

      Try my 100% working testing setup:

      Wemos D1 gateway:

      /**
       * The MySensors Arduino library handles the wireless radio link and protocol
       * between your home built sensors/actuators and HA controller of choice.
       * The sensors forms a self healing radio network with optional repeaters. Each
       * repeater and gateway builds a routing tables in EEPROM which keeps track of the
       * network topology allowing messages to be routed to nodes.
       *
       * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
       * Copyright (C) 2013-2015 Sensnology AB
       * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
       *
       * Documentation: http://www.mysensors.org
       * Support Forum: http://forum.mysensors.org
       *
       * This program is free software; you can redistribute it and/or
       * modify it under the terms of the GNU General Public License
       * version 2 as published by the Free Software Foundation.
       *
       *******************************
       *
       * REVISION HISTORY
       * Version 1.0 - Henrik EKblad
       * Contribution by a-lurker and Anticimex,
       * Contribution by Norbert Truchsess <norbert.truchsess@t-online.de>
       * Contribution by Ivo Pullens (ESP8266 support)
       *
       * DESCRIPTION
       * The EthernetGateway sends data received from sensors to the WiFi link.
       * The gateway also accepts input on ethernet interface, which is then sent out to the radio network.
       *
       * VERA CONFIGURATION:
       * Enter "ip-number:port" in the ip-field of the Arduino GW device. This will temporarily override any serial configuration for the Vera plugin.
       * E.g. If you want to use the defualt values in this sketch enter: 192.168.178.66:5003
       *
       * LED purposes:
       * - To use the feature, uncomment any of the MY_DEFAULT_xx_LED_PINs in your sketch, only the LEDs that is defined is used.
       * - RX (green) - blink fast on radio message recieved. In inclusion mode will blink fast only on presentation recieved
       * - TX (yellow) - blink fast on radio message transmitted. In inclusion mode will blink slowly
       * - ERR (red) - fast blink on error during transmission error or recieve crc error
       *
       * See http://www.mysensors.org/build/esp8266_gateway for wiring instructions.
       * nRF24L01+  ESP8266
       * VCC        VCC
       * CE         GPIO4
       * CSN/CS     GPIO15
       * SCK        GPIO14
       * MISO       GPIO12
       * MOSI       GPIO13
       * GND        GND
       *
       * Not all ESP8266 modules have all pins available on their external interface.
       * This code has been tested on an ESP-12 module.
       * The ESP8266 requires a certain pin configuration to download code, and another one to run code:
       * - Connect REST (reset) via 10K pullup resistor to VCC, and via switch to GND ('reset switch')
       * - Connect GPIO15 via 10K pulldown resistor to GND
       * - Connect CH_PD via 10K resistor to VCC
       * - Connect GPIO2 via 10K resistor to VCC
       * - Connect GPIO0 via 10K resistor to VCC, and via switch to GND ('bootload switch')
       *
        * Inclusion mode button:
       * - Connect GPIO5 via switch to GND ('inclusion switch')
       *
       * Hardware SHA204 signing is currently not supported!
       *
       * Make sure to fill in your ssid and WiFi password below for ssid & pass.
       */
      
      // Enable debug prints to serial monitor
      #define MY_DEBUG
      
      // Use a bit lower baudrate for serial prints on ESP8266 than default in MyConfig.h
      #define MY_BAUD_RATE 9600
      
      // Enables and select radio type (if attached)
      //#define MY_RADIO_NRF24
      #define MY_RADIO_RFM69
      
      #define MY_IS_RFM69HW // Omit if your RFM is not "H"
      #define MY_RF69_IRQ_PIN D1
      #define MY_RF69_IRQ_NUM MY_RF69_IRQ_PIN
      #define MY_RFM69_CS_PIN D8 // NSS. Use MY_RF69_SPI_CS for older versions (before 2.2.0)
      //#define MY_RADIO_RFM95
      
      #define MY_GATEWAY_ESP8266
      
      #define MY_ESP8266_SSID "SSID"
      #define MY_ESP8266_PASSWORD "password"
      
      // Enable UDP communication
      //#define MY_USE_UDP  // If using UDP you need to set MY_CONTROLLER_IP_ADDRESS below
      
      // Set the hostname for the WiFi Client. This is the hostname
      // it will pass to the DHCP server if not static.
      //#define MY_ESP8266_HOSTNAME "sensor-gateway"
      
      // Enable MY_IP_ADDRESS here if you want a static ip address (no DHCP)
      #define MY_IP_ADDRESS 192,168,1,252
      
      // If using static ip you can define Gateway and Subnet address as well
      #define MY_IP_GATEWAY_ADDRESS 192,168,1,254
      #define MY_IP_SUBNET_ADDRESS 255,255,255,0
      
      // The port to keep open on node server mode
      #define MY_PORT 5003
      
      // How many clients should be able to connect to this gateway (default 1)
      #define MY_GATEWAY_MAX_CLIENTS 2
      
      // Controller ip address. Enables client mode (default is "server" mode).
      // Also enable this if MY_USE_UDP is used and you want sensor data sent somewhere.
      //#define MY_CONTROLLER_IP_ADDRESS 192, 168, 1, 17
      
      // Enable inclusion mode
      //#define MY_INCLUSION_MODE_FEATURE
      
      // Enable Inclusion mode button on gateway
      //#define MY_INCLUSION_BUTTON_FEATURE
      // Set inclusion mode duration (in seconds)
      //#define MY_INCLUSION_MODE_DURATION 60
      // Digital pin used for inclusion mode button
      //#define MY_INCLUSION_MODE_BUTTON_PIN  3
      
      // Set blinking period
      //#define MY_DEFAULT_LED_BLINK_PERIOD 300
      
      // Flash leds on rx/tx/err
      // Led pins used if blinking feature is enabled above
      //#define MY_DEFAULT_ERR_LED_PIN 16  // Error led pin
      //#define MY_DEFAULT_RX_LED_PIN  16  // Receive led pin
      //#define MY_DEFAULT_TX_LED_PIN  16  // the PCB, on board LED
      
      #if defined(MY_USE_UDP)
      #include <WiFiUdp.h>
      #endif
      
      #include <ESP8266WiFi.h>
      #include <MySensors.h>
      
      void setup()
      {
      	// Setup locally attached sensors
      }
      
      void presentation()
      {
      	// Present locally attached sensors here
      }
      
      void loop()
      {
      	// Send locally attached sensors data here
      }
      

      Node - motion sensor:

      /**
       * The MySensors Arduino library handles the wireless radio link and protocol
       * between your home built sensors/actuators and HA controller of choice.
       * The sensors forms a self healing radio network with optional repeaters. Each
       * repeater and gateway builds a routing tables in EEPROM which keeps track of the
       * network topology allowing messages to be routed to nodes.
       *
       * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
       * Copyright (C) 2013-2015 Sensnology AB
       * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
       *
       * Documentation: http://www.mysensors.org
       * Support Forum: http://forum.mysensors.org
       *
       * This program is free software; you can redistribute it and/or
       * modify it under the terms of the GNU General Public License
       * version 2 as published by the Free Software Foundation.
       *
       *******************************
       *
       * REVISION HISTORY
       * Version 1.0 - Henrik Ekblad
       *
       * DESCRIPTION
       * Motion Sensor example using HC-SR501
       * http://www.mysensors.org/build/motion
       *
       */
      
      // Enable debug prints
      #define MY_DEBUG
      
      // RFM69
      #define MY_RADIO_RFM69
      #define MY_IS_RFM69HW
      
      //#define MY_RFM69_NEW_DRIVER   // ATC on RFM69 works only with the new driver (not compatible with old=default driver)
      //#define MY_RFM69_ATC_TARGET_RSSI_DBM (-70)  // target RSSI -70dBm
      //#define MY_RFM69_MAX_POWER_LEVEL_DBM (10)   // max. TX power 10dBm = 10mW
      
      // RFM95
      //#define MY_RADIO_RFM95
      //#define MY_RFM95_ATC_TARGET_RSSI_DBM (-70)  // target RSSI -70dBm
      //#define MY_RFM95_MAX_POWER_LEVEL_DBM (10)   // max. TX power 10dBm = 10mW
      
      #define MY_NODE_ID 20
      #include <MySensors.h>
      
      uint32_t SLEEP_TIME = 120000; // Sleep time between reports (in milliseconds)
      #define DIGITAL_INPUT_SENSOR 3   // The digital input you attached your motion sensor.  (Only 2 and 3 generates interrupt!)
      #define CHILD_ID 1   // Id of the sensor child
      
      // Initialize motion message
      MyMessage msg(CHILD_ID, V_TRIPPED);
      
      void setup()
      {
      	pinMode(DIGITAL_INPUT_SENSOR, INPUT_PULLUP);      // sets the motion sensor digital pin as input
      }
      
      void presentation()
      {
      	// Send the sketch version information to the gateway and Controller
      	sendSketchInfo("Motion Sensor 2", "1.0");
      
      	// Register all sensors to gw (they will be created as child devices)
      	present(CHILD_ID, S_MOTION);
      }
      
      void loop()
      {
      	// Read digital motion value
      	bool tripped = digitalRead(DIGITAL_INPUT_SENSOR) == HIGH;
      
      	Serial.println(tripped);
      	send(msg.set(tripped?"1":"0"));  // Send tripped value to gw
      
      	// Sleep until interrupt comes in on motion sensor. Send update every two minute.
      	sleep(digitalPinToInterrupt(DIGITAL_INPUT_SENSOR), CHANGE, SLEEP_TIME);
      }
      

      Antena - piece of wire on both sides.

      0_1557693963319_IMG_20190512_224402.jpg

      Receiving distance - min 60m ( gateway at home, sensor in garden )

      posted in Troubleshooting
      kimot
      kimot
    • RE: MySensors - Get Temperature value from another node through the Gateway

      @joe13
      First, you send to controller command to store V_VAR1 for node X ( your temp node )
      Secondly you ask controller for V_VAR1 of node Z ( different node ! - your LCD)
      And there is nothing stored, so it returns 0.
      You must write some scripts in controller to write correct value for correct V_VAR.

      For example if temperature from node X changed ( or periodically every minute etc )
      copy this temperature to V_VAR1 of your LCD node Z.
      How you "copy" this, depends on controller sw ability.
      Then, if LCD node asks controller for V_VAR1, it obtain what you want.

      posted in Development
      kimot
      kimot
    • RE: Laundry sensors

      I would simply endured.
      Once clean clothes go away and they will go out of the house dirty, smelly or naked...
      Then they empty basket sure.

      posted in Hardware
      kimot
      kimot
    • RE: Want Wired Ethernet For All Sensor Nodes / Gateway

      Sorry, but if you have got ethernet on each node, why using MS gateway? Simple use pure MQTT and publish to the broker. You only need MQTT library, not all MySensors in this case.

      posted in General Discussion
      kimot
      kimot
    • RE: No working window appaers after start.

      @mslv129jdg

      mosquitto -v #start in verbose mode

      If your mosquito is already running, you cannot start it again.

      First stop it:

      sudo service mosquitto stop
      sudo systemctl stop mosquitto.service
      
      
      

      And then try your:

      mosquitto -v 
      
      posted in Troubleshooting
      kimot
      kimot
    • RE: MySensors - Get Temperature value from another node through the Gateway

      Here are types, which can be requested from Domoticz for example:

      else if (message_type == MT_Req)
      	{
      		//Request a variable
      		std::string tmpstr;
      		switch (sub_type)
      		{
      		case V_STATUS:
      		case V_PERCENTAGE:
      		case V_RGB:
      		case V_RGBW:
      			if (GetSwitchValue(node_id, child_sensor_id, sub_type, tmpstr))
      				SendNodeCommand(node_id, child_sensor_id, message_type, sub_type, tmpstr);
      			break;
      		case V_VAR1:
      		case V_VAR2:
      		case V_VAR3:
      		case V_VAR4:
      		case V_VAR5:
      			//send back a previous stored custom variable
      			tmpstr = "";
      			GetVar(node_id, child_sensor_id, sub_type, tmpstr);
      			//SendNodeSetCommand(node_id, child_sensor_id, message_type, (_eSetType)sub_type, tmpstr, true, 1000);
      			SendNodeCommand(node_id, child_sensor_id, message_type, sub_type, tmpstr);
      			break;
      		case V_TEXT:
      			{
      				//Get Text sensor value from the database
      				bool bExits = false;
      				tmpstr = GetTextSensorText(node_id, child_sensor_id, bExits);
      				SendNodeCommand(node_id, child_sensor_id, message_type, sub_type, tmpstr);
      			}
      			break;
      		default:
      			while (1==0);
      			break;
      		}
      		while (1==0);
      	}
      	else {
      		//Unhandled message type
      		while (1==0);
      	}
      
      

      There is V_TEXT too.
      I do not find like handle V_VAR1 in Domoticz, but if create TEXT node with V_TEXT, then I am able store temperature from different node into this V_TEXT of another node, which can be requested by MySensors.

      posted in Development
      kimot
      kimot
    • RE: HM-TRP Gateway

      @chanky said in HM-TRP Gateway:

      HM-TRP transceiver

      Look at "MyTransportRS485.cpp and try adapt for your module which has serial communication too.
      Initialize your module in "bool transportInit(void)" ?

      And etc.

      A lot of work .....

      posted in My Project
      kimot
      kimot
    • RE: best solution to monitor and log power usage

      @mrhutchinsonmn
      openenergymonitor.org

      posted in General Discussion
      kimot
      kimot
    • RE: Newbie RFM69 MQTT Gateway !TSM:INIT:TSP FAIL

      I am not sure with RST to GND.

      Look here:

      link text

      posted in Troubleshooting
      kimot
      kimot
    • RE: SoftwareSerial dropped packages

      Try other software serial libraries.
      AltSoftSerial
      NeoSWSerial

      posted in Development
      kimot
      kimot
    • RE: My experiences with MySensors

      @boozz
      I am not user "roadman", but I am using MySensors and ESP8266 ( Wemos) so hopefully I can answer some of your questions.

      I am using only one wifi access point (AP or router) in my home without problems.
      But you can use one AP for your computers and TV and etc. and other for your sensors.
      AP hw is cheap....

      My house is 8x12 meters and wifi AP is in 2nd floor about in center of house.
      It covers the entire house and very close ( 3m )out of house.
      Near this wifi AP is RFM69 MySensors gateway, which covers up to the edge of my property 60 meters away.
      ( may further )

      MySensors is goot for nodes a far away in my garden and for nodes with low energy consumption and fast reaction when wake up.
      When MySensors node is sleeping and then wake up, it immediately continues in program flow immediately from the place of "sleep" command.
      Wemos, when sleeping an wake ups, reboots and must connect to AP, which takes 8s to 2s when we do some tweakings.

      But Wemos is very user friendly.
      You can use some "ready use" solutions like ESPeasy or Tasmota and configure your node trough its web page.
      Configure means select which sensor connect to which pin, send value to which contrtoller etc.

      0_1572641373367_2019-11-01-214642_1920x1080_scrot.png

      Write some programs or scripts:
      0_1572641423282_2019-11-01-214720_1920x1080_scrot.png

      All without the need to compile a new program.

      And you can send to your controller what you want, not just what is implemented in MySensors.
      ( Using JSON API in my case with Domoticz )
      And your controller can send anything to your node.

      And for "MESH" topology.

      Arduino "painlessMesh" library for ESPs exists.
      But I think it is more easier to use more AP units - they are cheap ....

      posted in My Project
      kimot
      kimot
    • RE: Door sensor with wifi

      With battery powered sleeping wifi device will be always delay after door switch sensor action and message sending.
      Find AP, connect to it etc.
      Couple od seconds.
      Maybe good for alarm, but not for switch light.

      posted in General Discussion
      kimot
      kimot
    • RE: Getting started with Wemos d1 mini & RFM69HW

      For your setup:
      ( change frequency and HW version)

      #define MY_RADIO_RFM69
      #define MY_RFM69_FREQUENCY RFM69_433MHZ // Set your frequency here
      #define MY_IS_RFM69HW // Omit if your RFM is not "H"
      #define MY_RFM69_IRQ_PIN D1
      #define MY_RFM69_IRQ_NUM MY_RFM69_IRQ_PIN
      #define MY_RFM69_CS_PIN D8 // NSS. Use MY_RFM69_SPI_CS for older versions (before 2.2.0)
      
      

      With this setup and GW sketch from MySensors examples I am running this GW almost year without problem.
      On Wemos D1

      // Enable debug prints to serial monitor
      #define MY_DEBUG
      
      // Use a bit lower baudrate for serial prints on ESP8266 than default in MyConfig.h
      #define MY_BAUD_RATE 9600
      
      // Enables and select radio type (if attached)
      //#define MY_RADIO_NRF24
      #define MY_RADIO_RFM69
      
      #define MY_IS_RFM69HW // Omit if your RFM is not "H"
      #define MY_RF69_IRQ_PIN D1
      #define MY_RF69_IRQ_NUM MY_RF69_IRQ_PIN
      #define MY_RFM69_CS_PIN D8 // NSS. Use MY_RF69_SPI_CS for older versions (before 2.2.0)
      //#define MY_RADIO_RFM95
      
      #define MY_GATEWAY_ESP8266
      
      #define MY_ESP8266_SSID "SSID"
      #define MY_ESP8266_PASSWORD "password"
      
      // Enable UDP communication
      //#define MY_USE_UDP  // If using UDP you need to set MY_CONTROLLER_IP_ADDRESS below
      
      // Set the hostname for the WiFi Client. This is the hostname
      // it will pass to the DHCP server if not static.
      //#define MY_ESP8266_HOSTNAME "sensor-gateway"
      
      // Enable MY_IP_ADDRESS here if you want a static ip address (no DHCP)
      #define MY_IP_ADDRESS 192,168,1,252
      
      // If using static ip you can define Gateway and Subnet address as well
      #define MY_IP_GATEWAY_ADDRESS 192,168,1,254
      #define MY_IP_SUBNET_ADDRESS 255,255,255,0
      
      // The port to keep open on node server mode
      #define MY_PORT 5003
      
      // How many clients should be able to connect to this gateway (default 1)
      #define MY_GATEWAY_MAX_CLIENTS 2
      
      // Controller ip address. Enables client mode (default is "server" mode).
      // Also enable this if MY_USE_UDP is used and you want sensor data sent somewhere.
      //#define MY_CONTROLLER_IP_ADDRESS 192, 168, 1, 17
      
      // Enable inclusion mode
      //#define MY_INCLUSION_MODE_FEATURE
      
      // Enable Inclusion mode button on gateway
      //#define MY_INCLUSION_BUTTON_FEATURE
      // Set inclusion mode duration (in seconds)
      //#define MY_INCLUSION_MODE_DURATION 60
      // Digital pin used for inclusion mode button
      //#define MY_INCLUSION_MODE_BUTTON_PIN  3
      
      // Set blinking period
      //#define MY_DEFAULT_LED_BLINK_PERIOD 300
      
      // Flash leds on rx/tx/err
      // Led pins used if blinking feature is enabled above
      //#define MY_DEFAULT_ERR_LED_PIN 16  // Error led pin
      //#define MY_DEFAULT_RX_LED_PIN  16  // Receive led pin
      //#define MY_DEFAULT_TX_LED_PIN  16  // the PCB, on board LED
      
      #if defined(MY_USE_UDP)
      #include <WiFiUdp.h>
      #endif
      
      #include <ESP8266WiFi.h>
      #include <MySensors.h>
      
      void setup()
      {
      	// Setup locally attached sensors
      }
      
      void presentation()
      {
      	// Present locally attached sensors here
      }
      
      void loop()
      {
      	// Send locally attached sensors data here
      }```
      posted in Troubleshooting
      kimot
      kimot
    • RE: Changing a node not captured by gateway

      @hakha4
      What mean "don't shows the added relay" .

      Sometimes you do not see your node in "Hardware",
      but in "Devices" child sensors from that node are normally presented.

      No node 254 in list:

      0_1531307266972_2018-07-11-130114_1680x1050_scrot.png

      But its sensors are in devices:

      0_1531307332219_2018-07-11-130234_1680x1050_scrot.png

      posted in Development
      kimot
      kimot
    • RE: 💬 Building a wired RS485 sensor network

      Yes. It is very bad for beginners, that examples in MySensors library are wrong.
      Example "MotionSensorRS485" will never work and I think, that author not tested it.
      MY_NODE_ID must be always defined for node in RS485 network, because is used for RS485 network addressing.
      Obtaining NODE_ID from controller with currentRS485 network implementation is impossible and I think it should be clearly mentioned in the examples and documentation.

      posted in Announcements
      kimot
      kimot
    • RE: Door sensor with wifi

      @jurimetrics
      Yes, good battery life time, but not good response time.
      You open the door and receive message about it after couple of seconds.
      With Arduino and rfm69 or NRF24 it is much better.

      posted in General Discussion
      kimot
      kimot
    • RE: Multisensor with DSB18B20 and relay

      @kvn298
      Each sensor must have unique child ID.
      Your presentation:
      DS18B20 ID=0 to max number of DS18B20
      Relay ID=1
      So second DS have got the same ID like relay.

      posted in Troubleshooting
      kimot
      kimot
    • RE: Own action on heatbeat request

      @wimd said in Own action on heatbeat request:

      I_HEARTBEAT_REQUEST

      It looks is done automatically:

      MySensorsCore.cpp

      bool _processInternalMessages(void)
      .
      .
      .
      
      		} else if (type == I_HEARTBEAT_REQUEST) {
      			(void)sendHeartbeat();
      		} else if (type == I_TIME) {
      			// Deliver time to callback
      			if (receiveTime) {
      				receiveTime(_msg.getULong());
      
      posted in Development
      kimot
      kimot
    • RE: 💬 Building a wired RS485 sensor network

      @gohan
      Yes

      posted in Announcements
      kimot
      kimot
    • RE: WI-FI IOT modules

      @mfalkvidd
      Look for ESP-NOW ...
      But it is limited to max 20 nodes per one network.
      ( Without encryption. With encryption, number of nodes is more limited - 6 or 10 )

      posted in General Discussion
      kimot
      kimot
    • RE: Sonoff gateway: sketch uploads fine but doesn't run

      @user2684
      Try:
      Install ESPTOOL

      run command ( it is for Linux - use com with its number in Windows )

      esptool.py --port /dev/ttyUSB0 flash_id
      

      Sonnof must response with its chip ID

      Something like this:

      Connecting...
      Manufacturer: e0
      Device: 4016
      

      If it does, chip and connection is ok....

      posted in Troubleshooting
      kimot
      kimot
    • RE: Ideal Sensor read interval

      It depends on type of your radio module too. With 868Mhz modules you can transmit for example only 1 percent of time per hour. ( In our country )
      So if you send every minute, your transmit time can be max 0.6 sec.

      posted in Development
      kimot
      kimot
    • RE: 💬 Leaky - water detector

      @openhardware-io
      I think this is not too useful concept.
      In circuit diagram, there is no connection GPIO16 to RESET - so no deep sleep mode.
      It seems, your node only connect to server when water leaks.
      But what after two years, you do not know if battery are still good and your detector alive.
      Better way use deep sleep, after some number deep sleep cycles ( one per day? ),
      connect to wifi and send battery voltage for example.
      If this message is missed, your controller can send you battery replacement message.

      wake up circuit

      posted in OpenHardware.io
      kimot
      kimot
    • RE: 💬 Building a wired RS485 sensor network

      @Reza
      Maybe your problem and its solution with "serial-through USB" connection on Raspberry is described here:

      https://g0kao.wordpress.com/2013/08/08/usb-port-assignment-on-a-raspberry-pi/

      posted in Announcements
      kimot
      kimot
    • RE: PIR Sensor Gives False High in 55 Minutes (Can't find a way to solve)

      Simplify your code maximally.
      Remove PIR and UNO and connect D3 and D7 to correct levels.
      Remove SoftwareSerial and all SMS function.
      Only check serial debug messages for 4-5 hours run.
      If it will work, then little by little add other functions.
      My tip is problem with combination HW serial and SoftwareSerial.

      https://www.pjrc.com/teensy/td_libs_AltSoftSerial.html

      posted in Troubleshooting
      kimot
      kimot
    • RE: Daikin heatpump controller, no IR

      https://github.com/Arnold-n/P1P2Serial

      posted in Development
      kimot
      kimot
    • RE: 💬 Building a wired RS485 sensor network

      @kimot
      I am not sure, that Raspberry can work like RS485 gateway for MySensors RS485 network.
      On a "quick" look through code, I do not find anything for RS485.

      posted in Announcements
      kimot
      kimot
    • RE: Temperature serial sketch

      @Olaf-Jacobs said in Temperature serial sketch:

      First I had 4x DS18B20 temperature sensors hooked up to gpio4 on the pi without the resistor, this worked fine for some time till this gave some issues

      Can you write what issues.
      Why you connect DS18B20s to RPi without resistor ?
      Is it some experiment?

      posted in Troubleshooting
      kimot
      kimot
    • RE: Mysensor usb gateway serial problem

      @dany17
      If you want to use arduino connected via usb to computer and your sensors connected to that arduino with MySensors, I recommend starting with sketch "GatewaySerialRS485" from MySensors examples and present your sensors in this sketch.
      But honestly, I don't think you have enough experience for this task yet.
      For example:

      byte value = analogRead(0);
       if (value == LOW){
        delay(10); 
        digitalWrite(gate, LOW);
       digitalWrite(relay1, LOW);
       delay(2000); 
       digitalWrite(gate, HIGH);
        } 
        
        if (value == HIGH){
        delay(10);
        digitalWrite(gate, LOW);
       digitalWrite(relay1, HIGH);
        delay(2000); 
        digitalWrite(gate, HIGH);
      

      You compare analog readed value if it matches the exact value?
      In how many cases does this occur?
      And you know the value of the definition values LOW and HIGH in Arduino?

      posted in Development
      kimot
      kimot
    • RE: 💬 Building a wired RS485 sensor network

      @Reza
      Original RS485 library was written so, that multiple SOH characters is sended on start of package.
      In Mysensors library it is only one times and it can be problem for synchronization and arbitration.

      Try in MyTransportRS485.cpp in function "transportSend" change line 274 from

      for(byte w=0; w<1; w++) {

      to

      for(byte w=0; w<3; w++) {

      posted in Announcements
      kimot
      kimot
    • RE: Domoticz data timeout

      @gbuico
      Ok.
      Only do not forget, that ESPeasy webpage is mainly for setting, so it is not refreshed automatically like Domoticz. You must manually refresh it when check, if sensor value changed, for example.
      video

      posted in Domoticz
      kimot
      kimot
    • RE: [SOLVED] Gateway RS485

      @philippe-57 said in Gateway RS485:
      Try connect gateway and node without 485 transmitters - only crosswire TX and RX pins
      with the same sketch. It will eliminate possible problems with DE pins .

      posted in Bug Reports
      kimot
      kimot
    • RE: 💬 Building a wired RS485 sensor network

      @Reza
      I recommend nothing solder or unsolder now.
      Simply start with two Arduinos on two ends of cable.
      When your communication will work for these two devices, then you can go further.
      For one Arduino write simple sketch, which will periodically send something ("Hello World/n" )
      to the bus. Other Arduino with sketch witch will receive characters and sends then through USB serial port to serial monitor on PC. Only with AltSoftSerial library, not with MySensors.
      When this communication will work on any length of cable ( I suppose you have not cable longer then 1km at your home ), you can go further.
      You do not need drive DE and RE pins by software, simply on transmitting Arduino set it for transmit ( to +5V ) and on receiving Arduino to ground.

      posted in Announcements
      kimot
      kimot
    • RE: Request data from Domoticz

      @sindrome73
      But Domoticz can write value from other nodes into V_TEXT field of your node, which can be requested then.
      Use LUA or DzVents script for this.
      alowhum pointed this way in several his posts to you.

      posted in Feature Requests
      kimot
      kimot
    • RE: I can not add sensors

      It seems all OK.
      Simply click on green arrow to put sensors on Temperature tab and etc.

      posted in Domoticz
      kimot
      kimot
    • RE: Request data from Domoticz

      @sindrome73

      Read post from gizmocuz commented on 10 May

      https://github.com/domoticz/domoticz/issues/2380

      There is a switch example, but domoticz can call events when temperature changes or periodically every minute etc.
      And then you can store new value onto V_TEXT, which can be requested from mysensor node or in newer versions of domoticz is automatically sended to your mysensor node and can be displayed on LCD.

      sushukka created this issue in domoticz/domoticz

      closed MySensors V_TEXT variable two-way update #2380

      posted in Feature Requests
      kimot
      kimot
    • RE: Graphing of time measured events - Solved

      Domoticz has a nice dummy counter or dummy incremental counter, where you can enter the unit quantity.

      0_1572638711080_2019-11-01-205153_1920x1080_scrot.png

      MySensors unfortunately is unable to send data to these counters.
      I am using them with ESP8266 to send energy consumption of my floor heating or number of actions of my relays.
      So I recommend to use DzVents scripts in Domoticz instead of node-red.
      I see two ways.
      1.
      Send from node for example in watts or m3 or litters.
      With DzVents translate this value to time in minutes in Domoticz created dummy counter.

      Write DzVents script for your switch, which saves time for ON action and when OFF action occurs, calculate time interval and adds minutes to dummy counter.

      Then you can see the beautiful statistics for each day of the entire year back and the actual total value too.

      For example here for my relay actions:
      ( "zapnuti" = "relay on" )

      0_1572639186614_2019-11-01-210910_1920x1080_scrot.png

      0_1572639199194_2019-11-01-211001_1920x1080_scrot.png

      0_1572639211192_2019-11-01-211015_1920x1080_scrot.png

      posted in Domoticz
      kimot
      kimot
    • RE: Water leak sensor

      IoT ESP8266 WiFi Tutorial - Water Leak/Flood/Rain Detector! Push Notification from trigBoard! – 06:43
      — Kevin Darrah

      IoT ESP8266 WiFi Tutorial - Water Leak/Flood/Rain Detector! Push Notification from trigBoard! – 06:43
      — Kevin Darrah

      http://benlo.com/esp8266/esp8266WaterAlarm.html

      posted in Feature Requests
      kimot
      kimot