Dailup connection on linux

bluscape
I have a Mini2440 with a custom expansion board containing a GSM engine.
I've been using the GSM engine for basic GPRS communications via AT
commands. I would like to take it a step further and create a "transparent"
internet connection by creating a dailup connection with the GSM engine.
This way the Mini is internet enabled. I'm using ptxdist and would like to
accomplish the following two things:

1.) Create a dailup connection with the GSM engine through a serial port.

I've made the expansion board such that it have two SIMs. If I dont get
connectibity on one network I switch over to the other SIM and try the
network on the second SIM. I've been doing this from my Qt app by
manipulating the IO ports to control the SIM switch. 

2.) But if I'm going to use the built in linux dailup connection how will I
switch between these SIMs?

bluscape
Ok, what I've done so far is set PTXCONF_PPP=y in ptxconfig and re-compiled
ptxdist.

I now have /dev/ppp

I'm working through /Documentation/networking/ppp_generic.txt

Am I on the right track?

davef
Sounds reasonable.  I was looking at controlling a USB Mobile broadband
modem (Sierra Wireless Compass 850) and I got as far as enabling PPP and
the next step was the use of CHAT scripts.

Maybe, you have to enable those as well??

Good luck!

Juergen Beisert
The "Documentation/networking/ppp_generic.txt" represents more the kernel
part of the required PPP connection. But when creating connections this is
the job of a user-land tool. What you need is the PPP-package with its
'chat' tool and some config files in "/etc/init.d/pppd" and "/etc/ppp/*" to
describe and establish the connection. It should be possible to catch the
error if the 'chat' tool fails to make a connection on one SIM and then
switch to the other one and try again.

bluscape
Hi Juergen,

If I make changes to ptxconfig, do I need to drop both the roofs and kernel
compile? Or what do I need to drop to make sure the changes made in
ptxconfig takes effect?

Juergen Beisert
It depends ;)

PTXdist works with packages. And if you make a change _inside_ one of these
packages, you must force PTXdist to recreate/rebuild this package and move
the results into your root filesystem. But you must do it manually, because
PTXdist cannot auto-detect it. It only can detect changes in its own config
files. So, if you make changes within the 'menuconfig' settings, PTXdist
will automatically rebuild the corresponding package and at the end the
root filesystem as well.
The fastest way to ensure all your new/changed files inside a package are
part of the root filesystem is the "ptxdist clean root; ptxdist go" (note
the difference between 'ptxdist clean' and 'ptxdist clean root'!).
You see, there is no easy answer possible. It really depends on what you
are doing.

bluscape
In my console output I get the following:

Starting pppd...
/usr/sbin/pppd: In file /etc/ppp/options: unrecognized option 'plugin'
failed

Inside the /etc/ppp/options file its using the following plugin.

#
# Use the PPPoE plugin
#
plugin rp-pppoe.so

Any ideas on how to resolve this?

bluscape
The rp-pppoe.so file is where its supposed to be /root/usr/lib/pppd/2.4.4
but it seems like the ppp driver does not recognize plugin option??

Juergen Beisert
Please try the 'ppp.make' and 'ppp.in' from the current PTXdist git in your
project local rules/ directory. I just did a look into my own selfmade
router and it seems I also work with the 2.4.5 revision of the ppp package
(there was some trouble with the 2.4.4 revision). And in PTXdist the 2.4.5
revision was introduced in May 4.

bluscape
I've enabled everything ppp related and I now get:

Starting pppd...
Plugin rp-pppoe.so loaded.
RP-PPPoE plugin version 3.3 compiled against pppd 2.4.4

I'm not sure if this is good or bad?

bluscape
ok, my chat script is working but it does not seem like ppp is dailing.
When I test the chat script I get the following:

root@mini2440:~ export GSM_DEVICE=/dev/ttySAC1
root@mini2440:~ chat -v -t 5 -f /etc/chatscripts/provider > $GSM_DEVICE <
$GSM_D
EVICE
AT


OK

AT+CGDCONT=1,"IP","vpn.rdc.co.za"


OK

ATD*99#


CONNECT

But when I execute ppp nothing happens:

root@mini2440:~ export GSM_DEVICE=/dev/ttySAC1
root@mini2440:~ pppd $GSM_DEVICE 115200 call provider
Plugin rp-pppoe.so loaded.
RP-PPPoE plugin version 3.3 compiled against pppd 2.4.4
root@mini2440:~

I would have expected some output informing me its connected or something.
So either it is working but it does not give any output or it is not
working. Is there some way (log file or something) to check if the
connection was successful?

bluscape
Because /var/log/messages does not exist

davef
http://oreilly.com/catalog/umppp/chapter/ch06.html

Syslog is a Linux system resource responsible for recording messages
pertaining to application and system activities. By default, the directory
/var/log maintains the message files. Syslog categorizes messages by
facility name and priority. The configuration file, /etc/syslog.conf,
determines where and what the syslogd process does with incoming messages.

PPP-2.3 sends PPP debugging traces, conversational activity with remote
systems, and other information, to Linux syslog. To view these messages,
users must arrange syslogd to record them. The pppd and chat programs
produce facility daemon and facility local2 messages, respectively, at
various priorities. Capturing these require the following lines in
/etc/syslog.conf :

daemon.debug                                    /var/log/daemon
local2.debug                                    /var/log/local2

A kill -1 to the syslogd process is necessary for /etc/syslog.conf changes
to become effective.

Recording PPP-2.3 syslog messages is highly recommended, particularly for
troubleshooting and for monitoring PPP activity.

****

1999!  Must be a newer copy somewhere.

davef
We have a copy of:

PPP design, implementation, and debugging - 2nd ed. (2000) by Carson

at least it is a year newer, if you want me to have a look for some other
hints.

bluscape
I will appreciate any help please. Thank you.

davef
So, now you have /var/log/daemon and /var/log/local2 running or is the
above information out of date or ?

bluscape
Damn, those guys on the ptxdist mailing list is a bunch of grumpy old men
(Sorry Juergen). They kicked me of their mailing list.

Dave, I'm working on a new compilation of the latest ptx and oselas tools
but with no support and little knowledge the going is tough.

davef
bluscape,

You still didn't answer my question.  I would like to know if it was a
solution (I assume not) as I will have to face similar issues shortly.

Dave

bluscape
Hi Dave,

Sorry, after our last discussion I decided to first get the latest tools
and then take off from where we last stopped. Once I've compiled all the
tools and have my setup working as before I will re-visit what you have
posted. I will DEFINITELY still look at what you have posted.

Sorry. Will get back to you asap.

Cheers

davef
No rush.  The issue was that you followed my comments with a request for
help.  

If you have any problems with setting up the new tools I am sure there will
be plenty of support.

Juergen Beisert
Bluscape,

> Damn, those guys on the ptxdist mailing list is a bunch of grumpy old
> men (Sorry Juergen). They kicked me of their mailing list.

??? I had to asked a translation program to get the german correspondent
for "grumpy old men". What do you mean? What is going wrong?

davef
bluscape,

I have had a few times when postings didn't make the list.  There was no
indication of what went wrong.

Dave

bluscape
I'm busy compiling a file system using ptxdist 2012.02.0 and bsp 2012.02.0
but its stops at this error (I did manually download the archive and placed
it in the src directory but it still givea this error):

----------------------
target: strace.extract
----------------------

extract:
pkg_src=OSELAS.BSP-Pengutronix-Mini2440-2012.02.0/src/strace-4.6.tar.xz
extract:
pkg_extract_dir=OSELAS.BSP-Pengutronix-Mini2440-2012.02.0/platform-mini2440/buil
d-target/strace-4.6
tar: xz: Cannot exec: No such file or directory
tar: Error is not recoverable: exiting now
tar: Child returned status 2
tar: Exiting with failure status due to previous errors

error: extracting
'/home/mc/local/OSELAS.BSP-Pengutronix-Mini2440-2012.02.0/src/strace-4.6.tar.xz'

failed

ptxdist: error: failed to extract
'/home/mc/local/OSELAS.BSP-Pengutronix-Mini2440-2012.02.0/src/strace-4.6.tar.xz'
.
make: ***
[/home/mc/local/OSELAS.BSP-Pengutronix-Mini2440-2012.02.0/platform-mini2440/stat
e/strace.extract]
Error 1




1.) Should I rather download strace-4.6.tar.gz?
2.) Where can I edit the source list to force ptxdist to rather use the gz
instead of the xz?

bluscape
Ok, I installed xz-utils and now it extracted

bluscape
I've compiled my new tools but I'm having a problem booting the rootfs from
the SD card. My SD card is partitioned into three parts

/dev/sdd1 = boot (vfat)
/dev/sdd2 = START_HERE(ext3)
/dev/sdd3 = rootfs (ext3)

In barebox I've set the following:

# can be either 'net', 'nand', 'initrd' or 'mmc'
rootfs_loc=mmc
# can be either 'jffs2' or 'ubifs' for flash or 'ext3' for mmc
rootfs_type=ext3

# MMC/SD boot settings
# partition number to read the kernel from
# (starting with # 0, Barebox's counting scheme)
kernel_mmc_part=0
# rootfs's partition number
# (starting with # 1, Kernel's counting scheme)
rootfs_mmc_part=3
# used when manually booting with "boot mmc" command
rootfs_mmc_type=ext3

but I'm getting the following error:

mmc0: new SD card at address b368
mmcblk0: mmc0:b368 SD02G 1.78 GiB
 mmcblk0: p1 p2 p3
usb 1-1: cp210x converter now attached to ttyUSB0
VFS: Cannot open root device "mmcblk0p3" or unknown-block(179,3)
Please append a correct "root=" boot option; here are the available
partitions:
1f00             512 mtdblock0  (driver?)
1f01             384 mtdblock1  (driver?)
1f02            2048 mtdblock2  (driver?)
1f03          128128 mtdblock3  (driver?)
b300         1872896 mmcblk0  driver: mmcblk
  b301           72261 mmcblk0p1 00000000-0000-0000-0000-000000000mmcblk0p1
  b302          923737 mmcblk0p2 00000000-0000-0000-0000-000000000mmcblk0p2
  b303          859477 mmcblk0p3 00000000-0000-0000-0000-000000000mmcblk0p3
Kernel panic - not syncing: VFS: Unable to mount root fs on
unknown-block(179,3)
Function entered at [<c000e4e0>] from [<c02b524c>]
Function entered at [<c02b524c>] from [<c0354b8c>]
Function entered at [<c0354b8c>] from [<c0354cb4>]
Function entered at [<c0354cb4>] from [<c0354df4>]
Function entered at [<c0354df4>] from [<c03547fc>]
Function entered at [<c03547fc>] from [<c0009fa4>]

Dave Festing
Attachment: HowTo boot with an SD card.zip (27 KB)
Did you dd the kernel into its partition?  I guess you must have or you
wouldn't have got so far.

Attached are my notes for setting up the SD card to use with Pengutronix.
(rename it .doc)

Dave

bluscape
I forgot to enable ext3 file system in the kernel config. I've selected it
as a module and not built-in. Now that it is built-in it can load the file
system but I get a different error:

mmc0: new SD card at address b368
mmcblk0: mmc0:b368 SD02G 1.78 GiB
 mmcblk0: p1 p2 p3
usb 1-1: cp210x converter now attached to ttyUSB0
kjournald starting.  Commit interval 5 seconds
EXT3-fs (mmcblk0p3): using internal journal
EXT3-fs (mmcblk0p3): recovery complete
EXT3-fs (mmcblk0p3): mounted filesystem with ordered data mode
VFS: Mounted root (ext3 filesystem) on device 179:3.
devtmpfs: error mounting -2
Freeing init memory: 196K
Kernel panic - not syncing: No init found.  Try passing init= option to
kernel. See Linux Documentation/init.txt for guidance.
Function entered at [<c000e4e0>] from [<c02ce88c>]
Function entered at [<c02ce88c>] from [<c02ce0fc>]
Function entered at [<c02ce0fc>] from [<c0373800>]

Dave Festing
I forgot to enable ext3 file system in the kernel config.

You are not the only one.  I should put a note in my document.

devtmpfs: error mounting -2

Try searching on the two Pengutronix gmane sites.  I hear a faint bell in
the background.  Is devtmpfs have to be enabled in the kernel?

Dave Festing
Is devtmpfs enabled in your kernel configuration?

bluscape
Yes, it seems to be.

Device Drivers --->
Generic Driver Options --->
[*] Maintain a devtmpfs filesystem to mount at /dev

bluscape
and also

[*] Automount devtmpfs at /dev, after the kernel mounted the rootfs

bluscape
Where can I find the ptxdist rootfs build log?

bluscape
Found it, platform-mini2440/sysroot-target/logfile

The rootfs compiled without any errors. I've had this "Kernel panic - not
syncing: No init found" error before but that was before I used ptxdist. At
that stage I copied the wrong rootfs into the SD card. But now I dont know
what is wrong.

Dave Festing
There is one very LARGE logfile in platform-mini2440.

Dave Festing
Mine was very large because I haven't cleaned it out in months.

I don't have a logfile in platform-mini2440/sysroot-target/logfile

I have one in platform-mini2440/build-target/platform which looks like a
copy of the other one.

However, I doubt this is going to help in your case!  

Just an observation:
I noticed that devtmpfs is used when booting with an SD cards and tmpfs is
used when booting with NFS.

Good night and good luck.

bluscape
Its working!. Stupido me, I wasnt sure about the kernel counting scheme for
the partitions on the SD card. I thought the rootfs is at part 3. Set it to
part 2 and now its booting. Awesome. Lets proceed..

bluscape
After a few seconds I get the following error in the console output:

JFFS2 notice: (379) check_node_data: wrong data CRC in data node at
0x02f02874: read 0x62172e1a, calculated 0xf8c060b3.
JFFS2 notice: (379) check_node_data: wrong data CRC in data node at
0x02f01b9c: read 0x62172e1a, calculated 0x41370bbf.

Juergen Beisert
> I thought the rootfs is at part 3. Set it to part 2 and now its booting.

That is was my comment in the Barebox's config means:

> # rootfs's partition number
> # (starting with # 1, Kernel's counting scheme)

Did you erase the NAND completely prior using it? Sometimes old data can
confuse JFFS2, bus these messages will disappear after JFFS2 has cleaned up
all NAND blocks. Only if your NAND is worn out, these kind of messages will
continue to appear.

bluscape
Juergen, 

Thanks, I will try and format the NAND again. I'm sure I did format it
before loading my new barebox.

I compiled the latest BSP with the latest matching ptx (2012.02) but just
realized that ppp is still version 2.4.4. I understand ppp-2.4.5 is only
available in ptx 2012.05. But I cant compile BSP 2012.02 with ptx 2012.05
so how do I get to use ppp-2.4.5 with BSP 2012.02?

Juergen Beisert
But you can partially update on a per package base. Just copy the rule file
(ppp.make) from the current PTXdist GIT repository into your BSP directory
into "rules/". Any local rule file with the same name has a higher priority
than the one from the PTXdist installation.

bluscape
Ok, but ppp has been built. How can I drop ppp only without having to
re-compile the entire ptx?

bluscape
I copied ppp.make from home/mc/local/ptxdist-2012.05.0/rules to
/home/mc/local/OSELAS.BSP-Pengutronix-Mini2440-2012.02.0/rules

then

I did ./ptxdist-2012.02.0 clean ppp and then ./ptxdist-2012.02.0 go

But its still using ppp-2.4.4

bluscape
I looked into the ppp.make from ptx 2012.05.0 and it also uses ppp-2.4.4
I've edited the ppp.make file and changed the version to 2.4.5 and updated
the the MD5 checksum to macth. Now it compiled the latest ppp. Hope this
will work.

davef
> How can I drop ppp only without having to
> re-compile the entire ptx?

ptxdist drop ppp or ptxdist clean ppp?

For my spi driver, which is in local_src, I just have to say:
ptxdist clean spi-write as a ptxdist drop spi-write says that it is not
built.

bluscape
Before I can continue with the ppp I first want to get everything working
like it used to but I have two problems:

1.) My boot logo does not display. I'm selecting the correct display driver
in barebox and the boot logo is enabled in the kernel. There is a
difference between the old (2.6.38) and new (3.2) kernelconfig. In the old
kernelconfig the following which is not available in the new kernelconfig:

Device Drivers --->
   Graphics support --->
      Console display driver support --->

This graphics driver should not have any effect on the boot logo or does
it?

2.) I'm running a startup script that bypasses the login screen. But when
the startup script is executed I get the following error:

loading modules
/home/startup: line 3: /etc/./profile.environment: Permission denied
starting pid 463, tty '/dev/console': '/sbin/getty -L 115200 ttySAC0 vt100'

mini2440 login:

I used the method from Juergen to generate the startup scripts which
basically puts a S99startup file in /etc/rc.d which in effect calls the
start script in /home

Juergen Beisert
The penguin/logo at startup is only visible if you enable the framebuffer
console "FRAMEBUFFER_CONSOLE=y" in the kernel config.

> /etc/./profile.environment: Permission denied

Seems your "/etc/profile.environment" has some curious permission flags
settings.

bluscape
But that is bothering me because the kernelconfig-3.2 does not have such a
setting. 

Inside
OSELAS.BSP-Pengutronix-Mini2440-2012.02.0/configs/platform-friendlyarm-mini2440
I there are several kernel configs (kernelconfig-2.6.38,
kernelconfig-2.6.39, kernelconfig-3.1, kernelconfig-3.2). 

Why is that?

Should I just add the line CONFIG_FRAMEBUFFER_CONSOLE=y to the
kernelconfig-3.2?

Juergen Beisert
Yes, in the BSP this kernel feature is disabled: For a LCD less system you
do not need it and for a graphical system you also do not need it. If you
really need it, just enable it. The BSP is only a base to work with. You
can adapt it to your needs by changing all settings.

And there are more than one kernel config file, due to the fact, this BSP
supports more than one kernel for the Mini2440. Or to be more precise: I
keep the old kernels in the BSP when I add the new ones. This week the
kernel 3.4 will be added for example.

bluscape
I'm about to give up on this ppp. I'm back at the original message:

In my console output I get the following:

Starting pppd...
/usr/sbin/pppd: In file /etc/ppp/options: unrecognized option 'plugin'
failed

Inside the /etc/ppp/options file its using the following plugin.

#
# Use the PPPoE plugin
#
plugin rp-pppoe.so

And I dont know how to resolve this. I've tried ppp-2.4.4 and ppp-2.4.5.
ppp-2.4.5 does not even have the the rp-pppoe.so plugin so I copy it from
ppp-2.4.4

bluscape
I got rid of the "unrecognized option 'plugin'" but only with ppp-2.4.4

When I run my chatscript I can see my GSM engine creates a GPRS connection
(In my case the LED flash fasst) but when I launch pppd with "pppd
/dev/ttySAC1 115200 call provider" I get a message:

Plugin rp-pppoe.so loaded.
RP-PPPoE plugin version 3.3 compiled against pppd 2.4.4

But I can see the GSM engine does not dial a GPRS connection (In my case
the LED flash idle).

When I run strace using "strace pppd /dev/ttySAC1 115200 call provider"

I get the following

root@mini2440:~ strace pppd /dev/ttySAC1 115200 /etc/ppp/peers/provider
execve("/usr/sbin/pppd", ["pppd", "/dev/ttySAC1", "115200",
"/etc/ppp/peers/provider"], [/* 18 vars */]) = 0
brk(0)                                  = 0x1b4000
uname({sys="Linux", node="mini2440", ...}) = 0
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or
directory)
open("/etc/ld.so.cache", O_RDONLY)      = -1 ENOENT (No such file or
directory)
open("/lib/tls/v4l/libcrypt.so.1", O_RDONLY) = -1 ENOENT (No such file or
directory)
stat64("/lib/tls/v4l", 0xbec63368)      = -1 ENOENT (No such file or
directory)
open("/lib/tls/libcrypt.so.1", O_RDONLY) = -1 ENOENT (No such file or
directory)
stat64("/lib/tls", 0xbec63368)          = -1 ENOENT (No such file or
directory)
open("/lib/v4l/libcrypt.so.1", O_RDONLY) = -1 ENOENT (No such file or
directory)
stat64("/lib/v4l", 0xbec63368)          = -1 ENOENT (No such file or
directory)
open("/lib/libcrypt.so.1", O_RDONLY)    = 3
read(3,
"\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0(\7\0\0004\0\0\0"..., 512) =
512
fstat64(3, {st_mode=S_IFREG|0755, st_size=34232, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0x4008d000
mmap2(NULL, 225604, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) =
0x400e6000
mprotect(0x400ee000, 28672, PROT_NONE)  = 0
mmap2(0x400f5000, 8192, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x7) = 0x400f5000
mmap2(0x400f7000, 155972, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x400f7000
close(3)                                = 0
open("/lib/libdl.so.2", O_RDONLY)       = 3
read(3,
"\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\0\t\0\0004\0\0\0"..., 512)
= 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=9672, ...}) = 0
mmap2(NULL, 41136, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) =
0x4002d000
mprotect(0x4002f000, 28672, PROT_NONE)  = 0
mmap2(0x40036000, 8192, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1) = 0x40036000
close(3)                                = 0
open("/lib/libpcap.so.1", O_RDONLY)     = -1 ENOENT (No such file or
directory)
open("/usr/lib/tls/v4l/libpcap.so.1", O_RDONLY) = -1 ENOENT (No such file
or directory)
stat64("/usr/lib/tls/v4l", 0xbec63338)  = -1 ENOENT (No such file or
directory)
open("/usr/lib/tls/libpcap.so.1", O_RDONLY) = -1 ENOENT (No such file or
directory)
stat64("/usr/lib/tls", 0xbec63338)      = -1 ENOENT (No such file or
directory)
open("/usr/lib/v4l/libpcap.so.1", O_RDONLY) = -1 ENOENT (No such file or
directory)
stat64("/usr/lib/v4l", 0xbec63338)      = -1 ENOENT (No such file or
directory)
open("/usr/lib/libpcap.so.1", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0HG\0\0004\0\0\0"...,
512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=198640, ...}) = 0
mmap2(NULL, 232344, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) =
0x4011e000
mprotect(0x4014e000, 28672, PROT_NONE)  = 0
mmap2(0x40155000, 8192, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2f) = 0x40155000
close(3)                                = 0
open("/lib/libc.so.6", O_RDONLY)        = 3
read(3,
"\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\230X\1\0004\0\0\0"..., 512)
= 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=1209460, ...}) = 0
mmap2(NULL, 1246440, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0)
= 0x40157000
mprotect(0x4027a000, 32768, PROT_NONE)  = 0
mmap2(0x40282000, 12288, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x123) = 0x40282000
mmap2(0x40285000, 9448, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x40285000
close(3)                                = 0
open("/lib/libnl.so.1", O_RDONLY)       = -1 ENOENT (No such file or
directory)
open("/usr/lib/libnl.so.1", O_RDONLY)   = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0
\334\0\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=253568, ...}) = 0
mmap2(NULL, 285256, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) =
0x40288000
mprotect(0x402c3000, 32768, PROT_NONE)  = 0
mmap2(0x402cb000, 12288, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x3b) = 0x402cb000
close(3)                                = 0
open("/lib/libgcc_s.so.1", O_RDONLY)    = 3
read(3,
"\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\210'\0\0004\0\0\0"..., 512)
= 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=45192, ...}) = 0
mmap2(NULL, 76708, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) =
0x40038000
mprotect(0x40043000, 28672, PROT_NONE)  = 0
mmap2(0x4004a000, 4096, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xa) = 0x4004a000
close(3)                                = 0
open("/lib/libm.so.6", O_RDONLY)        = 3
read(3,
"\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\3301\0\0004\0\0\0"..., 512)
= 512
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0x400c1000
fstat64(3, {st_mode=S_IFREG|0755, st_size=656872, ...}) = 0
mmap2(NULL, 688296, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) =
0x402ce000
mprotect(0x4036e000, 28672, PROT_NONE)  = 0
mmap2(0x40375000, 8192, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x9f) = 0x40375000
close(3)                                = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0x4009f000
set_tls(0x4009f4c0, 0x4009fb98, 0x4007c048, 0x4009f4c0, 0x4007c000) = 0
mprotect(0x40375000, 4096, PROT_READ)   = 0
mprotect(0x40282000, 8192, PROT_READ)   = 0
mprotect(0x40036000, 4096, PROT_READ)   = 0
mprotect(0x400f5000, 4096, PROT_READ)   = 0
mprotect(0x4007b000, 4096, PROT_READ)   = 0
brk(0)                                  = 0x1b4000
brk(0x1d5000)                           = 0x1d5000
open("/proc/net/psched", O_RDONLY)      = -1 ENOENT (No such file or
directory)
socket(PF_FILE, SOCK_DGRAM|SOCK_CLOEXEC, 0) = 3
connect(3, {sa_family=AF_FILE, path="/dev/log"}, 110) = -1 ENOENT (No such
file or directory)
close(3)                                = 0
uname({sys="Linux", node="mini2440", ...}) = 0
umask(0777)                             = 022
umask(022)                              = 0777
getuid32()                              = 0
getgroups32(65536, [0])                 = 1
gettimeofday({1426216782, 798988}, NULL) = 0
getpid()                                = 647
geteuid32()                             = 0
open("/etc/ppp/options

davef
I have little strace experience but was told that:

-1 ENOENT (No such file or
directory)

at least during the initial stages were safe to be ignored.

Staring at the top, are those libraries really on the platform?

davef
Starting . . .

bluscape
Got it working!!!!!!

I'm not sure what it does but executing this command before pppd does the
trick:

route del default 2>/dev/null

davef
Great!

How did you stumble across the right command?

Must be in Google somewhere :)

davef
So, those libraries were really on the platform, right?

bluscape
Hi Dave,

I'm busy typing a solution. The reason for the call to all the libraries
was due to incorrect entries in the options and providers scripts.

Will post the solution once I've completed writing it.

bluscape
The solution:

When ppp is enabled in ptxdist its creates a startup script
/etc/rc.d/S09ppp. This script is responsible for launching the ppp
interface. For some reason even if the ppp is selected as a module in the
kernel, the S09ppp script is still executed causing the ppp to be launched
but it does not really matter.

I've edited my S09ppp script to look like this:

$DAEMON_OPTS="call provider"

and in between "echo Starting pppd..." and "$DAEMON" I've added the
following line.

route del default 2>/dev/null

In my case for the ppp to work I need to execute this line before launching
pppd.

I don't use the /etc/ppp/options script and therefore commented everything
inside it.

I deleted the entire contents of /etc/ppp/peers/provider and re-wrote it to
look like this (consult the ppp manual for more options).

noauth
ttySAC1
115200
defaultroute
noipdefault
usepeerdns
connect "/usr/sbin/chat -v -s -t 5 -f /etc/chatscripts/provider"

Lastly I replaced the contents of /etc/chatscripts/provider to look like
this (Consult your GSM engine AT command set for additional AT commands):

TIMEOUT      60
ABORT        'BUSY'
ABORT        'NO CARRIER'
ABORT        'ERROR'
''           'AT'
'OK'         'AT+COPS?'
'+COPS: 0,0' 'AT+CSQ'
'OK'         'AT+CGDCONT=1,"IP","internet"'

Because my GSM engine takes a while to register on the network I'm trying
to wait for it in the chatscript until I've received the correct response
but it is nit working. When the engine is not registered it will reply with
+COPS: 0 when requesting network status and +COPS: 0,0,"Network operator
name" when it is registered. I'm trying to wait for the +COPS: 0,0 response
to indicate the engine is registered. There is a timeout value that can be
used to make chat wait until the correct response is found or a timeout.
When I call chat I've set this timeout to 60 (1 minute) but it does not
wait. I've even tried to set the TIMEOUT in the chatscript itself but that
does not work either. 

Maybe you can find a way to make chat wait until the correct response is
found.

davef
Good work, someone actually writing up how they sorted a problem.


I'll assume that my comment about 

-1 ENOENT (No such file or
directory)

was correct.

Haven't used chat. The only examples I have were found on the Sierra
Wireless site for running a Compass 850 from a Linux-based system.

Good luck.