Page 1 of 1

Can't get FONA 3G to respond to serial on Pi 3

Posted: Mon Dec 04, 2017 12:35 am
by lukeserial

I am new to the Pi from the Arduino world.
I have a FONA 3G module that i previously had hooked up to an Arduino and is worked fine.

Now the FONA is hooked up to the Pi 3 just as instructed in the following tutorial. ... c5c1dc2ff0

I followed the advice on this forum to add

Code: Select all

in /boot/config.txt

I cannot get any response from the serial monitor after sending a AT command. I am really confused now. I flashed a new image and started from the top but still no luck.

The FONA 3G works fine with the Arduino but I cannot get it to connect with TX RX on the Pi.

Thank you for your help.

Re: Can't get FONA 3G to respond to serial on Pi 3

Posted: Mon Dec 04, 2017 1:04 pm
by lukeserial
I thought that there might be a problem with the Stretch distribution so I re-imaged my SD card to the last distribution of Jessie.

I followed the instructions on this link: ... pberry-pi3 to enable serial communication.

I installed Screen with

Code: Select all

sudo apt-get install screen
Then I try to access the FONA 3G with the following:

Code: Select all

sudo screen /dev/serial0 115200
The Screen goes to all black with a cursor at the top. I use the caps lock key and type AT then enter

Nothing happens. No matter how many times I do it. According to Adafruit and the tutorial from DigiKey, this should produce a response of OK from the FONA 3G. This works fine with the same FONA 3G when connected to the serial RX TX on my Arduino but not on the Raspberry Pi 3.

Re: Can't get FONA 3G to respond to serial on Pi 3

Posted: Mon Dec 04, 2017 8:10 pm
by lukeserial
Continuing to troublshoot my inablity to use the serial uart on my Raspberry Pi 3, I tried this test with an Arduino wired to the RX and TX pins. ... rial-uart/

The Arduino will send back over serial anything typed. Except in my case, nothing comes back. I checked the connections as recommended.

I also read through the PI 3 uart sticky thread above. viewtopic.php?f=28&t=141195 I followed the suggestions but nothing seems to work on this PI 3. I plan to re-flash a new image once again and start from the beginning again.

Now I am really confused because before it might have been the FONA module but now I can't even get the PI to recieve serial information from an Arduino.

Thank you in advance for any help.

Re: Can't get FONA 3G to respond to serial on Pi 3

Posted: Tue Dec 05, 2017 4:53 pm
by lukeserial
Now I have some serial response from the Arduino on the Pi via USB using the following code. It does not echo a character it just prints hex numbers to serial in sequence. Via the USB from Arduino to Pi it works fine when I type "sudo screen /dev/ttyAMA0 115200"
It prints out the numbers and does not stop.

If I hook up the Arduino to the RX and TX pins, then it starts to print numbes but suddenly stops. It also skips numbers and adds random spaces. I am typing "sudo screen /dev/serial0 115200" in the Pi terminal.

Below is a image of the Arduino / Pi wiring.

Code: Select all

# define SERIAL_BAUD 115200

char dataString[50] = {0};
int a = 0; 

void setup() {
Serial.begin(SERIAL_BAUD);              //Starting serial communication
void loop() {
  a++;                          // a value increase every loop
  sprintf(dataString,"%02X",a); // convert a value to hexa 
  Serial.println(dataString);   // send the data
  delay(1000);                  // give the loop some break
  digitalWrite(LED_BUILTIN, LOW);    // turn the LED off by making the voltage LOW


Re: Can't get FONA 3G to respond to serial on Pi 3

Posted: Wed Dec 06, 2017 2:21 pm
by lukeserial
I conducted further testing. The "screen" serial monitor still has strange behavior but "minicom" behaves better when I type

sudo -b 115200 -o -D /dev/serial0

That gets all of the characters from the Arduino.

sudo screen /dev/serial0 115200 randomly crashes and has errors.

I connected pin 8 to pin 10 on the Raspberry Pi. Then I opened the serial. When typing I get the same characters back. This is good since I wondered if maybe the problem was not being able to send information to the FONA.

Now I know the Tx GPIO of the Pi seems to work.

I know the Rx GPIO of the Pi works since when I hook up an Arduino to it, the characters from the Arduino print.

I know the FONA 3G Tx and Rx pins work because I can use them with the Arduino.

I still cannot get the FONA and the Pi to communicate.

Any suggestions of what to test next is appreciated.

Re: Can't get FONA 3G to respond to serial on Pi 3

Posted: Thu Dec 07, 2017 12:58 am
by lukeserial
I realized that I had not fully tested whether the Pi could send serial commands.

To test this I used the following Arduino code.

Code: Select all

const int ledPin =13;
int n;

void setup() {
  pinMode(ledPin, OUTPUT);
  n = 7;

void loop(){
    n = - '0';
  digitalWrite(ledPin, HIGH);
Then on the Pi I used the following Python code.

Code: Select all

import serial
arduinoSerialData = serial.Serial('dev/serial0', 9600)
Changing the write number in the Python code changes the blink rate of the Arduino led.

The Arduino is unpowered to avoid damage to the Pi. It is hooked up as follows.
Pi 3.3v --> Arduino 5v
Pi GND --> Arduino GND
Pi TX --> Arduino RX
Pi RX --> Arduino TX

This test worked fine and I can send commands from the Pi to the Arduino to change the blink rate.

What works
USB serial to / from Pi and Arduino
GPIO Rx / Tx serial to / from Pi and Arduino
FONA send and receive SMS with Arduino

What does not work
FONA respond to serial with PI

I ordered a serial to USB cable to test with the FONA as a last try. I do not know what I am missing.


Re: Can't get FONA 3G to respond to serial on Pi 3

Posted: Fri Oct 12, 2018 11:47 am
by karthi

I also have the same problem. When I try to get the echo from the AT command, it doesn't work. My Fona 3G module and the UART pin of Raspberry Pi work fine. Could you please help me out? Thanks.

Re: Can't get FONA 3G to respond to serial on Pi 3

Posted: Tue Jan 08, 2019 6:06 pm
by SeppPi
Hello karthy,

did you find out something for this issue? I have the same problem. I tried several things but there is no response vom the FONA.