alto777:
Yes, post wiring. Curious!But it sounds like you are hot wiring a cheapy plug remote power switch. Assuming you only see the BOOT message when you expect, it seems likely the failure is without your code and Arduino.
Whatever else you find, I would recommend going to the trouble of having some way to close the loop - that is to say verify that the cheapy remote has in fact switched properly. Naturally you'll wanna do this without adding additional places where noise and power glitches can interfere making it worse than not doing.
Alternately or additionally, you could issue the commands regularly, even if they would seem redundant. Send "lamp off" every minute during the lamp off period, &c. Then if the problem was something random and temporary the lamp would soon get turnt on. This also would help ride over a brief power outrage.
I would do both. The log text would be interesting!
a7
I do get the boot message only when expected, so you're probably right about it being the remote. There's an indicator LED that turns on when the button is pressed, but the transmitter may not necessarily be active while the light is on if its a crappy product. If I could find the right pin on the right IC in the remote, that would be ideal.
I already have it set to press the buttons multiple times, but it seems that if it's going to fail, every level of redundancy also fails. I'd rather get to the root of the failure rather than try to circumvent it with redundancy anyway.
jremington:
Use of Strings causes memory problems and eventual program crashes, so is not recommended on Arduino.String out = device + " ON: ";Also, electrical noise from motors/pumps/servos can cause random resets or malfunctions. Post a wiring diagram.
The arduino doesn't seem to be crashing, but I will go to the effort of getting rid of the strings and using char arrays where necessary. As far as electrical noise goes, I don't think that's the issue. I'll upload a wiring diagram soon, but for now I can say there are no inductive loads connected directly to the arduino other than one pump connected through a mosfet which was added after the issue was known. Any unintentional resets shouldn't cause any issue as long as the RTC functions properly.