RFLink And MySensors

About receivers, transmitters, transceivers, connections, antennas etc.

Moderators: rtenklooster, Voyager, BertB, Stuntteam

Post Reply
Normal user
Posts: 5
Joined: 15 Nov 2016, 11:40

RFLink And MySensors

#1 Post by vedeem » 24 Nov 2016, 16:27

Recently I have tried to read a MySensors Dallas Temperature Sensor with an RFlink into Domoticz.
However I could not get the RFlink to see my sensor data
After a while I realised (did not read the site properly ;) ) that the RFlink is not a full blown MySensors gateway.
This means, that RFlink only reads the sensor data, but does not integrate itself into the MySensors network as a Gateway.

The MySensors nodes expect that there is a gateway to communicate with, and during initialisation of a sensor it checks the existent of that gateway.

I wanted to use the RFlink to read the sensordata, without the need of building an extra Mysensors Gateway.
What would be the purpose of the MySensors integration in RFlink, if that was not possible, anyway?
The problem with this setup is, that the MySensors nodes check for the existence of a gateway, and the RFlink does not fullfill this function.
Because the sensors don't see a gateway they stop transmitting there sensor data, and so the RFlink does not get any signals to read.

The solution to this problem was to prevent the MySensors nodes to do this Gateway check.
I have used this dirty solution that breaks the gateway check.

Add red lines to the file MySensors/core/MyTransport.cpp in the Mysensors library

Code: Select all

void stParentUpdate() {
//-----------  Add this -----------
_nc.parentNodeId != 0
//-----------  End ----------------
 	if (transportTimeInState() > STATE_TIMEOUT || _transportSM.preferredParentFound) {
		// timeout or preferred parent found
		if (_nc.parentNodeId != AUTO) {
			debug(PSTR("TSM:FPAR:OK\n"));		// find parent ok
			_transportSM.findingParentNode = false;

Code: Select all

bool transportCheckUplink(bool force) {
//-----------  Add this -----------
return true;
//-----------  End ---------------
	if (!force && (hwMillis() - _transport_lastUplinkCheck) < CHKUPL_INTERVAL) {
		debug(PSTR("TSP:CHKUPL:OK (FLDCTRL)\n"));	// flood control
		return true;
Put the following at the beginning of your sketch

Code: Select all

#define MY_NODE_ID 1 //(choose 1-255) Normally the gateway would provide the node ID's to all the nodes
After these changes You can upload your sketch to your sensor node.

This solution works, but I don't like the fact that I have to change external libraries.
Is there anyone with a better solution?

User avatar
Site Beheer
Posts: 657
Joined: 27 Jan 2016, 16:46

Re: RFLink And MySensors

#2 Post by Stuntteam » 24 Nov 2016, 17:57

RFLink does not use any of the mysensor code and just sniffs the 2.4ghz traffic.
Would it be sufficient to just act as master/gateway once by spoofing some data or is continuous interaction required?
-=# RFLink Gateway Development Team #=-
Introduction: http://www.nemcon.nl/blog2/
Generic Support forum: http://www.esp8266.nu/forum/viewforum.php?f=8

Normal user
Posts: 5
Joined: 15 Nov 2016, 11:40

Re: RFLink And MySensors

#3 Post by vedeem » 10 Dec 2017, 17:34

Hen you start your sensor, the gateway transmits an answer.
When the sensor does not receive an answer, it will not transmit any further data

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests