pgprs2 - connect by old cell phone or 3G modem - beta

Configuration wizards, scanners, remote desktop, etc.
Post Reply
Message
Author
User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

pgprs2 - connect by old cell phone or 3G modem - beta

#1 Post by 01micko »

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! :P

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
Attachments
pgprs2-0.5.pet
GZIP compressed so should work in any puppy with newer gtkdialog.
(6.58 KiB) Downloaded 382 times
Last edited by 01micko on Tue 05 Jan 2016, 12:13, edited 2 times in total.
Puppy Linux Blog - contact me for access

watchdog
Posts: 2021
Joined: Fri 28 Sep 2012, 18:04
Location: Italy

#2 Post by watchdog »

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.

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#3 Post by 01micko »

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.
Puppy Linux Blog - contact me for access

watchdog
Posts: 2021
Joined: Fri 28 Sep 2012, 18:04
Location: Italy

#4 Post by watchdog »

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.

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#5 Post by 01micko »

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: Select all

#!/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?
Last edited by 01micko on Mon 04 Jan 2016, 07:34, edited 1 time in total.
Puppy Linux Blog - contact me for access

watchdog
Posts: 2021
Joined: Fri 28 Sep 2012, 18:04
Location: Italy

#6 Post by watchdog »

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.

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#7 Post by greengeek »

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?

watchdog
Posts: 2021
Joined: Fri 28 Sep 2012, 18:04
Location: Italy

#8 Post by watchdog »

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.

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#9 Post by greengeek »

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?

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#10 Post by 01micko »

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.
Puppy Linux Blog - contact me for access

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#11 Post by 01micko »

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!
Puppy Linux Blog - contact me for access

watchdog
Posts: 2021
Joined: Fri 28 Sep 2012, 18:04
Location: Italy

#12 Post by watchdog »

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.

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#13 Post by 01micko »

@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.
Puppy Linux Blog - contact me for access

Post Reply