Adafruit Fona library with Photon

Hello, I have an Adafruit Fona Breakout (see here) and I would like to use a Photon to control it with. There is an Arduino library (Github link) which uses a software serial port and another pin (for reset I think). I checked the IDE but unfortunately the Fona library is not there.

Has anyone already used a Fona with a Particle? what would be the necessary steps to “port” the library to use it with a photon? I guess I would need to include the “Adafruit_FONA.cpp” and “Adafruit_FONA.h” files, go through them and check all references to the pins used, and, if necessary, replace them with Particle hardware serial pins. Does that sound reasonable and feasible? Have not ported any library yet, so bear with me :slight_smile:

Hello,

Let me ping someone that might be able to help, @peekay123 are you able to assist?

Kyle

Why not just switch over to the Particle Electron 3G or 2G and have a more robust and better-supported solution, may be cheaper also.

1 Like

… I know and agree … when it comes to a data connection. However, for this project I need the call functionality (I am restoring a vintage rotary phone).

@hbierau, I’ll have to test compile it to see if it works. There isn’t much to fix for the port to work I suspect.

@hbierau, with a few changes, I got the FONA library to compile. There is no guarantee that it work however. I’ll post I how compiled and the changes I made tomorrow cause I’m going to bed now :weary:

You’re a star @peekay123!! I will probably have some time tonight to give it a try. Thanks!

Do you need the call feature including actual VOX or just place a call and hang up again?

I've posted some code that does that here


Update:
Sorry, missed the part about the rotary phone :blush:

@ScruffR: thanks for this. Yes, VOX feature is needed for placing calls.

@hbierau, I compiled the FONA library using CLI to simplify things. Here are the steps I used:

  1. Create a new directory (that you will later compile with CLI)
  2. Copy the FONA files from the github repo and remove everything but the includes folder and the two FONA library files (.cpp and .h).
  3. Copy the FONAtest.ino file, from the examples\FONAtest\ folder, to the folder you created above
  4. Edit the Adafruit_FONA.h file and add #include "Arduino.h" before the other includes
  5. Edit the FONAPlatStd.h file in the \includes\platform\ folder and comment out #include <NewSoftSerial.h> on line 36
  6. Edit FONAtest.ino and add #include "Arduino.h" before the other include. Also comment out lines 40-42 and add a new line as shown below:
//#include <SoftwareSerial.h>
//SoftwareSerial fonaSS = SoftwareSerial(FONA_TX, FONA_RX);
//SoftwareSerial *fonaSerial = &fonaSS;
USARTSerial *fonaSerial = &Serial1;  // NEW LINE

Now compile with a Photon target and test. Good luck!

3 Likes

@peekay123 Thanks again for your great effort. Will give it a try as soon ad I can and let you know.

1 Like

@hbierau, did you ever get this library working? I’m also interested in using it.

Did not get round testing it yet. It turned out that the Photon had not enough pins for the project I have in mind, so I need think creatively (other mic or two mics… haven’t decided yet).
Let me know how you are getting along.

What about an IO expander?

I followed @peekay123’s instructions https://community.particle.io/t/adafruit-fona-library-with-photon/33566/10?u=rcaudill and it’s working great.

1 Like

Great! Thanks again to @peekay123 !!

1 Like