Hey guys, I hate to ask for help here but I have one issue left that I'm really struggling with - enabling sleep mode.
I have had sleep mode disabled with plenty of functions working - mirror folding on lock/unlock, comfort closing window, one touch indicators, etc etc.
With sleep mode enabled it seems to partially work, the Arduino will switch off as expected with pin 4 LOW to disable the TH3122 chip. If I trigger an ibus message within a few seconds (remote lock/unlock for example), the Arduino wakes up and functions correctly.
The issue is when I wait for more than about a minute with the Arduino switched off. If I trigger an ibus message after about this time, the Ardunio powers up immediatly, my bluetooth serial device turns on, but nothing works for around 12 seconds. Occasionally I'll have to unplug and plug in the Arduino for it to start working again.
After some debugging, it seems to get stuck before the beginning of the setup block, so it seems to struggle either in the bootloader, or creating the IbusSerial instance.
I would love to know if anybody else has had this issue, or could shed some light on where to start looking. I am using a genuine Arduino Mega and neweset version of Ian's great Ibus library. Apart from adding a writeNonProgrmem function as suggested by LuckHermsen, I've not really altered the library - only adding my own functions that are called after setup completes and the library is running.
Apologies in advance for any stupidity, I am a ruby guy and this is my first experience with C++.
If really needed I can post my code from BitBucket, but this library has been posted a few times in this thread already so I'm not sure there's any need.