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 Sun 14 Feb 2016, 00:02
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Network
pgprs2 - connect by old cell phone or 3G modem - beta
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [13 Posts]  
Author Message
01micko


Joined: 11 Oct 2008
Posts: 8405
Location: qld

PostPosted: Sun 03 Jan 2016, 08:07    Post subject:  pgprs2 - connect by old cell phone or 3G modem - beta
Subject description: Originally by lstandish
 

I have done a bit of a rewrite of Lloyd Standish' pgprs. Naturally enough I called it pgprs2. Lloyd hasn't been around in a while and I'm sure he'd be happy that his program lives on. Full credit to him. Credit new bugs to me! Razz

I tidied up the UI a bit and altered the logic. The original CHAT script is untouched. It *should* pretty much work for you if you used it in the old form.

This is beta so not recommended for newcomers but in saying that, giving it a try shouldn't harm too much. (see disclaimer).

Originally, Lloyd designed this to connect from the now old gprs phones. I haven't tested that functionality (still trying to resurrect my old Nokia) but I have tested 3G connectivity with an Huawei E160G dongle modem on Vodafone AU. All I had to do was enter my APN (live.vodafone.com) and phone number for the remote (*99#). Of course other ISPs will vary.

Have fun and report any bugs or odd behaviour.

NOTE: requires the modem-stats package which may be absent in recent slacko versions. See here. Only modem-stats is needed for this. Forget the others. Also requires gtkdialog >=0.8.3 which most puppies have now days but can be added to older pups.

Disclaimer: while all care is taken, no responsibility is accepted. Take this as the standard warning.

-------------------------------------------------------
2016-01-05
v0.5
reworked script logic
added config file in user's home
removed sed calls from main script
added detection and choice of disabling dhcpcd
fixed bug in chat script
fixed possible endless loop bug in modem detection
improved detection of modem
dropped dependency on modem-stats
-------------------------------------------------------

2016-01-04
v0.2
added dhcpcd check, also fixes DNS.
allow blank vars for APN and PIN
Improved test for modem detection
pgprs2-0.5.pet
Description  GZIP compressed so should work in any puppy with newer gtkdialog.
pet

 Download 
Filename  pgprs2-0.5.pet 
Filesize  6.58 KB 
Downloaded  43 Time(s) 

_________________
Woof Mailing List | keep the faith Cool |

Last edited by 01micko on Tue 05 Jan 2016, 08:13; edited 2 times in total
Back to top
View user's profile Send private message Visit poster's website 
watchdog

Joined: 28 Sep 2012
Posts: 930

PostPosted: Sun 03 Jan 2016, 14:38    Post subject:  

It works but I have at least three problems:

1- Launching pgprs2 does not disconnect the eth0 connection.
2- After dialing with pgprs2 a dhcp was done while eth0 connection was up updating resolv.conf with the dns of my main adsl provider. I tried to change resolv.conf and it holds up the new dns. I reconnected by pgprs2 after disconnecting eth0 and the right dns of mobile provider were set: consider to improve the script giving a chance to use resolv.conf.head.
3- I don't use a PIN for my sim: leaving the default PIN 1234 works but leaving blank the PIN does not work.

Thanks.
Back to top
View user's profile Send private message 
01micko


Joined: 11 Oct 2008
Posts: 8405
Location: qld

PostPosted: Sun 03 Jan 2016, 19:05    Post subject:  

watchdog wrote:
It works but I have at least three problems:

1- Launching pgprs2 does not disconnect the eth0 connection.
2- After dialing with pgprs2 a dhcp was done while eth0 connection was up updating resolv.conf with the dns of my main adsl provider. I tried to change resolv.conf and it holds up the new dns. I reconnected by pgprs2 after disconnecting eth0 and the right dns of mobile provider were set: consider to improve the script giving a chance to use resolv.conf.head.
3- I don't use a PIN for my sim: leaving the default PIN 1234 works but leaving blank the PIN does not work.

Thanks.


I have addressed these issues in v0.2, posted in the main post.

_________________
Woof Mailing List | keep the faith Cool |
Back to top
View user's profile Send private message Visit poster's website 
watchdog

Joined: 28 Sep 2012
Posts: 930

PostPosted: Mon 04 Jan 2016, 01:59    Post subject:  

Launching pgprs2 disconnects now eth0. Resolv.conf.head not used the first time: it is not properly working because at a second connection it was used but with a blank line added at the top of resolv.conf. My provider does not like openDNS and the connection is more fast using the DNS of the provider. Leaving a blank field for the PIN make the connection to fail: typing '' instead works.
Back to top
View user's profile Send private message 
01micko


Joined: 11 Oct 2008
Posts: 8405
Location: qld

PostPosted: Mon 04 Jan 2016, 02:59    Post subject:  

Thanks watchdog.

I found my old Nokia 6220c phone and it works (almost) out of the box. Connection is good and reliable; been up for a couple of hours now.

I had to modprobe the usbserial driver with the specific device id to produce the nodes in /dev and it shows up as /dev/ttyACM0.

I suppose a script like this should work for almost any phone that doesn't show up (well at least Nokias that relied on that horrid "PC suite" windows software).

Code:

#!/bin/sh
[ -z "$1" ] && exit # pass phone brand as arg
read -r a b c d e f g <<< $(lsusb|grep "$1") # f is our device ID
m=${f%:*} # manufacturer
p=${f#*:} # product
manu=${m:0:1}x${m:1} # insert an 'x' char in string
prod=${p:0:1}x${p:1}
# modprobe
modprobe usbserial vendor=$manu product=$prod
exit $?


jamesbond has suggested some more improvements that I am looking at, so a new version isn't too far away. A suggestion I like is getting rid of 'modem-stats', replacing with the 'microcom' busybox applet. 'modem-stats' is buggy anyway; I have a work around in the script for it. 'microcom' works perfectly. (edit: mistakenly had 'minicom')

Interesting that you say that you need *something* in the PIN field. Mine works with or without. Perhaps I should leave the '1234' default?

_________________
Woof Mailing List | keep the faith Cool |

Last edited by 01micko on Mon 04 Jan 2016, 03:34; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website 
watchdog

Joined: 28 Sep 2012
Posts: 930

PostPosted: Mon 04 Jan 2016, 03:28    Post subject:  

01micko wrote:

Interesting that you say that you need *something* in the PIN field. Mine works with or without. Perhaps I should leave the '1234' default?


Yes, 1234 as PIN works even when a PIN in the SIM is disabled.
Back to top
View user's profile Send private message 
greengeek

Joined: 20 Jul 2010
Posts: 3579
Location: New Zealand

PostPosted: Mon 04 Jan 2016, 03:41    Post subject:  

watchdog wrote:
It works but I have at least three problems:

1- Launching pgprs2 does not disconnect the eth0 connection.
Is it wise to disconnect eth0? There may be some circumstances where eth0 is being used to connect to another device which is hoping to use internet sharing via the pgprs maybe?
Back to top
View user's profile Send private message 
watchdog

Joined: 28 Sep 2012
Posts: 930

PostPosted: Mon 04 Jan 2016, 04:40    Post subject:  

I suggested the same behaviour of pupdial: pupdial disconnect eth0 when you launch it. I use one connection a time and in the case of testing a new dialing script I want that connection only up to evaluate the connection quality. The normal case is that one uses only a connection: you'll not normally have eth0 when using pgprs2 in mobility.
Back to top
View user's profile Send private message 
greengeek

Joined: 20 Jul 2010
Posts: 3579
Location: New Zealand

PostPosted: Mon 04 Jan 2016, 05:18    Post subject:  

watchdog wrote:
The normal case is that one uses only a connection: you'll not normally have eth0 when using pgprs2 in mobility.
Normally yes - but increasingly I look for the ability to run a couple of PCs through a hotspot. If the hotspot does not support multiple connections (and I suspect pgprs won't) then there may be some use for internet sharing. I think I saw forum member mekalu report a similar usage - that he used his puppy machine to allow the neighbour to connect.

No need to complicate pgprs but if it allows manual/prompted control over eth0 then maybe that would accomodate both needs?
Back to top
View user's profile Send private message 
01micko


Joined: 11 Oct 2008
Posts: 8405
Location: qld

PostPosted: Mon 04 Jan 2016, 05:41    Post subject:  

No one is disabling eth0, or wlan0 or eth1 or whatever. These interfaces can indeed still be in the 'up' state according to ifconfig if dhcpcd -k is sent to the dhcpcd process.

The dhcpcd client gets its nameserver info from the dhcp server. This is recorded in resolv.conf. If dhcpcd is still running (it's a daemon), it monitors resolv.conf and rewrites it when it thinks something is wrong (causing our conflict). This can be overridden manually but is a bit beyond (way beyond actually) the scope here.

Of course, the eth(0,1) or wlan(0,1) interface can be bridged and configured to serve (and wont be using dhcpcd) using many of the utilities out there to achieve this purpose making a hotspot; gyro has one which I have used with Lloyd's original pgprs, even before pupdial supported 3G modems.

_________________
Woof Mailing List | keep the faith Cool |
Back to top
View user's profile Send private message Visit poster's website 
01micko


Joined: 11 Oct 2008
Posts: 8405
Location: qld

PostPosted: Tue 05 Jan 2016, 08:15    Post subject:  

New version is out with an almost total rewrite.

See main post

That's about it for this apart from bug fixes.

Thanks for testing and comments!

_________________
Woof Mailing List | keep the faith Cool |
Back to top
View user's profile Send private message Visit poster's website 
watchdog

Joined: 28 Sep 2012
Posts: 930

PostPosted: Tue 05 Jan 2016, 09:12    Post subject:  

Perfect! Thanks. Blank PIN field accepted now by my provider. I have only to say that in /root/.config there is a blank dir pgprs2. Is it regular? It does not write a config file.
Back to top
View user's profile Send private message 
01micko


Joined: 11 Oct 2008
Posts: 8405
Location: qld

PostPosted: Tue 05 Jan 2016, 09:22    Post subject:  

@watchdog

It only writes the config once you click 'CLOSE window but stay online' button or the [X] to close the window. That is by design.

_________________
Woof Mailing List | keep the faith Cool |
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 1 of 1 [13 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Network
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0491s ][ Queries: 12 (0.0045s) ][ GZIP on ]