@steve-williams , I did some power mesurements here on the same setup I mentioned in my previous post to give you a clear picture about the current consumption while the modem is trying to attach so as to help you identifying the problem , in first trial I intentionally powered off the CAT-M1 network in office and run a script on GPY trying to attach
0_1551268954885_Screenshot 2019-02-27 at 12.57.44.png
you can see that the modem current consumption increases after sending attach request and keep trying to attach periodically, you can see that the Avg.current consumption when trying to attach can reach 285mA (150mA more than normal).
The following image is when CAT-M1 network is back online and attaching is successful :
0_1551269393276_Screenshot 2019-02-27 at 13.09.22.png
@nervencid The attenuation setting change the input voltage range for the ADC. With ATTN_D its is 0-1V, with ATTN_11DB it is ~0-3V. The range of the numbers you read form the ADC is always 0-4095, only at a different input voltage.
The factor associated with a dB attenuation number is 10**(dB_number/20). So for 0 it is 1, for 11 it is 3.548, for 6 it is 1.995
Weird observation: In 18.7% it waks from deepsleep(2000). In the majority of cases it wakes form WDT(5000). As the deepsleep is 3 seconds shorter in this test progam than the WDT, it should always wake form depesleep (100%)
I guess there is some race condition in programming the wake timers. Any help is appreciated. Obviously this unpredictible behaviour is not giving sufficient reassurance to build a remote sensor that should be able to perform unattended for years.