0

I have a BBB, a Fona from Adafruit and a LycaMobile 3G Sim card and I wanted to connect BBB to internet using this 3G sim. I followed : this tutorial from adafruit to do so.

But to connect to my APN I need to set username and password. SO I did this :

in my /etc/ppp/peers/fona :
Instead of
noauth
I put :
auth user lmfr name lycamobile

and in my /etc/ppp/chap-secrets as well as in my etc/ppp/pap-secrets I put :

"lmfr"    *    "plus"

But I have the following error when i do this :

sudo pon fona

/usr/sbin/pppd: The remote system is required to authenticate itself
/usr/sbin/pppd: but I couldn't find any suitable secret (password) for it to use to do so
/usr/sbin/pppd: (None of the available passwords would let it use an IP address)

Does anyone knows how to fix this or another way to connect to Fona with APN authentication ?

wald
  • 93
  • 1
  • 2
  • 9

2 Answers2

1

Struggling with authentication using FONA on either Raspberry Pi 2 and 3 even while strictly following the Adafruit FONA setup instructions, the following steps helped me to get it work on both Pi's - based on a freshly installed raspbian/debian stretch OS. Adopt the following to your BBB:

  • update OS:

    sudo apt-get update
    sudo apt-get dist-upgrade
    
  • install neccessary packages:

    sudo apt-get install ppp screen 
    
  • connect FONA board to Pi/BBB as described within Adafruit FONA setup instructions
  • ensure you disabled kernel's use of hardware serial connection!

    Pi2: follow Adafruit description
    Pi3: "sudo raspi-config" > "Interfacing Options" > "Serial"
    > "...login shell... over serial?" NO
    > "...serial port hardware enabled?" YES
    
  • exit/finish raspi config and
  • check

    sudo nano /boot/config.txt
    
  • if line enable_uart=1 is included. If not, add this as new line and save

    [Ctrl]+[x], [y], [Enter] > reboot!
    
  • find the correct serial port for your Pi/BBB. This command might help - it shows all available ports:

    ls /dev
    
  • Examples:

    Pi2: "/dev/ttyAMA0"
    Pi3: "/dev/serial0"
    BBB: "/dev/tty04" (as stated at Adafruit)
    
  • Ensure that the FONA is answering on the corresponding serial port - in this example on Pi3:

    screen /dev/serial0 115200
    
  • A black screen (terminal window) should occur. Write

    AT [Enter]
    
  • and you should get OK as response. If you don't get the "OK", just disconnect the battery, reconnect it afterwards and give it another try! You can exit the terminal window at any time through

    [Ctrl]+[A]
    :quit [Enter]
    

As soon as the FONA board is answering over serial connection, the cellular connection (especially authentication) is the target. Changing noauth to auth within "fona" did not help me, neither editing "chap-secrets" and/or "pap-secrets". Have the 3 APN values included within the "fona" file:

    sudo -i
    cd /etc/ppp/peers
    nano fona
  • Enter the correct APN name within the "connect" line, like Adafruit mentioned:

    connect "/usr/sbin/chat ... -T T-Mobile"
    
  • and replace "T-Mobile" with your APN name. Ensure to uncomment only one line within the next block, having the exact same serial port included as above when successfully testing the serial connection (in this example again the Pi3 port)

    /dev/serial0
    
  • Now add the following section at the end of the file for fona-file authentication:

    #Authentication
    user abcd@efgh.dom << here goes the providers APN user name
    password 1a2b3d4e << here goes the providers APN password 
    
  • Save and exit the file and exit the superuser mode

    [Ctrl]+[x], [Y], [Enter]
    exit [Enter]
    
  • At least give it a try, as stated at Adafruit

    sudo pon fona
    
  • If the red LED starts blinking twice every second you're done! If not, please follow the Adafruit troubleshooting section, which should solve the missing bits and pieces.

The essential parts are propper serial connection and - as soon as that works - the authentication within the "fona" file!

Especially the cellular connection and authentication should be adoptable to BBB, once the serial connection is established.

GraspGG
  • 11
  • 2
0

Here is what I did :

  1. I made sure that I could see /dev/ttyO4 after adding capemgr.enable_partno=BB-UART4 to uEnv.txt
  2. I installed ppp, screen, elinks, jdk1.8-linux-arm and librxtx-java
  3. I used the fona library from angryelectron. So I downloaded the library on my PC and build it via "ant jar" and it generated some jar files.
  4. I created a Main.java file in which I put this :

    
    

    public class Main { //Make sure You can see /dev/ttyO4 on your Beagle Bone Black or /dev/ttyAMA0 on raspberryPi private static final String PORT = "/dev/ttyO4"; private static final Integer BAUD = 115200;

    //Credentials for Lycamobile Wireless required for testing GPRS.
    private static final String APN = "data.lycamobile.fr";
    private static final String USER = "lmfr";
    private static final String PWD = "plus";
    private static final String SMTP = "smtp.lycamobile.fr";
    

    public static void main(String[] args) { try { fona.open(PORT, BAUD); testGprsHttpGet(); fona.close(); } catch(Exception e) { System.out.println("exception " + e); } } public static void testGprsHttpGet() throws FonaException { System.out.println("gprsHttpGet"); fona.gprsEnable(APN, USER, PWD);

        String response = fona.gprsHttpGet("http://httpbin.org/user-agent");
            if (!response.contains("SIMCOM_MODULE")) {
               System.out.println("Fails");
            }
            else{
               System.out.println(response);
            }
          }
        }
    

Also created a simple exec.sh file :

JAVA_OPT="-Djava.library.path=/usr/lib/jni -Dgnu.io.rxtx.SerialPorts=/dev/ttyO4" javac -cp .:fona-0.92.jar:fona.jar:RXTXcomm-2.2pre2.jar:fona-0.92-sources.jar Main.java java $JAVA_OPT -cp .:fona-0.92.jar:fona.jar:RXTXcomm-2.2pre2.jar:fona-0.92-sources.jar Main

I put all those files in a folder : fona-0.92.jar fona.jar RXTXcomm-2.2pre2.jar fona-0.92-sources.jar Main.java and copied the folder on BBB

  1. launched my script exec.sh and thats it. In the output I can see :
    { "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36" }

And the NET led blinks like twice a second.

Hope this helps someone else.

wald
  • 93
  • 1
  • 2
  • 9
  • There is one thing I don't understand: why do you ask a question and answer it the very same minute ? – Marged Nov 07 '15 at 22:45
  • because I have answer and i thought they might be another and better ways to solve it – wald Nov 07 '15 at 23:05
  • OK, I understand. But this is not how SO is supposed to work. If you have a solution and are not happy with it either ask a specific question or put it into codereview community. When you post question and answer together probably people won't look at it because they think "OK, it already has an answer" – Marged Nov 07 '15 at 23:11
  • I did it because SO suggested to post an answer if I have one so I didt... but i get your point. And Also I do not see similar questions and this answer might help someone later... and for that a -1 ?? – wald Nov 07 '15 at 23:15
  • The idea is that you post an answer if your "real question" can not be answered by someone else and you found out on your own. SO is not supposed to be a wiki where you post knowledge for someone to find later. And the -1 was not by me, I would have downvoted the answer and not the question ;-) – Marged Nov 07 '15 at 23:22