more mindstab guides - on bluethooth/modems/gprs/cells/laptops

This commit is contained in:
Dan Ballard 2016-01-04 09:44:39 -08:00
parent 2150ab938b
commit b356289ab2
2 changed files with 144 additions and 0 deletions

View File

@ -0,0 +1,31 @@
# Conectivity the old school way: Toshiba laptop modem (intel) and dialup #
*Jul 26, 2007*
So you might be noticing a theme emerge between this and my last post. Yes, after watching terrible movies and reading some books, some of which are sub optimal, and then generally immersing myself in the internet, I decided I needed to be more connected. So I have several projects on the go to fix that. The earlier post of getting GPRS internet on my laptop from my cell via bluetooth was one such project. But it's also financially impractical. However, my Telus ADSL package comes with 40 hours a month of dialup included. So I thought it was time to turn my attention to that. I'd ignored the old technology of modems forever, not thinking that they can still come in handy in pinch until the city is covered in municipal WiFi. Phone lines are often more prevalent then unsecured wifi in the city, especially in buildings or houses.
So, first, I hopped over to the Telus website and found that the Vancouver dial in number is 604-280-9000. Next, I had to determine the modem that my Toshiba Satellite m40x has. As it turns out there are tools for that: [scanModem](http://132.68.73.235/linmodems/index.html#scanModem), a little shell script that does the trick. Downloaded it, unzipped it and ran it. It told me I had an Intel/Alsa modem. So I loaded up the *snd-intel8x0m* kernel module. Then I installed the *sl-modem-daemon* package that uses the module and provides the rest of the softmodem. It neede to be setup:
# dpkg-reconfigure sl-modem-daemon -plow
And it just asked the county I was in, and the set things up. The modem was then controllable from '/etc/init.d/sl-modem-daemon' and could be *start*ed and *stop*ed accordingly. The device that was created was '/dev/ttySL0' but '/dev/modem' was also turned into a symlink that pointed to it so either was usable. With the modem setup and on, I then needed a dialer to connect me to my ISP.
First, a simple but verbose and command line dialer: *wvdial*. To set it up I ran
# wvdialconf /etc/wvdial.conf
It worked and the config file was created. But it needed editing. So I loaded it up in a text editor and uncommented the phone number (one number, no dashes or spaces), username, and password fields and filled them out accordingly. Lastly, for this modem, I needed to add the `Carrier Check = no` line at the end of the file for it to connect properly. Then everything was in order and connecting was as simple as
# wvdial
Success. I had dailup internet. Ctrl-C in the terminal to disconnect.
The softmodem is flaky though and its often a good idea to restart it between dials
# invoke-rc.d sl-modem-daemon restart
Still, command line isn't as sexy as GUI, or at least not as convenient. So I then installed 'gnome-ppp' and found it in the 'Applications->Internet' menu. I put in the pertinent information again (phone number, username, password) and then tweaked a few options in it's setup window like device in the 'Modem' section, and turning on 'Dock in notification area', and turning off 'Check carrier line' in the 'Options' section. Then I hit the connect button and it connected and minimized to the notification area. Beautiful slow internet was mine!
## Reference ##
* [DialupModemHowto - Community Ubuntu Documentation](https://help.ubuntu.com/community/DialupModemHowto)
* As always, [Google](http://google.com) for analyzing various errors and pointing me in the right direction.

View File

@ -0,0 +1,113 @@
# Getting my Ubuntu laptop and Sony Ericsson k510a cell phone to talk to each other with Bluetooth: file sharing and internet over GPRS and ppp #
*Jul 26, 2007*
Well, I taught my laptop a new trick.
I went out and bought a DLink DBT-122 Bluetooth adapter (USB). Cheapest one they had, plugged it into my laptop (Ubuntu Feisty) and it was recognized right away. Installed bluez and bluetooth related packages and started to play.
First thing I did was enable the bluetooth applet that runs in the notification area. It can also be accessed from 'System->Preferences->Bluetooth Preferences'. Once that was on and my cell phone's (Sony Ericsson k510a) bluetooth was on I was able to use nautilus' sendto to send files via bluetooth to my cell phone. Then after turning on 'Applications->Accessories->Bluetooth File Sharing', which starts an applet in the notification area, I was able to send files to my laptop from my cell phone via bluetooth. So that was all cool, but it was also just warm up.
Next I wanted to get internet on my laptop through my cell phone. While impractical in the areas on cost and speed, it does have far greater coverage than random unsecured wifi access points around the city (especially as of late as people are finally starting to use WEP and WPA) and it's coverage out of city is of course no contest either.
So I installed a few more tools, ppp (Point to Point Protocol) related, like ppp and pppconfig.
The first tool I used was 'hcitool' which is used for establishing bluetooth connections and other bluetooth related issues.
# hcitool scan
Scanning ...
00:17:B9:DA:E4:F2 phone.mindstab.net
This will scan for all bluetooth devices in range and return their name and MAC address. Next I had to connect to the phone and laptop or 'pair' the devices. For my phone, the Sony Ericsson k510a, I had to do this on the phone's side. I went to *Settings->Connectivity->Bluetooth->My Devices*. Then I selected *New Device* and after it scanned, I selected my laptop. It then bid me enter a 'password' so I choose a few numbers, and then the bluetooth manager on my laptop notified me a device was trying to 'pair' and asked me to enter the number there. That done my cell phone accepted my laptop. I selected my laptop/device on my cell phone and told it to always accept connections from that device. Also, to be safe, I put the password/number in */etc/bluetooth/pin* although I'm not really certain if that was necessary.
Now the devices were set to connect to each other on a regular basis so back to hcitool to handle that. The *cc* argument establishes or breaks a connection and the *auth* argument authenticates the connection.
# hcitool cc 00:17:B9:DA:E4:F2
# hcitool auth 00:17:B9:DA:E4:F2
Now a bluetooth connection with the phone was established. Next up it was time to configure the ppp connection that would run from my laptop, over bluetooth to the cell, and from there over GPRS (or possibly EDGE?) to the internet.
First, I needed to further setup Bluez (Bluetooth handler on Linux) to facilitate this by creating a /dev/ entry for the connection. And I needed a bit more info. The command *sdptool* delivered this to me. It can be used to list all the supported features of a device and their details. I was specifically interested in the 'Dial-up Networking' section.
# sdptool browse 00:17:B9:DA:E4:F2
...
Service Name: Dial-up Networking
Service RecHandle: 0x10002
Service Class ID List:
"Dialup Networking" (0x1103)
"Generic Networking" (0x1201)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 2
Profile Descriptor List:
"Dialup Networking" (0x1103)
Version: 0x0100
...
In there I found the 'Channel' that the protocol was operating on, in this case '2'. Now I opened up */etc/bluetooth/rfcomm.conf* and setup the device.
**/etc/bluetooth/rfcomm.conf**
rfcomm0 {
bind yes;
device 00:17:B9:DA:E4:F2;
channel 2;
comment "Bluetooth PPP Connection";
}
Then I restart bluetooth. On newer Ubuntu versions the service is just called 'bluetooth' but on older versions it's apparently called 'bluez'.
# invoke-rd.d bluetooth restart
Now I had setup a connection to my cell phone and created */dev/rfcomm0* for it. I was now ready to setup a ppp connection over bluetooth.
pppconfig thankfully does most of the hard work here. It configures the ppp/peer files and the even more convoluted chatscript (some kind of text file that contains the initial connection protocol text that is used to establish the connection).
# pppconfig
pppconfig gives you a menu. I chose 'Create Connection'. Called it whatever, I chose 'gprs'. Next I selected 'Dynamic' (for DNS). Then I selected 'Chat' for the Authentication Method. I entered no password or login, and then deleted the text when it asked for a User name and another password. The default speed of '115200' baud was fine. 'Tone' is the choice for the 'Pulse or Tone' section. The number to dial was a bit tricky. It's in the form of something like '\*99\*\*\*slot-of-internet-on-cell\#' so for me '\*99\*\*\*2\#' was what I entered but others might try '\*99\*\*\*1\#' or possibly '\*99\#'. I entered the port to use manually and entered '/dev/rfcomm0'. Then it gave me a chance to review and then write the file. I did so.
The two main files it creates are '/etc/ppp/peers/gprs' and '/etc/chatscripts/gprs'. If you are lucky you should just be able to connect now, but I had problems, so I had to tweak the files a bit. In '/etc/ppp/peers/gprs' I had to comment out the *remotename* and *ipparam* lines with hashs (#).
**/etc/ppp/peers/gprs**
...
user ""
#remotename gprs2
#ipparam gprs2
and in '/etc/chatscripts/gprs' I had to comment out the 'ogin:' and 'ssword:' lines again with hashes.
**/etc/chatscripts/gprs**
...
# ispname
#ogin: ""
# isppassword
#ssword: ""
# postlogin
Now all the ppp config files were properly configured to work with my phone, so it was time to try the connection out. Before that though, I turned other networking off, which is easy enough with NetworkManager, I just right clicked on it and unchecked 'Networking'. Then to turn on the connection over bluetooth, ppp, and gprs, I just used the 'pon' command.
# pon gprs
and gave it a few seconds. My cell lit up and told me it was connecting and then it connected. Then I was good to go. Sadly gprs internet rates are expensive here at $0.05 / kB. Also, it's a bit firewalled so the standard ping google.com test to see if the connection is working fails. I just loaded a small web page in my browser. It worked! Then tried to 'ssh' to my server, and that also worked! When I was done, I just
# poff gprs
to turn the connection off.
And that's it. Now I can get files to and from my cell phone and get internet from it for my laptop as well.
When I was having trouble, I looked in '/var/log/syslog' to see where the trouble was coming from.
Also, for some reason, the next day, 'sdptool' was reporting that the 'Dailup Networking' service had moved to channel 2 so I had to change '/etc/bluetooth/rfcomm.conf' file to represent that and restart bluetooth with `invoke-rc.d bluetooth restart`, so keep an eye out for that if your connection starts failing later for no reason.
## References ##
* [CLUG Wiki: GPRS Internet over Bluetooth](http://wiki.clug.org.za/wiki/GPRS_Internet_over_Bluetooth)
* [Bluetooth Setup - Community Ubuntu Documentation](https://help.ubuntu.com/community/BluetoothSetup?highlight=%28CategoryBluetooth%29)
* [BluetoothDailup - Community Ubuntu Documentation](https://help.ubuntu.com/community/BluetoothDialup)
* [HOW-To: GPRS Connection Via Bluetooth - Ubuntu Forums](http://ubuntuforums.org/showthread.php?t=111455)
* [UbuntuHelp:BluetoothDailup - Ubuntu中文](http://wiki.ubuntu.org.cn/index.php?title=UbuntuHelp:BluetoothDialup&variant=zh-tw)
* A few more pages turned up on [Google](http://google.com) under various bluetooth + ppp + gprs + error searches