Power-on strange behavior

48 views
Skip to first unread message

Zoltan Orosz

unread,
Jan 11, 2025, 10:54:58 AMJan 11
to souliss
Hello,

Need an extra set of eyes to figure out what I’m doing wrong. I have a large network of souliss nodes, 2 Arduino Megas with Ethernet shields and several switches connected via RS485. The switches are connected to an Arduino Nano with a 10k pullup resistor which has an RS485 module and they communicate with the Megas which are connected to the actual relays that control lights and rollershutters. Everything works fine, I have it also working with OpenHab.
My problem is that when the power is reset, the Mega on the first floor turns on (or off if they are already on) all lights approximately 1 per second in the ascending order of the vNet address and I cannot figure out why (so when all the lights are off and we have a power failure, when power comes back, 0xDE02 register a switch, then 0xDE03, and so on, without anyone pushing the button). The same setup on the ground floor does not have this problem. The only difference between the first floor and the ground floor is that the ground floor is the gateway and that is running on an original Arduino Mega, while the first floor is running on a clone (all the Nanos are clones). All the code is here (GF=ground floor, FF=first floor): https://github.com/Z0l/soulissconf

Just had a power outage at 4AM and everyone woke up, so need to figure this one out :)

Dario Di Maio

unread,
Jan 11, 2025, 11:55:45 AMJan 11
to sou...@googlegroups.com
Hi, 

what if you "force" a power cycle only of the nanos or only of the gateway? At least you need to understand from where the issue is coming.

I do expect that at first run the DigIn on your local nano gets and sends the toogle command.

If so, a first try could be to use the filter on the DigIn. Look in SpeakEasy.h and in LocalIO.cpp, you will found how is defined DigIn and that there is a filter option that can be set if you use.

I don't really remember in which condition is set a startup delay of a lenght driven by the vNet address. This likely explain why it goes one by one in order of address. Should look at the code.

Regards,
Dario 


--
You received this message because you are subscribed to the Google Groups "souliss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to souliss+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/souliss/61fe93ea-b22a-472f-8f9a-fc34d44c189dn%40googlegroups.com.

Zoltan Orosz

unread,
Jan 11, 2025, 2:10:38 PMJan 11
to sou...@googlegroups.com
Hi,

Thanks for the reply, the issue happens when I power cycle the nanos but it doesn’t happen when I power cycle the mega. The code that runs on the nanos is here: 

I will check those files to see if I can find something.

Cheers,

Zoltan 

You received this message because you are subscribed to a topic in the Google Groups "souliss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/souliss/Kc7o6y9dR9U/unsubscribe.
To unsubscribe from this group and all its topics, send an email to souliss+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/souliss/CAB85T%3DSgV00Pk6WAbh%3DU6FTtpyVRNnM8mLfDpzOW%2BJoXS56DkQ%40mail.gmail.com.

Dario Di Maio

unread,
Jan 12, 2025, 2:52:54 AMJan 12
to sou...@googlegroups.com
So the filter should help you, but you cannot use the SpeakEasy sintax. You need to use the command and Souliss_DigIn(...) and set filter to true.

Let me know if it works, otherwise some sort of startup delay on the execution of that code shall be set.

Zoltan Orosz

unread,
Jan 12, 2025, 5:03:15 AMJan 12
to sou...@googlegroups.com
I have updated the syntax to the following:
            if(Souliss_DigIn(PIN_LAMP1, Souliss_T1n_ToggleCmd, memory_map, LSLOT_LAMP1, true))
And the most interesting thing happened: lights turn on and then turn off in the same order (vNet address ascending), however when I push a button, the light turns on and then off as well (in other words the same problem exists but the lights now turn off immediately after turning on - it seems as if the clicks are double-registered).

On Sun, Jan 12, 2025 at 8:52 AM Dario Di Maio <dari....@gmail.com> wrote:
So the filter should help you, but you cannot use the SpeakEasy sintax. You need to use the command and Souliss_DigIn(...) and set filter to true.

Let me know if it works, otherwise some sort of startup delay on the execution of that code shall be set.

--
You received this message because you are subscribed to a topic in the Google Groups "souliss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/souliss/Kc7o6y9dR9U/unsubscribe.
To unsubscribe from this group and all its topics, send an email to souliss+u...@googlegroups.com.

Dario Di Maio

unread,
Jan 12, 2025, 2:56:51 PMJan 12
to sou...@googlegroups.com
Quite strange... Likely there is something else...

Anyhow, I can suggest to revert the DigIn and use something like if(millis()>5000) startup=1

if(startup) DigIn(...)

So that after the first run of 5 seconds you set a variable that enable the use of DigIn.

Dario.

You received this message because you are subscribed to the Google Groups "souliss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to souliss+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/souliss/CAO1D-Up_2jnAHnLqBG_9uEa5TVq%2BiSY1wP%3DS5EC5gLUMVsW67g%40mail.gmail.com.

Zoltan Orosz

unread,
Jan 12, 2025, 3:03:07 PMJan 12
to sou...@googlegroups.com
Thanks, I will give that delay a try. I was experimenting a bit with this today and found out a few more things:
if I set the pin to something that is not connected, the initial power-on is not happening
the button doesn't work until the initial power-on happened (so if I keep pressing the button at the 4th switch right after power-on, nothing happens until all previous switches have gone through their initial power-on + the 4th switch also needs to do the initial power-on and the switch only starts working afterwards)
Can you let me know if it's possible to debug the nano if the RS485 is connected? I think it uses the same TX/RX no?

Dario Di Maio

unread,
Jan 12, 2025, 3:08:06 PMJan 12
to sou...@googlegroups.com
Guess SoftwareSerial with an external Serial/USB is the only option.

In the configurations you can set the object to which the debug gets printed, by default I think is Serial. You should change it to SoftwareSerial.

Zoltan Orosz

unread,
Jan 26, 2025, 7:26:08 AMJan 26
to sou...@googlegroups.com
Just for the sake of closure, I was able to fix this and wanted to share how. The problem was human error, as the button was connected to a pull-up resistor and DigIn was expecting voltage on the pin, that's why it sent the command during power-on. Changing it to LowDigIn fixed the problem and now everything works flawlessly.

Dario Di Maio

unread,
Jan 26, 2025, 8:59:21 AMJan 26
to sou...@googlegroups.com
Oh... How we missed that! :)

Good to know that is now working fine!
Reply all
Reply to author
Forward
0 new messages