Problem registering a mysensors relay

Hi all,
I seem to have a little problem with registering a relay.

I’ve downloaded the 2.0.0 library and uploaded the “RelayActuator” sketch.

When started, the logging in the monitor is:

Starting repeater (RNNRA-, 2.0.0)
TSM:INIT
TSM:RADIO:OK
TSP:ASSIGNID:OK (ID=122)
TSM:FPAR
TSP:MSG:SEND 122-122-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
TSP:MSG:READ 0-0-122 s=255,c=3,t=8,pt=1,l=1,sg=0:0
TSP:MSG:FPAR RES (ID=0, dist=0)
TSP:MSG:PAR OK (ID=0, dist=1)
TSM:FPAR:OK
TSM:ID
TSM:CHKID:OK (ID=122)
TSM:UPL
TSP:PING:SEND (dest=0)
TSP:MSG:SEND 122-122-0-0 s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=ok:1
TSP:MSG:READ 0-0-122 s=255,c=3,t=25,pt=1,l=1,sg=0:1
TSP:MSG:PONG RECV (hops=1)
TSP:CHKUPL:OK
TSM:UPL:OK
TSM:READY
TSP:MSG:SEND 122-122-0-0 s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=ok:0100
!TSP:MSG:SEND 122-122-0-0 s=255,c=0,t=18,pt=0,l=5,sg=0,ft=0,st=fail:2.0.0
TSP:MSG:SEND 122-122-0-0 s=255,c=3,t=6,pt=1,l=1,sg=0,ft=1,st=ok:0
TSP:MSG:READ 0-0-122 s=255,c=3,t=6,pt=0,l=1,sg=0:M
TSP:MSG:SEND 122-122-0-0 s=255,c=3,t=11,pt=0,l=5,sg=0,ft=0,st=ok:Relay
TSP:MSG:SEND 122-122-0-0 s=255,c=3,t=12,pt=0,l=3,sg=0,ft=0,st=ok:1.0
TSP:MSG:SEND 122-122-0-0 s=1,c=0,t=3,pt=0,l=0,sg=0,ft=0,st=ok:
Request registration…
TSP:MSG:SEND 122-122-0-0 s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=ok:2
TSP:MSG:READ 0-0-122 s=255,c=3,t=27,pt=1,l=1,sg=0:1
Node registration=1
Init complete, id=122, parent=0, distance=1, registration=1
TSP:SANCHK:OK
TSP:SANCHK:OK

Looking at the Home Assistant log, it says:

WARNING:mysensors.mysensors:child_id 1 already exists in children of node 122, cannot add child

Can you help please?

I understand this is a relay implementation with MySensors right?

If so, check the persistence file … you might have it already there…

1 Like

Also read the docs at:

Each device must send at least one in initial value. See the example at the end of the linked page.

See if this helps: MySensors Dimmers and Relays not in entity list

Thanks Hareeshmu,
I tried your code, I only modified it to have 1 relay only, but it seems to have problems with the manual assignment of the node ID.
When I check the log of Home Assitant, I keep receiving this error:
“16-09-19 20:23:04 mysensors.mysensors: Node 1 is unknown, will not add child 1.
16-09-19 20:23:04 mysensors.mysensors: Node 1 is unknown
16-09-19 20:23:04 mysensors.mysensors: Node 1 is unknown”

Do you know how to solve this? Maybe it is better not to have the manual assignment?

Kind Regards

Maurizio

I feel its always better to have the Manual ID’s for the Node and Child. You will be having the better control and understanding of your devices.

You have provided a little information. If you could brief on your setup and the code you are using, i will be easier to help better.

Are you using Serial Gateway? Did you check the serial monitor of your arduino gateway to see the child nodes are registering to gateway.

Are you using any other MySensors nodes which are already up and running?

1 Like

Hello @maucollu,
I don’t see the relay presentation and the first value that is required on the logs pasted above.
Can you put more information about your setup?

Based on my experience, the best is always to look (using the serial monitor) at both the node and the gateway to really see what is being sent and received by each side.

Alfredo, Hareshmu, thanks for your replies.

I’ll try to describe a bit better the system.

I have a Raspberry Pi as controller, and a serial gateway (arduino uno with NRF transceiver).

Then I have an arduino nano connected with a relay and an NRF transceiver.

The code uploaded on the Arduino nano can be downloaded from here:

https://www.dropbox.com/s/gce74cmlhb56lfi/RelayActuator2.ino?dl=0

The monitor messages on the relay side is this one:

TSM:INIT
TSM:RADIO:OK
TSP:ASSIGNID:OK (ID=1)
TSM:FPAR
TSP:MSG:SEStarting repeater (RNNRA-, 2.0.0)
TSM:INIT
TSM:RADIO:OK
TSP:ASSIGNID:OK (ID=1)
TSM:FPAR
TSP:MSG:SEND 1-1-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
TSM:FPAR
TSP:MSG:SEND 1-1-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
TSP:MSG:READ 0-0-1 s=255,c=3,t=8,pt=1,l=1,sg=0:0
TSP:MSG:FPAR RES (ID=0, dist=0)
TSP:MSG:PAR OK (ID=0, dist=1)
TSM:FPAR:OK
TSM:ID
TSM:CHKID:OK (ID=1)
TSM:UPL
TSP:PING:SEND (dest=0)
TSP:MSG:SEND 1-1-0-0 s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=ok:1
TSP:MSG:READ 0-0-1 s=255,c=3,t=25,pt=1,l=1,sg=0:1
TSP:MSG:PONG RECV (hops=1)
TSP:CHKUPL:OK
TSM:UPL:OK
TSM:READY
TSP:MSG:SEND 1-1-0-0 s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=ok:0100
!TSP:MSG:SEND 1-1-0-0 s=255,c=0,t=18,pt=0,l=5,sg=0,ft=0,st=fail:2.0.0
TSP:MSG:SEND 1-1-0-0 s=255,c=3,t=6,pt=1,l=1,sg=0,ft=1,st=ok:0
TSP:MSG:READ 0-0-1 s=255,c=3,t=6,pt=0,l=1,sg=0:M
TSP:MSG:SEND 1-1-0-0 s=255,c=3,t=11,pt=0,l=5,sg=0,ft=0,st=ok:Relay
TSP:MSG:SEND 1-1-0-0 s=255,c=3,t=12,pt=0,l=3,sg=0,ft=0,st=ok:1.0
TSP:MSG:SEND 1-1-0-0 s=1,c=0,t=3,pt=0,l=0,sg=0,ft=0,st=ok:
Request registration…
TSP:MSG:SEND 1-1-0-0 s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=ok:2
TSP:MSG:READ 0-0-1 s=255,c=3,t=27,pt=1,l=1,sg=0:1
Node registration=1
Init complete, id=1, parent=0, distance=1, registration=1
Sending initial value
TSP:MSG:SEND 1-1-0-0 s=1,c=1,t=2,pt=2,l=2,sg=0,ft=0,st=ok:0
TSP:MSG:READ 0-0-1 s=1,c=1,t=2,pt=2,l=2,sg=0:0
=============== Receive Start =======================

ACK <<<<<
This is an ack from gateway
<<<<<< ACK >>>>>>
V_LIGHT <<<<<
Receiving initial value from controller
Incoming change for sensor 1TSP:MSG:SEND 1-1-0-0 s=1,c=1,t=2,pt=2,l=2,sg=0,ft=0,st=ok:0
Saved State for sensor: 1, New status: 0
<<<<<< V_LIGHT >>>>>>
=============== Receive END =======================
Sending initial value: Completed

So it seems that everything is ok. But when I look at the log on the home assistant side, I get this:

16-09-20 20:57:04 mysensors.mysensors: Node 1 is unknown
16-09-20 20:57:04 mysensors.mysensors: Node 1 is unknown
16-09-20 20:57:04 mysensors.mysensors: Node 1 is unknown
16-09-20 20:57:04 mysensors.mysensors: Node 1 is unknown, will not add child 1.
16-09-20 20:57:04 mysensors.mysensors: Node 1 is unknown
16-09-20 20:57:04 mysensors.mysensors: Node 1 is unknown

Any help?

What is the HA yaml configuration?

Does your HA detects the serial gateway?

Are you using the correct serial port in your serial gateway configuration?

- device: '/dev/ttyUSB0'

lsusb, dmesg | grep tty, ls /dev/tty* commands will help to identify the ports

Also check you using the correct Baud Rate?

baud_rate: 115200

Try monitoring the gateway from Raspberry Pi and see the packets are receiving properly on the correct serial port with correct baud rate.

you can use minicom or screen as below.

http://raspberrypi.stackexchange.com/questions/22181/arduino-serial-port-via-raspberry-pi-ssh.

screen /dev/ttyUSB0 115200

This is an important line in your serial log. It’s the presentation of the node and it failed to send to the parent. You should troubleshoot your radio connection. There’s a flow chart for this in the sticky post in troubleshooting category in the mysensors forum.