Sunday, July 11, 2010

Making a Dlink DI-524 into a Switch

--------------------------------------------
Edit July 31, 2010, 9pm:

I thought it would be better to rename the shared SSID/Password routers so that they are different so that I could choose which one to connect to depending on where I was in the house. Apparently, though, this sucks bad. I thought it was just for convenience that you would want both your routers spouting out the same SSID, but it turns out that it may also be functional. What happens now is that I can (sometimes) connect to my second-in-line-from-the-modem router wifi but it boots me off after just a short time. I am going to go back to the shared SSID format and see if it fixes it to confirm. Hey... here is a great little forum post on this topic if you ever need: http://www.wirelessforums.org/network-troubleshooting/two-wireless-routers-5078.html

and another cool, simple tutorial for setting up static IPs in a LAN, check this out: http://www.homenethelp.com/web/howto/static-ip-address.asp

stay tuned for update...

...here comes the update @ 9:30pm:

so far so good! I have a killer strong wifi signal and it's snappy fast. I think all things mentioned above in my edit are true, plus a few more items. here is a summary of what I've learned:

1. keep the same wifi SSID/Password if you are are sharing a wifi network (two routers in the same LAN).

2. make sure the security is also the same (WPA, WEP, etc) (I chose WPA-PSK in both)

3. make sure the two routers are using channels that are at least 5 channels apart from each other (found that in one of the links above). I chose 10 and 2 for my two channels. It will help reduce interference of signal.

4. follow my tutorial below, to change a dlink router into a switch with wifi, but make sure to add steps #1-3 above to step #5.

5. Static IPs vs. just leaving it with DHCP??... stay tuned!

-------------------------------------


So, why it can't just be as easy as these 'ehow' tutorials say it is, I don't know. Anyways, I decided to spare many of you the pain of hours of wasted time if you would like to simply turn an old di-524 into a switch to expand your network. I had to combine a bunch of tutorials and then rewrite them:

1. factory reset your router. It's just easier to start that way. You do that by sticking a pin or small object in that hole in the back, holding it for about 20 seconds, and then releasing. You should see all the lights flash. I think it's not a bad idea to power on and off the unit after this step as well to make sure all is reset. Now your password should be blank and your user name 'admin' in your router settings.

2. Make sure you have yourself isolated in your network. How you do that is just put an ethernet cable into any of the LAN ports in the back of the router and then put the other end in your PC. Make sure any wireless connections are disabled and it would be wise to make sure they are set to not connect again automatically. I'm not sure if this matters too much but in the past this has screwed me up so I make it policy to do this.

3. Next, dial up 192.168.0.1 in your web browser. You'll hit your dlink admin page. It will ask you for user/pass. Enter 'admin' as user and leave the password field blank. You'll fill in a new one shortly so don't worry.

3. Change your IP address of your router. You do that by going to 'home' tab and then click the 'LAN' yellow button on the left. Change it to 192.168.2.1 or, some people recommend 192.168.0.2. I like the first one and it worked so why not try that? the idea here is that we want to make sure we are choosing an IP address that nothing else in your network owns. If you don't know your network, the one I like is usually best. click 'apply' to save those changes. Now it will restart the device and hopefully it will say that you can no longer connect to the device. If that is successful, we'll now navigate to your new router-switch's ip address to change some more settings...

4. pump up some 192.168.2.1 action in your web browser. enter the same user/pass when prompted

5. enable your wifi access point (if you want). It has been told to me that if you leave all the details the same as your other nearby WIFI access point (ssid, channel, wpa, password, etc) that they will work together. I have not had time to confirm this yet so I just tried it anyways. Or, make a new SSID and make sure to use the popular WPA-PSK setting because it is easier to enter a memorable password I find. Save your changes when finished. The device will again boot you out probably. Navigate back to 192.168.2.1 at any time if you find the device being weird.

6. change your admin password for the heck of it. I'm not actually sure if you need to because it seems that once you do my final step you can no longer access the router anyways. Regardless, it is good practice so let's set an admin password. Go to 'advanced' and just enter it at the top there and confirm. It will again boot you out, etc. Again, manually enter your now-favourite URL of 192.168.2.1 if you have any problems.

7. Kill the DHCP settings. Here is the part that wasted all my time. No one mentioned that after you disable your DHCP settings that you will no longer be able to access the device. so, trust me. All this fun admin stuff becomes dead after you do this but you have to do this in order to use the thing as a switch. Here we go: Go to 'home' and then hit the yellow "DHCP" button. At the top, disable the DHCP server thing. Remember, once you hit 'apply' and save your settings here, you'll no longer be able to get into your device without the same hard-reset we did at the beginning with the sharp device in the back. Go ahead. Make my day. Save your settings.

Now that your device has rebooted, you're out of luck if you want to go back in and change anything. Hopefully you took my advice and did all that before step 7. If you failed or your WIFI isn't working right, hard reset your device and then just do the same steps above again. I did it at least 10 times today and it still works! :(

***KEY****

I also wasted TONNES of time by missing a small detail on a tutorial. From now on do NOT plug anything into the WAN port on the back. It's dead. What you have to do is bring the cable from one of your LAN ports of your other working router into the LAN port of your newly switchized di-524. Just plug in any additional devices in and they should all share happily everything.

Now, suddenly, at least the ethernet stuff and internet sharing/networking work great!

I was most impressed with the speed.

Hope this helps you much!

Monday, February 22, 2010

Nothing but the box

Webcams and Ubuntu

Why don't they just work?
Well, some of them do, but not the ones that we had.

We plugged in a Logitech QuickCam in Karmic (9.10) for Skype video calls. Nothing is that easy.

Ok... so drivers. EasyCam seems to not exist anymore, so, so much for it being "easy".

Random Workingness

1. I changed the launcher for Skype :
System -> Preferences -> Main Menu -> Skype (Properties)
Command =
bash -c 'LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so skype'
That apparently did nothing... UNTIL

2. WT decided to install cheese:

sudo apt-get install cheese
The webcam not only worked then in cheese but also in Skype.

Maybe it was something in the cheese dependencies?

I later found out that part 1 was also important.

The built in webcam on the HP Pavilion DV6000 still does not work.

To be continued...

Monday, December 14, 2009

PAP2 updates

It has been a while since I've posted about my PAP2 connected to our system. There were quite a few hard days (as posted) while I tried to get the thing to register and stay registered. After that post, it was working quite well, but every few days or so it would unpredictably 'go offline'. I would mess around with various settings and it would magically work again for a while - not the best scenario when you are trying to convince your wife that this is the cooler/cheaper alternative to Vonage! :(

I have isolated the problem to ports and ip address changes (DCHP?).

First, whenever it goes offline, to repair it, usually all I have to do is log into the PAP2 gui and change the ports from this:
line1 @ 5060
line 2 @ 5061

to this:
line 1 @5064
line 2 @ 5065

I have also noted that there seems to be a connection between when their are network changes at the location of the asterisk server. It finally dawned on me when I pulled the electrical cable out of the router to reset it at the location where the asterisk server is plugged in. Of course, everything went down, and went back up again, but after that my home PAP2 (connected remotely to this network) would not register anymore and required me to go in and manually do the aforementioned port changes.

My theory is that if I were to purchase a static IP address where the asterisk is located, that this would no longer happen. Would the price of the static IP make it worthwhile? I"m not sure. I haven't priced it. ...

Sunday, September 27, 2009

FreePBX - IVR Options Not Working [fixed!]

Funny times again in FreePBX Land.

As excited as I am at how close I am to having my 'own Google voice' catch-all number, it seems I'm bumping into an issue with the IVR. I am able to record the IVR, reach the IVR when calling the inbound route, but when the IVR recording plays, I am unable to actually do anything. When the voice says 'Press 1' and I press 1, nothing happens. It's not picking up the DTMF tone or something. Or permissions are wacky. I've emailed Disposable Joe to see what he thinks about the scenario...

EDIT:

DTMF was the problem. In the PEER details of the Trunk in FreePBX:

Change dtmfmode=rfc2833 to dtmfmode=inband

Or add it if isn't there...

Why?
The device that you press the key on will generate the DTMF tones. - If the codec is not ulaw or alaw then the DTMF tones will be distorted by the audio compression and will not be recognised. If the phone is set for RFC2833 and asterisk is set for inband then you may not hear anything

That's why!

If you are calling from an external line then it's a different codec or somthing.

Another option is to use dtmfmode=auto, but that didn't seem to work either.

DJ

Thursday, September 17, 2009

What to do when my PAP2 Web browser Interface keeps freezing

I was battling the user interface of my Linksys PAP2 web browser interface. Every time I would try to change a setting in the advaced area, it would freeze up and I'd have to force-close the browser and restart my job. I found that it helped to power-cycle the device after force-closing the browswer, but it wouldn't stop the problem from reoccuring. Finally, what i found that works great, is that you just disconnect your internet connection from the device. Likely you are behind a router, so just unplug the cable that goes from the router to the modem. Then, log into your device (it might be wise to power-cycle it again before opening your browser). Do all your settings, save your settings, and then power cycle your device again. Reconnect the internet and you should be good to go. This worked well for me.

Inbound calls failing on PAP2 with FreePBX

Also related to this topic, look for my post about "What to do when my PAP2 gui keeps freezing." here

FINAL EDIT 092709

My perseverance finally paid off. I almost went crazy but everything works now. The problem was two part:

1. For some reason when I changed the static IP of the PAP2 to .107, the gui changed over and I could now access the gui from that IP in the browser. HOWEVER...and very strangely, when I went into the 'system' settings I noticed the PAP2 static IP was still reading .100! How, I don't know, so I simply changed it to .107 one more time, saved, and power-cycled the device - and it started working.

2. I changed the nat settings to 'yes' and 'keep alive' in both lines.

3. I put all the SIP ports of both lines back to 5060

What a battle!

EDIT 091909

It turns out that everything I wrote below wasn't actually... that worth following but it may be of educational interest for anyone on our path. I would recommend reading it just to pick up a few troubleshooting ideas, maybe. The new update on this is this:

It seems as though the Nokia E71 was in conflict with the Linksys PAP2. The way I finally found this out (and an interesting and fast troubleshooting method, by the way) is I went to the 'active session' of my DI-524 router (D-link) and kept clicking it and watching the IP address activity. What I figured out by doing that was that, even though I had removed all the static IP address from my actual Nokia and changed it back to 'automatic' under the advanced access point settings, I was still seeing an IP address of .107 showing up in the active session list! That was my old Nokia static IP address. Why was it still showing up if it wasn't in the phone? Then it dawned on me that I had, under the home/DHCP section of the router, left the MAC address of the Nokia in the static DHCP client list. So, I guess what was happening was the router was registering the MAC address of my Nokia and force-feeding it an address of .107. Why my Nokia doesn't register with our PBX with that static IP manually in there is another question, but it seems that once I removed that and put the phone back to automatic (NOkia) and the PAP2 to 'static' but still with DHCP ability active, everything worked, including PSTN inbound calls to the PAP2.

We'll see if it lasts this way overnight!

---------------------

The archives of this are here:

After hacking a vonage box successfully (I'll post about that soonish) I had a random problem occur. I believe it's a good and quick learning experience to read through the process I went through, but you can skip to the '1 second solution' at the end if you'd like. There is an edit in the middle that was an interesting turn of events (if you think this stuff is interesting! ha)

I had set up two different extensions within the PAP2 device. All of the following were working perfectly:

-inbound calls from PSTN
-outbound calls to PSTN
-Extension-to-extension calls from within the same LAN (i.e. phone1 port to phone2 port call withing selfsame PAP2) (inbound and outbound)
-Extension-t0-extension calls from one LAN through a WAN and terminating at an extension at a different LAN (both directions) (inbound and outbound)

Then, without notice, I totally lost all functionality of phone2 of the PAP2, including all voicemail recordings we had done (the voicemail recording loss remains a mystery at the time of this posting). At the same time, though, it appeared that phone1 of the adaptor was ok.

The first thing I did was log into the PAP2 device. I assumed that the problem was because there were too many devices sharing the same 5060 port. So, I changed phone1 to 5062 and phone2 to 5063. They both registered and were able to call out. However, after a few hours, I figured out that all calls within that LAN were now only able to call out, but not receive calls from anywhere (LAN, WAN, PSTN, etc). All extensions within that LAN were now basically only able to to outbound calls.

So, I decided to go into my router and do a DMZ where I discovered that it seemed to work! So it was definitely a port problem in my LAN that was restricting inbound calls. But, I had all the ports open for this kind of application.

Randomly (and here comes the solution so far), I decided to set both phone1 and phone2 of the PAP2 to 5060. I was expecting a conflict but lo and behold - they both not only registered by were able to receive inbound calls from my separate Nokia E71 which was at a different extension in the same LAN.

I went back into my router and cleared out all the new ports I had opened during testing and it seemed to work just fine.

I now, however, have one remaining problem! It seems that the PAP2 device is working just fine in my LAN but now my Nokia E71 can register but cannot receive inbound calls from the PAP2 extensions! Grr. I hope to post a follow up to this with a solution soon.

EDIT:

It turns out that it was not much related to what I thought above either! After doing everything above, I still started encountering the same problems once I started making random calls to and fro internal extensions on my LAN. I remembered reading somewhere something about NAT and how it offers a helping hand when you are behind a router. However, in the Linksys PAP2 they call it 'NAT mapping' and I had never heard of the word 'mapping' attached to NAT so I was afraid to try it out. Finally, I just enabled it as a last resort and did a test to and from all the extensions and it worked...almost. And here is an interesting note for troubleshooting. I didn't want to wake up my family while I was ringing the extensions so I just engaged the extension to which I would be calling (picked up the phone) so that when I called it, if it was working, I would get the 'on the phone' message, instead of the 'unavailable' message. I assumed that if I got the 'on the phone' message that everything was working perfectly for receiving calls. All the extensions worked perfectly after enabling 'NAT mapping'. I was happy, but at the last second I decided to do one actual call to an extension to make it ring. It failed! It went straight to the 'unavailable' message. Discouraged I did a quick power-cycle of the PAP2 and boom. Everything worked again. It seems that now, I am fully back in action.

1 second solution:

in PAP2 interface enable "NAT MAPPING" for each line if you are behind a router.

What I learned (Summary):

1. After doing any major changes in the PAP2 settings, always power cycle when you are done to make sure everything is 'engaged'

2. Always try a DMZ on the device before going too far. At least then you can isolate the source (LAN, device, WAN, otherwise)

3. write down a list of your extensions and all the possible combinations that you will test like a spreadsheet like this:


.............................| setting change | result | setting change | result
ext1 > ext 2
ext 1 > ext 3

ext2 > ext 1
ext 2 > ext 3

ext3> ext1
ext3> ext 2

that way you are tracking your setting change and making sure you are testing both inbound and outbound calls




Wednesday, September 16, 2009

How to fix a 'An Error has occurred' message in FreePBX voicemail

I was messing around with ports in my hacked Vongage adaptor when something went wacky. After that, every time I picked up my extension, I got a message waiting indicator beep, but when I went to go in and check the message I got the 'An error has occurred' robot chick. I know she's just doing her job but it frustrated me. So, I decided to fix it before I went to bed. After a bunch of further messing with the ports, the solution turned out to be nice and simple. I love it when that happens. Here's how to fix it:

1. Log into your FreePBX
2. Go to your admin gui
3. go to the extension that's messing up
4. Disable the voicemail completely, submit, and then apply changes (reload)
5. Re-enable voicemail for that extension, submit, and then apply changes (reload)

Done. Your voicemail should be cranking out the sweet voice of your mother inviting you for dinner on Sunday....