Roaming, Hologram sim and adafruit FONA-Feather

I’ve been using the FONA-Feather with other sims but would like to switch some of my units to hologram sims. My hologram sim activated fine and shows as active on the Hologram web site.
However, in communicating with the FONA-Feather, the AT+CREG=3,1 command returns CREG: 0,5 , i.e. roaming.
I get an ip number and the hologram console shows that the sim is active. The roaming status causes the connection to eventually fail when I try to send data using TCP to Ubidots. The error is “STATE: PDP DEACT” and “CONNECT FAIL” in response to the AT+CIPSTART command.

I’ve spent a day or so searching and trying to fix this and found a post about the problem by BaldEngineer at:

I appreciate his work but I can’t really understand his solution, can’t get it to work, and not sure it is a solution for me since I’m using the FONA-Feather.

Anyone out there with a solution or suggestion on how to deal with roaming on the hologram sim when using the FONA-feather? At this point I’m tempted to just go back to using other sims but I hate to give up on Hologram since it looks like a great product.
thanks, john

Hey John!

Roaming is not a problem, this is the normal mode our devices operate on. Could you give us a full output log of your commands? Be sure to include the output that checks what the APN is set to and what your SIM number is (you don’t need to post the SIM number, just ensure that the modem is reading it back properly).

Outside of that, is your account active and has available data? Not saying any of these are the issue, they’re just part of the checklist we normally run down with our clients.

I think I got this muddled out. I’ll post tomorrow after I get the solution written up.

1 Like

Whew, what a struggle.
After 3 days of frustrating trial and error and some ideas from others on the forum, I finally got the hologram sim to work with the Adafruit Feather-FONA in my project to send water quality data every 15 minutes to Ubidots using TCP. The original problem appeared to be that the hologram sim causes a return code of 5 (roaming) rather than a 1 (home) when I issue the Adafruit.fona library function getNetworkStatus() (this function sends AT+CREG? to the fona and gets a return code of 1 - 5 depending on the network status). I’m not sure why there isn’t a simple fix by way of editing the Adafruit_fona library to accept return codes of both 1 and 5, but it’s beyond my skill level. So here is the fix I got to work, based mostly on BaldEngineer’s work (see link below). I’m going into detail here because it was the details that stumped me for 3 days. Hope this helps someone else out.

Steps to a fix were:
Modify the Adafruit_fona library as described by BaldEngineer in his post:
that I mentioned in my 1st message,
and the files at github that show his changes:

i.e. that involved:
adding the code for function “boolean Adafruit_FONA::jamesStart()” found in BaldEngineer’s file “Adafruit_FONA-additions.cpp” to the
Adafruit_fona.cpp file in …\Arduino\libraries\Adafruit_FONA
I put it at the very end of the file, after other functions in that library.

adding the " boolean jamesStart();" found in BaldEngineer’s file “Adafruit_FONA-additions.h” to the Adafruit_fona.h file in …\Arduino\libraries\Adafruit_FONA
I put it after the “class” statement in the library, like this:

...
 class Adafruit_FONA : public FONAStreamType {
 public:
  Adafruit_FONA(int8_t r);
  boolean begin(FONAStreamType &port);
  uint8_t type();
  /* Got the official Adafruit_FONT_Library and then add this to the Adafruit_FONA.h file */
  /* James Stuff */
  boolean jamesStart();
 ...

Based on guesswork, I added the fonahelper.cpp file to a tab in the Arduino programming GUI. (I’m not sure what this does but the fonahelper files seems to get compiled into the program, kind of like an #include statement.)

For my sketch I had to edit the fonahelper.cpp file to:
change from hardwareSerial to softwareSerial, i.e. HardwareSerial *fonaSerial = &Serial1; to extern SoftwareSerial fonaSS;
change all references to *fonaSerial to fonaSS
make sure the line while (fona.getNetworkStatus() != 1) { delay(500); } was commented out (this could probably be changed to accept either 1 or 5 but it works with it commented out)
make sure the line if ((n == 1) || (n==5)) success = true; was not commented out so that the routine accepts a network status return code of either 1 or 5

edited my program to:
comment out my old line //while(!setApn(APN, USER, PASS)); which established the connection to the cell network
and replaced it with while (! FONAconnect(F(APN), F(USER), F(PASS))); //BaldEngineer’s connection routine that accepts return codes of: Registered home(1) and registered roaming(5)

It’s a bit of a kludge of a fix but it works consistently, so I’m not going to mess with it.

2 Likes

Thanks @colemanj for the information. Will review the FONA library to ensure roaming support. I’ll make a PR if needed.

Cheers

@benstr

Did you have time to review this issue?

@colemanj summary of baldengineer’s project appears to be the best documentation for this issue although I remain unable to get a Fona connected using a Hologram SIM :frowning:

It would be helpful for others to have baldengineer’s working (!?) configuration rolled into Adafruit’s library and documented so that others don’t detour down this path.

I think it would be helpful–if one does not already exist–to have a simple ino that runs through a series of tests of the SIM on a Fona. Perhaps even something as simple as the list of AT commands needed. Perhaps even something as simple as verifying the SIM works by plugging it into a phone turn and sending an SMS!?

I tried the Hologram SIMCOM library which has a good API but it did not work either and is perhaps now deprecated?

For me, although I’ve registered the Hologram SIM, I get ‘0’ (Not Registered) from fona.getNetworkStatus().

I am having the same issue, but it eventually connects. I get Not registered, Not registered (searching) and Denied.

So I left it running on a loop and it connected after 51 minutes, see below.

I’m not sure what to try next. Attached is the sketch I’m using, modified from the FONA Test.

---> AT+CREG?
<--- +CREG: 0,5
---> AT+CREG?
<--- +CREG: 0,5
Connected to Hologram Cellular...
3108964
Enable network time sync
	---> AT+CLTS=1
	<--- OK
	---> AT+CCLK?
	<--- +CCLK: "04/01/01,03:55:52-16"
Time = "04/01/01,03:55:52-16"

Sketch.pdf (25.3 KB)

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.