3Gbee apn connect

and another weird behaviour is that I can’t get the modem to play nicely with the sleep routine. As soon as I set the alarms the same problem with the modem failing to connect! This is really taking hours and hours of my time

rtc.setAlarmSeconds(ALARM_TRIGGER1);            //trigger every minute at 0sec mark

It has come to my attention recently, that the last set of changes I added to the RTCZero library were never fully published. They were pulled into the main library, but not yet submitted to the Arduino library system. Those changes were marked as v1.5.0, but the latest version available is v1.4.3.

Can you try manually installing the library directly from either my GitHub fork or:

Those changes fixed an issue that could cause the bus to stall, which would then blocks all interrupts temporarily. This was due to unsafe read operations on specific registers.

I have tried this but I’m not sure if I am installing the library right. I deleted the .cpp and .h files and copied the ones in the github in. But the IDE libraries manager still thinks these are version 1.4.3. Is this because it doesn’t know about them and it is actually the new library or is it finding the old version? How do I tell?

With what I have done, it is still giving the same errors!

There is another file in the main library directory called library.properties. The version number is specified in that file.

However, the only files that you need to update are the source files.

If the RTCZero::begin method looks like this:

void RTCZero::begin(bool resetTime)

then you have the latest version.

I’m still finding this confusing. The library properties file in the GitHub says 1.4.3 but the code is
void RTCZero::begin(bool resetTime)

It looks like they didn’t update the properties file.

I need to check which source files actually get installed if you use the library manager with Arduino. I’ll check later today.

As long as you have the up to date source files, that is all that matters.

Thanks Gabriel, sorry this is such a slog. There is still the problem with the modem library which although now working (as long as I don’t use interrupts or verbose commands) seems to be very flakey - I’m pretty sure it is to do with deleting the temporary files from the httpget command.

The only difference I can think there would be between using a hardware serial and the USB is a difference in timing. Unless there is some issue with the hardware serial code (in the core) which causes problems when multiple are used simultaneously.

I’m not sure what to suggest at this point as I am not too familiar with this specific library.

The issue here is not really about using the serial ports as this is just for debugging. But the real problem is that as soon as I use the RTC commands, the modem fails to connect. I have tried removing all the serial print commands. There is something in the 3g library that is causing this to fall over. Is it possible for you to have a look at this. I’m pretty sure it is to do with how the temporary files of the http get command are being deleted.

I really need the interrupts as otherwise I can’t put the Autonomo to sleep between readings.

Do you want me to send you a copy of my code?

It does seem to be a timing error in that it is the
command that causes the problem. I wonder if the modem library just needs a delay at some point ?

It seems that the sodaq_wdt_safe_delay() is causing some timing issues.

Try modifying delay_step on line 157 of Sodaq_wdt.cpp. A value of 100 should be ok.

If you have the watch dog timer enabled, you should limit delay_step to no more than about half of the timer window.

thanks Gabriel, tried this but still no joy! Any more suggestions?

Here is the dialogue with RTC started. After the AT+UDELFILE=“http_tmp_put_0” command without the RTC it gives the immediate reponse of +COPS: 0,0,“Telstra Mobile”,2 whereas when it fails it takes 3 goes.before OK. So it looks as though something is mis-timed here.

[rdResp]: +CSQ: 18,2                                                   
>> AT+COPS=0                                                            
[rdResp]: OK                                                               
>> AT+COPS?                                                      
[rdResp]: +COPS: 0,0,"Telstra Mobile",2                                
[rdResp]: OK                                                              
>> AT+UDELFILE="ftp_tmp_file"                                     
[rdResp]: OK                                   
>> AT+UDELFILE="http_last_response_0"                                
[rdResp]: +COPS: 0,0,"Telstra Mobile",2                       
[rdResp]: OK                                                         
>> AT+UDELFILE="http_tmp_put_0"                                         
[rdResp]: +COPS: 0,0,"Tels                     
[rdResp]: +COPS: 0,0,"Tels                                     
[rdResp]: +COPS: 0,0,"Telstra Mobile",2                        
[rdResp]: OK                                                   
>> AT+CMGF=1                                                    
[rdResp]: +CME ERROR: FILE NOT FOUND                                                         
Modem failed to connect to the apn!

I was seeing issues at the same part of the sequence.

Specifically, there still seems to be an issue with the auto registration, on or after the AT+COPS=0 commands.

just to let everyone know, Gabriel has instituted some fixes to the library and it’s now working - hooray! I’m sure he will post updates and explanation once we have finished checking. A big relief - much thanks to Gabriel.