Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Thu 02 Oct 2014, 10:39
All times are UTC - 4
 Forum index » Advanced Topics » Cutting edge
GPRS modems work via Pupdial ?
Moderators: Flash, Ian, JohnMurga
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 1 of 1 Posts_count  
Author Message
Kazm

Joined: 14 Jan 2008
Posts: 29
Location: Russia, Ufa

PostPosted: Sun 27 Apr 2008, 05:36    Post_subject:  GPRS modems work via Pupdial ?
Sub_title: Why not do it?
 

GPRS modems gives devices like
/dev/ttyACM0, /dev/input/ttyACM0, /dev/input/ttyUSB0...

I try made simlink like this
# ln -s /dev/input/ttyACM0 /dev/ttySACM0

and Pupdial find this modem Cool

But now some problem in pupdial script.
For my GSM operator need this INIT2:
Init2 = AT+CGDCONT=1,"IP","internet.beeline.ru"

But script "eat" some part of string and I get this INIT2:
Init2 = AT+CGDCONT=1,

If we solve this problem, we get one program for all types of modems Rolling Eyes

Edited_time_total
Back to top
View user's profile Send_private_message Visit_website 
Aitch


Joined: 04 Apr 2007
Posts: 6825
Location: Chatham, Kent, UK

PostPosted: Sun 27 Apr 2008, 06:56    Post_subject:  

Hi Kazm
Maybe this helps?

http://www.murga-linux.com/puppy/viewtopic.php?t=2667&start=15

http://murga-linux.com/puppy/viewtopic.php?t=24442&sid=46b221724e3309489074fff764e403e5

Aitch
Back to top
View user's profile Send_private_message 
HairyWill


Joined: 26 May 2006
Posts: 2949
Location: Southampton, UK

PostPosted: Sun 27 Apr 2008, 07:45    Post_subject:  

good call

The problem seems to be getting an init string with quotes into and back out of gtkdialog. Line 73 of /usr/sbin/pupdial needs something similar to
Code:
INIT2M="`cat /etc/wvdial.conf | grep '^Init2 = ' | cut -f 3-12 -d ' '| sed 's/"/\\\\"/g;'`"

note this is wrong because it inserts an extra backslash. I can't get gtkdialog to display <edit>quotation marks without also showing a backslash</edit>.

There are more problems where the the output from the dialog is read.
Code:
eval "$RETSTRING"
Is risky because it tries to evaluate all of the output. Some of this is not executable and there is always the risk that one of the expressions could be something downright dangerous. Which field do I have to type rm -f /* into to wipeout my installation?
Something like this is safer
Code:
RETSTRING=(`gtkdialog3 --program=MAINDIALOG`)
for foo in ${RETSTRING[@]}; do
echo $foo
[ "$(echo $foo | grep -E 'CHECKBC|CHECKCC|CHECKDT|ENTRYACC1ISP|ENTRYACC1PASS|ENTRYACC1USER| #broken line for forum
ENTRYACC2ISP|ENTRYACC2PASS|ENTRYACC2USER|ENTRYBAUDM|ENTRYINIT1M|ENTRYINIT2M|EXIT|#broken line for forum
ynAUTO_RECONNECT1|ynAUTO_RECONNECT2|ynSTUPID_MODE1|ynSTUPID_MODE2')" ] && eval $foo
done
but I haven't included specially handling for variables with quotes in this example.

This is so close to working, well done.

I messed around and got pupdial to work with my mobile but then it wrote quotes into wvdial.conf and which broke pupdial the next time it tried to load the gui. It can probably be made to work if you accept the backslash characters in the display.

_________________
Will
contribute: community website, screenshots, puplets, wiki, rss
Back to top
View user's profile Send_private_message 
HairyWill


Joined: 26 May 2006
Posts: 2949
Location: Southampton, UK

PostPosted: Sun 27 Apr 2008, 11:09    Post_subject:  

ok here is a patch for the pupdial in dingo beta 2
Code:
# diff pupdial.orig pupdial.new
73c73
<  INIT2M="`cat /etc/wvdial.conf | grep '^Init2 = ' | cut -f 3-12 -d ' '`"
---
>  INIT2M="`cat /etc/wvdial.conf | grep '^Init2 = ' | cut -f 3-12 -d ' '| sed 's/"/\\\\"/g;'`"
163c163
<     <default>\"${INIT2M}\"</default>
---
>     <input>echo \"${INIT2M}\"</input>
346,350c346,352
<
< #RETSTRING="`echo "$MAINDIALOG" | gtkdialog3 --stdin`"
< RETSTRING="`gtkdialog3 --program=MAINDIALOG`"
<
< eval "$RETSTRING" #v3.99
---
> #patched by hairywill to allow quotation marks in INIT2M
> RETSTRING=(`gtkdialog3 --program=MAINDIALOG`)
> for ONEEXPRESSION in ${RETSTRING[@]}; do
> [ "$(echo $ONEEXPRESSION | grep -E 'CHECKBC|CHECKCC|CHECKDT|ENTRYACC1ISP|ENTRYACC1PASS|ENTRYACC1USER|
ENTRYACC2ISP|ENTRYACC2PASS|ENTRYACC2USER|ENTRYBAUDM|ENTRYINIT1M|EXIT|
ynAUTO_RECONNECT1|ynAUTO_RECONNECT2|ynSTUPID_MODE1|ynSTUPID_MODE2')" ] && eval "$ONEEXPRESSION"
> [ "$(echo ${ONEEXPRESSION} | grep 'ENTRYINIT2M')" ] && ENTRYINIT2M=$(echo $ONEEXPRESSION| sed 's/.*="//;s/"$//')
> done
> #end of patch
warning:I put a couple of line breaks in there to stop the page being so wide
_________________
Will
contribute: community website, screenshots, puplets, wiki, rss

Edited_times_total
Back to top
View user's profile Send_private_message 
John Doe

Joined: 01 Aug 2005
Posts: 1689
Location: Michigan, US

PostPosted: Sun 27 Apr 2008, 14:12    Post_subject:  

Is the cdc-acm kernel module loaded automatically or does it need to be done manually?

We should work out a way to do it automatically if need be. Then it would be really easy for anyone with a GPRS modem.
Back to top
View user's profile Send_private_message 
HairyWill


Joined: 26 May 2006
Posts: 2949
Location: Southampton, UK

PostPosted: Sun 27 Apr 2008, 15:31    Post_subject:  

cdc_acm is not loaded automatically in dingo beta 2

Do all mobile phones use cdc_acm, and do these all present as the same device node?
The simplest would be a button "press this if you have connected a mobile".
I presume it could also be done automatically at boot by putting in all the usb ids. Though this is not so helpful if you plug the phone in after booting. What would be really helpful would be a list of countries, providers, contract type, connection strings and numbers as finding the connection string and correct number is a significant hurdle. A page for recording these on the wiki might be good.

_________________
Will
contribute: community website, screenshots, puplets, wiki, rss
Back to top
View user's profile Send_private_message 
John Doe

Joined: 01 Aug 2005
Posts: 1689
Location: Michigan, US

PostPosted: Mon 28 Apr 2008, 21:33    Post_subject:  

just wanted to let you guys know i'm working out a big reply and a couple wizards.

more in a few hours.
Back to top
View user's profile Send_private_message 
John Doe

Joined: 01 Aug 2005
Posts: 1689
Location: Michigan, US

PostPosted: Tue 29 Apr 2008, 15:15    Post_subject:  

passed out before I could finish it last night.

couple more hours, here's a progress report as an image.

i've got my phone modem recognized with a couple clicks off a fresh DingoBeta2.
connectionwizard-screenshot-small.png
 Description   
 Filesize   337.94 KB
 Viewed   1226 Time(s)

connectionwizard-screenshot-small.png

Back to top
View user's profile Send_private_message 
John Doe

Joined: 01 Aug 2005
Posts: 1689
Location: Michigan, US

PostPosted: Wed 30 Apr 2008, 13:20    Post_subject:  

Kazm, if you're out there, can you test this?

http://www.murga-linux.com/puppy/viewtopic.php?p=193795#193795

I'm trying to automate it all.

You should be able to get your phone recognized by Pupdial with just a couple clicks of a fresh boot.

Whether or not you can connect after that....that's a different story.
Back to top
View user's profile Send_private_message 
HairyWill


Joined: 26 May 2006
Posts: 2949
Location: Southampton, UK

PostPosted: Wed 30 Apr 2008, 15:56    Post_subject:  

John this looks great.

I gave a whirl and hit several snags.
I pretended that I didn't know which device it would get connected to. I went through all of the usb device options then used an init2 string that I already knew works to try and dial out. It failed. I can't remember the exact message from wvdial. I checked which modules were loaded and I had ipaq and idtl_???? as well as cdc_acm, I unloaded those and pupdial worked and got me connected Smile.

I haven't looked at the code at all so if any of my comments don't make sense I apologise.

It might be good to have a list of usb.ids to decide which driver to load. I suppose it would make sense to get Barry to add them to the main list.

As far as working out what node the device is on surely there must be a way of probing the node to see if something is on the other end of it.

After pupdial finds a device it automatically writes a connection string into init2. I don't expect that this can be filled automatically but it might be helpful if we can give the user some clues on where to search for this and the number to dial.

I also was intrigued to see the vpn options. I'm not convinced this is exactly the right place for them but its great you are having a bash at this. The loss of pptpconfig bothered me though I did finally work out how to get my vpn working by hand a few weeks ago.

I tried the ms pptp option and first had to lookup the ip of my server as I only know its name. I didn't really know what I was supposed to put in the default route or netmask, though I could probably work it out if I thought hard. I wasn't quite sure if the ppp0 referred to my current interface or the one the tunnel was going to create. Isn't this always one more than the existing ppp interface(s), I left all the other settings as default. I hit the connect button and was rewarded with an extra blinky but no other output. The network connection didn't work and it looked like the routing table was wrong, I presume I made the wrong choices in the config. When I disconnected the tunnel it didn't put back my original dns servers into resolv.conf though the routing table was fine.

Hope this helps, give me a shout if you want further clarification, I think this is a great project.

_________________
Will
contribute: community website, screenshots, puplets, wiki, rss
Back to top
View user's profile Send_private_message 
Kazm

Joined: 14 Jan 2008
Posts: 29
Location: Russia, Ufa

PostPosted: Thu 01 May 2008, 08:28    Post_subject:  

HairyWill and John, I hope we do it in service pack for Dingo 4 Rolling Eyes
And now I'm testing your new scripts in our PuppyRus (based on Puppy 3.01).

I tried make HairyWill's patch to pupdial, but I done something wrong and it's no working right Crying or Very sad

But then I tried use CDMA-phone modem that use such init2:
Init2 = at+crm=1;&C0

And thats work Laughing
But not connect Laughing
This is log:
Code:

--> Initializing modem.
--> Sending: ATZ
OK
--> Sending: at+crm=1;&C0
OK
--> Modem initialized.
--> Sending: ATDT#777
--> Waiting for carrier.
ATDT#777
CONNECT
--> Carrier detected.  Waiting for prompt.
--> Don't know what to do!  Starting pppd and hoping for the best.
--> Starting pppd at Thu May  1 13:20:03 2008
--> pid of pppd: 23541
--> Disconnecting at Thu May  1 13:20:14 2008
--> The PPP daemon has died: A modem hung up the phone (exit code = 16)
--> man pppd explains pppd error codes in more detail.
--> Try again and look into /var/log/messages and the wvdial and pppd man pages for more information.
--> Auto Reconnect will be attempted in 160 seconds


I know there not some files...maybe...

Edited_time_total
Back to top
View user's profile Send_private_message Visit_website 
HairyWill


Joined: 26 May 2006
Posts: 2949
Location: Southampton, UK

PostPosted: Thu 01 May 2008, 15:47    Post_subject:  

kazm
Try installing johns new version at the link above, that should work.

Barry has patched his copy to allow quotation marks in both init strings so the next iso he releases at the weekend should work for you as long as you load the module and make the dev link yourself.

_________________
Will
contribute: community website, screenshots, puplets, wiki, rss
Back to top
View user's profile Send_private_message 
magerlab

Joined: 08 Jul 2007
Posts: 731

PostPosted: Wed 07 May 2008, 04:31    Post_subject:  

will it also work on puppy 3?
i want to use a cell phone as a modem with eeepc

_________________
skype: desafimager
Back to top
View user's profile Send_private_message 
John Doe

Joined: 01 Aug 2005
Posts: 1689
Location: Michigan, US

PostPosted: Fri 09 May 2008, 21:49    Post_subject:  

I think I have the finding of the device figured out, without resorting to simlinking stuff all over the place.

I looked through all the scripts and found that wvmodemscan was the app that detects the modems.

The 2.6x kernel seems to put them in different places than 2.4x.

I found the code, next I'll compile do a quick test and post it for everyone to test.

Code:
static int fileselect(const struct dirent *e)
{
    return !strncmp(e->d_name, "ttyS", 4)         // serial
       || !strncmp(e->d_name, "ttyLT", 5)   // Lucent WinModem
       || !strncmp(e->d_name, "ttyACM", 6)      // USB acm Modems
       || !strncmp(e->d_name, "ttyUSB", 6)      // Modems on USB RS232
       || !strncmp(e->d_name, "ircomm", 6)      // Handys over IrDA
       || !strncmp(e->d_name, "ttySL", 5);   // SmartLink WinModem

   // (no internal ISDN support)   || !strncmp(e->d_name, "ttyI", 4);
}
Back to top
View user's profile Send_private_message 
lstandish


Joined: 06 Jun 2008
Posts: 126

PostPosted: Fri 31 Oct 2008, 14:51    Post_subject: GPRS for Puppy  

I just want to point out that Puppy 4.1 now has "pgprs," a generic wizard to detect and configure GPRS serial modem devices. It creates scripts that work directly with pppd.

I'm wondering if you ever got pupdial working with GPRS. The main catch I see to use of pupdial is the require to enter (once) the GSM PIN code to unlock the card. It is this requirement that has never allowed me to use common dialup programs.
Back to top
View user's profile Send_private_message 
Display_posts:   Sort by:   
Page 1 of 1 Posts_count  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » Advanced Topics » Cutting edge
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0997s ][ Queries: 13 (0.0089s) ][ GZIP on ]