Sunday, November 22, 2015

Wireless Video Over Mesh Network

Hello my Ham Friends:

Yes! I did it. And I'm excited to share with you all; how to setup a cell phone converted to wireless video camera. Transmitting both Audio and Video through a mesh network.

To fully understand how I got this far with mesh networking. I suggest reading my previous blogs for detailed how to step by step directions. It also provides a wealth of highly detailed information I have found during my research.

What is a Mesh Network

Getting Started with Mesh Networking

Mesh Networking for Ham Radio


If you are going to follow what I did here. You're going to need a cell phone you can use as a camera. In my case I used my old cell phone, as well as my new and current cell phone. They both worked equally with no trouble at all.

Next I would suggest using cell phone software similar to IP Webcam Pro or Third Eye - Wireless Monitoring. One works with Android the other with Apple IoS. You may or may not have to pay a small fee for use.

Now for some ground rules to get your network working.

1. You'll need a minimum of three routers. 1 for Access Point, 2 for Mesh routing. (explained later)
2. Each router will need to be the same model and able to take the same version of Firmware.

Follow these two simple rules, and you will save yourself a lot of trouble shooting when your system is not working. You might have to do some trouble shooting, but those rules will knock out most of the issues off the bat.

Why same model?

Some models of the same brand of router, will not have the same WiFi-Transceiver chip. If there are different Transceiver chips you may run into some incompatibility problems between two routers. You can often determine the chips by looking for a router version number. Most likely placed near the sticker with the serial number. Or close to the Mac address.

In my mesh system, I'm actually using versions 1, 2, and 3 of the same model. but since they all have the same transceiver. I run into no issues.

There may also be memory space issues. Also determined by version number. Needless to say, when you choose a router. try to get 3 - 5 of the same model and version if you can. If you're cheap like me, you might end up getting used routers from a used store somewhere. some of which might not be working. so on the side of error, I chose to get 5. If they all work, then you have the ability to expand your network without the hassle of looking for more.

To do what I did, you will need to sacrifice one of your mesh routers and make it an Access Point. In general, an Access Point will allow for you to have the ability to use WiFi over your mesh network.

Example: Internet ---> Mesh Gateway --> Mesh Router --> Access Point --> Wireless Device.

For you to make your mesh router into an Access Point, you'll need to first upload new firmware to the router. The firmware will first turn the router into a Mesh Router. Within the setup feature of your router, you'll need to define that the router is to be used as an Access Point. How to upload new firmware; can be found ( Here ).

Once the new firmware is uploaded, you'll need to test the router and see if it is working.

If you get the screen above by typing LOCALNODE:8080 in your url address bar, then your router is in working condition after you upload the firmware update. now click on the SETUP button.


Type in ROOT for username and the default password hsmm.

Next to Node Type, select Mesh Access Point. Change your SSID for your access point. Example: KD6VZQ-AP.

Save Changes and then Reboot router.

Once you reboot this router it becomes and access point. you will no longer be able to configure it by going to LOCALNODE:8080 because there is no configuration needed. It just becomes a passive device that help you connect wireless devices to your mesh network.

If you were to try and get a wireless device connected at this point it will not work. It will not assign an IP to your device at this time. The access point is basically a bridge between the wireless device and mesh network.

To get things working you would need to connect your Access Point to a Mesh Router that is already configured to be part of a Mesh Network. This would be an actual physical connection through the LAN Ports on the back of the Access Point and Mesh Router.


Using the picture above as an example. The Access Point acts as a wireless bridge between the Cell Phone and Mesh Router. The Cell Phone will get connected to Access Point, but receives its assign IP address from the Mesh Router. You can test this by removing the Ethernet cable or Power from the Mesh Router.

At this point you can also test to see if your Cell Phone camera is working with the assigned IP from the Mesh Router.

Your phone should tell you what IP to type into your URL address bar.


Cell phone gives 10.162.195.107 Port 8080 (port number separated by colon)

Now we have an IP to look for.. We need to connect a computer to the Mesh Router directly via a cable. No need to login to Mesh Router, just connect a cable.

We would then make sure that our wifi on computer or laptop is off. This is to be absolutely sure that you are communicating through the Mesh Router.

Computer is booted, Mesh Router connected to computer. Open a web browser (Chrome, Firefox, IE, etc. . .) and type in the IP address you got from the camera.


Nice.. we're about 90% done. We now know that everything right up to the first Mesh Router is working. And Mesh Router should be relaying your signal through out the mesh network.

But for the moment it is not. You would actually need to get Mesh Router M1 to announce the link of the Cell Phone Camera to other parts of the mesh network.

Login to your Mesh Router M1 and go to SETUP button at top.

Once in the SETUP area, select Port Forwarding, DHCP, and Services.


To the left under DHCP Address Reservations, you will want to select the IP your Cell Phone Camera was given. Then you will give it a HOSTNAME. the Mac address should come up automatically.. if it does not, look to see if it isn't already listed under DHCP Leases. Click on ADD button when done.

To the right under Advertised Services You want to type in a name for a visible link. Please a check mark in the Link box. Define the protocol (IP Cams use HTTP for protocol) Look for the Hostname under URL. If you don't know the port number the camera is using, it will be defined in the URL the camera gives you.  (Example: Http://255.256.254.44:8080) Most IP cameras use port 8080. click on Save Changes and then Reboot.

All configuration is complete. Next thing to do is to see if the other Mesh Routers see an additional link being advertised.

Login to the Mesh Router M2 using a Ethernet cable to laptop. Go to the Mesh Status page by clicking button at top.


Click on the link and your IP Camera should come up.

And there you have it, and Audio / Video signal over a mesh network.

I hope that my Mesh Network series on my blogspot here helps you and future hams understand how to get a network in working order.

 Thanks much for reading all this wonderful information. Please feel free to share it with friends.

KD6VZQ

Thursday, November 12, 2015

Mesh Networking for Ham Radio

Welcome Ham friends de KD6VZQ

If you have not already done so I would suggest reading previous posts I've created on this subject. It would help with understanding some of the geeky information I'm about to provide.

Posts are ( Here ) and ( Here )

For Hams, I'll be showing BroadBand-Hamnet. This is the firmware that is more focused for ham radio operations. I will not be demonstrating DD-WRT. For those of us who prefer a more advanced system, I would suggest DD-WRT.

The information I'm providing here is all information on a larger puzzle. If after you get your routing system working, and in need of additional information for trouble shooting. My hope is that the information provided here will help you.

If you are just wanting to install the firmware, you can skip to the installation process from here. Now for the fun stuff.

Some brief definitions:

NODE - Any system or device connected to a network is called a node.

GATEWAY - A gateway is a network point that acts as an entrance to another network. In this case your mesh router connected to internet.

WDS - Wireless Distribution System and is a feature supported by an increasing number of 802.11 access points. (AP) Simply put, it enables single-radio APs to be wirelessly connected instead of using a wired Ethernet connection. Think of this as wireless repeater mode. In this mode the router can communicate wirelessly with another router that supports WDS.

MAC address - A MAC address is a hardware identification number that uniquely identifies each device on a network. The MAC address is manufactured into every network card, such as an Ethernet card, Wi-Fi card, or Router, and therefore cannot be changed.

FIRMWARE - software that is embedded in hardware, allowing for hardware to do its function.

Example: you do not need a computer to be hooked up to a router, in order for the router to work. The Router will function on its own with instruction from its own firmware.

Some general information:

Pay close attention to Router hardware Make, Model, and Version numbers that you get. Reason being is that the Wi-Fi CPU ( Main Wi-Fi chip on circuit board ) needs to match the other mesh router Wi-Fi CPU. If it's the same chip Manufacture ( Broadcom, Atheros, Marvell, Ralink ) but a different version of the same chip. You have about a 50% chance of the two routers communicating. If the two chips were of same manufacture and version number. Then you would have 100% chance of communication between routers. If you were to have two routers from different manufactures, there is still a chance it will work. but it is a small chance. A big part of this is comes from Manufactures not wanting for there chips to speak with another manufactures chip. It would be like Intel and AMD collaborating to build the best computer in the world by sharing their technologies with each other. It simply just isn't going to happen anytime soon.

You won't be able to know what chip a router has unless you were to take a look at the circuit board directly. Most of us most likely wouldn't want to do that. So I suggest that if you are not comfortable taking apart your router to look at the chip; you get multiple routers of the same manufacture and same version number. It might help reduce any trouble shooting you might need to do in the future.

Difference between a Hub and a Router:

The functions of the two devices — the hub, and router — are quite different from one another, even if at times they are integrated into a single device. Which one do you use when? Let's take a look...

Hub

A common connection point for devices in a network. Hubs are commonly used to connect segments of a LAN. A hub contains multiple ports. When a packet arrives at one port, it is copied to the other ports so that all segments of the LAN can see all packets.

Router

A device that forwards data packets along networks. A router is connected to at least two networks, commonly two LANs or WANs or a LAN and its ISPs network. Routers are located at gateways, the places where two or more networks connect. Routers use headers and forwarding tables to determine the best path for forwarding the packets, and they use protocols such as ICMP to communicate with each other and configure the best route between any two hosts.

Mesh routing systems act more like hubs. They repeat everything on the network. It goes in one port on a router somewhere in the mesh and gets repeated to all other routers and ports on the mesh. You can also use the mesh router as a gateway connection. providing access to another network or internet.

Wireless mesh networks can self form and self heal

Unlike nodes in a star topology, (star topology is your standard home network) which require a router to deliver Internet service, network nodes can "talk" directly to each other without requiring the assistance of an Internet connection. A big advantage of this decentralized topology is that there cannot be a single point of failure (SPoF). If one node can no longer operate, all the rest can still communicate with each other, directly or through one or more intermediate nodes.

Mesh networks can use a full mesh topology or a partial mesh topology. In a full mesh topology, each network node is connected to all the other nodes in the network. In a partial mesh topology, at least one node connects directly to every other node while others may only connect to those nodes they exchange data with on a frequent basis.

Maximum Transmit Power

As always, Hams must operate under FCC Part 97 rules and regulations:  
no music, no profanity, no business activity, etc.

Maximum Transmitter Power Output (TPO) is 100 watts (or 50dBm), although we will probably never encounter more than a couple watts.

The Node Name (included with every transmission) must include your call sign. Common practice is to append a few additional identifying characters (e.g., KD6VZQ-M2), since your call sign may be associated with several nodes.

Only licensed amateur radio operators should be able to access Part 97 hardware (in this case, modified Part 15 devices). So, take steps to prevent unauthorized users.

EIRP and Antenna Gain

The following formula can be used to calculate the EIRP limit related RF power based on selected antennas (antenna gain) and feeder (Coaxial Cable loss):


EIRP = Tx RF Power (dBm)+GA (dB) - FL (dB)

The following table describes this formula:
Formula ElementDescription
EIRPLimit specified by Part 97 (100 Watts) maximum power
Tx RF PowerRF power measured at RF connector of the Mesh Router
GAGain of the Antenna you intend to use
FLCoaxial cable line loss / Feed Line loss

Calculating Line Loss

There are a lot of types of coax cables I'll list a few of the common ones in regards to Wi-Fi use.

Cable Sizes Commonly Used for 2.4 GHz
Cable Diameter Line Loss at 2.4 GHz (per 100 feet)
LMR-100 1/10" -38.9 dB
LMR-240 3/16" -12.7 dB
LMR-400 3/8" -6.6 dB
LMR-600 1/2" -4.4 dB

Wi-Fi radio transceiver effectiveness is described as a measurement of power output and receive sensitivity. Generally, these two measurements are expressed as power in milliwatts (expressed as mW, meaning 1/1000 of a watt) or as “dBm” (decibels related to 1 mW).

Decibel measurement can be confusing. But there are two key concepts to make this easy to understand:

1: Decibels are relationship-oriented

2: Decibels double by threes

Relationship-oriented means that there is no set value for a dB. The trailing letter in a dB measurement defines the relationship. For example, dBm means decibels related to 1 mW of power. 1 dBm equals 1 mW. When you know the value of the relationship, decibels are easy to calculate.

Doubling by threes is due to the logarithmic nature of RF energy.When comparing a signal of 1 dBm (1 mW) to a signal of 3 dBm (2 mW) you see that it’s double the power. This doubling nature of power measurement or line loss makes it easy to see how a cable can quickly reduce the RF signal to almost nothing.

dBm = TxP - FL (FL in decibels / dB)

Description
TxP Transmit power out from router
FL Coaxial Cable / Feed Line loss
dBm Milliwatts measured in Decibels

Continuing the last example (LMR-100 versus LMR-400), let’s start with a signal of 100 mW ( 20 dBm) and send it out along the 100 foot–cable. Start with the transmit power, 20 dBm or 100 mW, subtract the negative dB of line loss, and the result is the power at the other end of the cable:

1. LMR-100 (38.9 dB loss): 20 dBm 38.9 dB 18.9 dBm (about 0.001 mW)

2. LMR-400 (6.6 dB loss): 20 dBm 6.6 dB 13.4 dBm (about 20 mW)

In each case, it’s a large drop. But look at the difference! LMR-100 drops power to a tiny fraction of the original signal. LMR-400, on the other hand, while inefficient, still has a usable signal.

In general the fatter and shorter the cable the better. No cable is even better; as there will be no loss to measure from a cable. Keeping loss in mind. If you're going to place your router 30 feet in the air. Plan on having a way to make it easily reachable in case there is a need for trouble shooting. You could get an amplifier, but they're still a bit pricey and hard to come by for the time being.

INSTALLATION of Mesh Firmware

By special request from various hams who know me personally. I'll be providing step by step instructions with screen shots. Instead of helping each Ham individually. I'll be helping a broad base of Hams all at once with these set of directions.

If you have not read my previous post on Getting Started with Mesh Networking. I would highly suggest you read it ( HERE ). I'll be assuming that you have at the very least read that helpful information before moving forward. Also as this post is geared towards Hams getting started with understanding mesh networking. I'll be using the firmware provided by Broadband-Hamnet.

One note about pictures and graphics. This free service from Google Blogspot is free. And I have limited control of the photo / picture size you might see. If you are in need of more larger details of photo. Simply click on the photo / picture and it will take you to the location of the original picture with greater detail.

Now to the fun stuff:

Find a Router you can use. I've already done the research ahead of time as to which routers I will be able to use. Hopefully you will do the same before you head out to purchase a used router.




Be sure to check the bottom of the router for version number.





Gather your tools of the trade. During this install I'm using my trusty Raspberry Pi B+ operating with Ubuntu Linux. I'm in the process of testing a battery with it as well. The Router I'm gong to use for this demonstration. A Cat 5 / Ethernet cable, and power supply for Router.



Boot up the computer you are going to use to reprogram your router.


 Open up your internet browser of choice and go to Broadband-Hamnet.org


 On menu to left side click on Software Download and Select Linksys on following menu


 Find your router in the list of available downloads for various routers.


Download and Save your file to local machine.


Once file is downloaded and save to your local machine, double check it has been saved. Next we disconnect our machine from the internet. Make note of where you saved the file on your machine.


After we've confirmed that we are disconnected from the net. We hook up our computer to the router we are prepping to re-program. Take a Cat 5 cable and hook it to the computer, and the other end to one of the 4 ports on the back of the router. Plug the router power in and wait for about a minute for router booting process to complete.


 After router has completed its booting process, it should have assigned a new IP to your computer. If it has not you can do two things. The first is to manually tell your computer to renew its IP. And the second is simply to reboot your computer. Rebooting your computer forces everything to renew. I don't like to reboot because that takes too long, but when all else fails. . . Reboot.. :)

Now that your computer has got a new IP. You should be able to communicate with the router by opening up your internet browser of choice and in the URL bar type in the following IP address. 192.168.1.1


If you're are lucky. You have a router where the default username ( ADMIN ) and default password ( ADMIN ) has not been changed before your got your hands on it. If your not so luck. well its easy enough to get around that. Just a few extra steps. Though you may need to confirm the process with the manufacture if my suggestion does not work.

1. Un-Plug router from power
2. Hold down the reset button at the back of the router. (might need paper clip)
3. Continue holding the reset button down while your plug the power back in.
4. Still holding the reset button wait for router to complete booting. about one minute.

In most cases this process works and resets the router to factory defaults. If it doesn't work you may need to find manufacture documentation on the process. You can usually find it online.



After a successful login, your should see a similar screen. Click on administration to right. near top of screen. Then click on Firmware upgrade.


 Click on the Browse button to locate the file you had downloaded from Broadband-Hamnet

 Once you have located the file. Click on upgrade to start the re-programming process.


After re-programming has commenced, you will notice that you will not be able to get to the router like before.



This is ok. we just reprogrammed the router and it now has a different set up rules for operation. One of which is a different set of IPs to operate with. You will need to renew your IP address like you just did previously. After getting a New IP from the router. You should be able to login.


So we open our internet browser and type in the following address. localnode:8080 to get to the screen above. Click on the Setup button to login to your newly programmed router.


You should get a login prompt. the default username is root and the default password is hsmm
You should gain entry to the setup screen.



Welcome to the setup screen. You will need to change two things before your router will work. First is to change the node name, preferably something with your callsign in it. As you see in this example I put KD6VZQ-M2-RPI. place something with in reason in your node name. The second is a required password change. Make careful note what your password is. If you loose it, it will not be easy to access the router if password is lost. After making changes click on the Reboot button at top. Reboot will take about 2 minutes maximum. If router doesn't come back up you might need to restart the router and / or your computer.

After a full reboot and getting back to localnode:8080 click on the button that says Mesh Status. it'll provide you with information on local mesh routers that is it connected with. Keep in mind that in order for a Mesh Router to communicate with another, its SSID must be exactly the same character for character. example: Hsmm is different than hsmm. Caps counts.

 If you have more than one working router. They will see each other and you will have started building a Mesh Topology network.

Thanks much for reading this Mesh Networking post for Hams. I hope that the information provided during this post had some value of helpful information for you.

73's de KD6VZQ - Tracy Thibault