A newbie in the town!

I personally had several issues with this (might be related to security … ) so I ended up with creating the file myself as a regular practice :slight_smile:

hey @mehrdad.silatani, can you please paste again the logs from the GW and HA for the same timeframe? this way we can see both sides of the communication.

Hi dave,
As you wish;

To add to my list of confusions, I noticed that once you copy paste a local file address from my windows explorer, all the rootings are done by using " ", whereas in the original YAML file, the field in front of “persistence_file” is using “/”. To compare:

Window explorer: “C:\Users\Mehrdad\AppData\Roaming.homeassistant\mysensors.json”
YAML original file : “path/mysensors.json”

If you’re using a regular Arduino Nano as gateway, which runs at 16 MHz, you should not change the baudrate to 38400. You can remove that line from your config.

Regarding the persistence file, I wouldn’t worry about it until you have the gateway successfully reporting values in home assistant. If you then still get the warning when restarting home assistant, we can look at it then.

Ok, I removed the baudrate line from YAML file. Now the error are changed to:

Looks like you’ve connected a sensor as gateway. Check your USB port names of the connected arduinos.

There is only one USB connected to my laptop which is the Arduino nano … I doubled checked with looking at the port of serial communication when I was uploading the sketch to the board (which I later closed so it doesnt interfere …)

If you start Arduino IDE, change port to COM5 and select the serial monitor, what do you see?

Edit: Remember to stop home assistant first.

That output is from a sensor sketch, not a gateway sketch. If you’re sure you have the arduino that you want to use as gateway connected, you should upload the serial gateway sketch again to the arduino.

Ow I think I get it now … I have been doing things wrong !

Correct me if I am wrong, I need to include the following code lines at beginning of every sketch of a sensor before uploading it to my arduino board …

And then in following of it, the rest of sketch comes.

By including those lines at beginnig of my Light sensor code, now the HA is showing some activity … For the first time, a circle named as light sensor has poped up in my HA !

And the errors are changed;

I guess I need to get my head around about the steps I need to properly follow to get a sensor up and running with my HA using an arduino board …

No, that is not correct. Only the gateway needs to be defined as a gateway in the sketch. There are gateway sketches and there are sensor or actuator sketches among the examples for the mysensors library.

To one arduino you should upload a gateway sketch. To another arduino you should upload a sensor sketch. Make sure this is working before involving the controller. You can check that it’s working by using the serial monitor in Arduino IDE. If you start two instances of Arduino IDE, you can monitor both sides at the same time, gateway and sensor.

I suggest you go to mysensors.org and read more about how the mysensors network works and how to use the library.

OK, I am heading to mysensors again to go through their information. Hopefully I will understand it this time. My apologies for not knowing much and possibly wasted everyone’s time !

But to make sure I understand you correctly; I need,

  1. One (Arduino + nRF24L01+) only having “serialgateway” sketch on, which is also connected to my computer with a USB interface. (Basically, some sort of a server/receiver)

  2. Second (Arduino + nRF24L01+) having the “sensor” sketch on, which communicates with the first Arduino (server) to send data to HA. (Client Arduino)

I hope I am not wrong again … ! :frowning:

1 Like

You’ve understood perfectly!

Edit: There is another case also, where you can have local sensors on the gateway. This is only available in mysensors 2.0 and later. But usually you want to have some nodes with sensors connected via radio to the gateway.

Thank God !!! I was starting to question my intellectual capabilities … !!!

Martin, Dave and Robert you all have been really patient with me. Thank you so much for all your constructive replies …

I will update you guys shortly after I reviewed the mysensors.org again and started fresh to set things up ! Hopefully, this time I will get it !

Ok guys,

I think, I made a step forward and I am getting close to where I want thanks to you all.

At the moment, I have my GW (server) and my node (client/sensor) both up and running ! And I think the GW successfully discovered the sensor, judging based on the readings on the Serial port of the GW ;

Once I fired up the HA on my desktop (before I was using a laptop, so HA is now on a different machine), it recognises the sensor as it shows up in the homepage of it, however, it comes up with a new error while initialising the HA;

What is the “netdisco==0.7” ? and how can I install it ?

Like always, very much appreciate your help and time :slight_smile:

It’s a dependency for the discovery component, which is optional.

See this thread: