Forth Estuary Experimental Data Network
Most of what can be achieved via FEEDNET is courtesy of open source software. The sheer hard work, altruism and inventiveness of all open source authors is gratefully acknowledged here.
Downloadable Raspberry PI 2 Image
What is it ?
A Raspberry PI2 makes an ideal server to provide VOIP, File Store, Email, IRC and web facilities across a mesh network. These powerful little computers can take a little time to set up for those not familiar with Linux. Presented here is a downloadable FEEDNET image that comes complete with all of these applications installed and a set of scripts that makes for easy configuration. It is the quickest way to add services to a mesh network.
Note: This image works well with the 512K PI, the PI+ and the PI2. Here is an applications and ports quick reference table:
What do I need to know to use it ?
You need to have some computer knowledge to get a MESH server working. You will be familiar with files, directories, downloading and installing applications. You will understand IP addressing sufficiently to enter addresses discovered from your Mesh node into the scripts that you run on the PI2 server. See at the foot of the page for FAQ. Many o the FAQs relate to networking concepts, not the image itself. You do need to be comfortable with networking!
You must prepare your answers to the following questions before you run the script:
When you are ready to start, boot up the PI and type the following command
Now follow the instructions and answer the questions to configure your machine. It should take you around 10 minutes. You can run the script as many times as you want if you change your mind.
Once you have finished the script, reserve the IP address of the PI and its MAX address and hostname on the Node Setup Screen under DHCP/PORTForwarding.
How to use the services once they are configured
You must give each email user an account on the pi.
Login as pi. Use the command "sudo adduser".
So for example create the user gm4wzg with "sudo adduser gm4wzg" and answer the questions to give a password. The other fields can be left blank.
Once a user is added they setup their email client on their own machine as follows. Note that you must use IMAP on your client for this image.
2. Mollify File Server
Point your web browser to xxxxxx.xxxxxxx.xxxxxx where the x represents the fully qualified domain name of your server. If your DNS is not configured correctly on the node yet you might need to use the actual IP address of your PI. If you have problems with the normal port, the server is listening on port 8090. So for example in my own case the http address is http://raynet.local.mesh:8090/
On the current image I forgot to change the title of the web server page - it currently shows Lothians and Fife Raynet. This file is located at /var/www/index.html and is easily edited using your favourite PI editor.
The username admin and password madrid_6madrid will get you access to the file server. You can then create users as required. There are files on Mollify that relate to our own tests. This gives you something to practice on. These can all be removed as part of your practice if you wish. Support pages are at www.mollify.org
3. Asterisk VOIP
Set up your IP phone to point at your server xxxxx.xxxxx.xxxxx using the extension number/authname that you desire with a password comprising the password that you chose on configuration and the extension number added as a suffix. e.g. lets say we chose the password "pass" at config time and you are trying to make extension 4001 work. Use the password "pass4001"
8000 is for testing. Call this number to hear a constantly looping recorded message.
8999 is Voicemail. Password is 1234 until reset by the owner.
Your own extension numbers are decided by you, and are entered into the config script when you set up fir the first time.
IP telephony software is readily available for Apple phones, android phones and PCs. I use Zoiper with Android and it works a treat with our PI images.
Uses the normal IRC port. Just point your IRC software at xxxxx.xxxxx.xxxxx and it should work. In our group everyone is advised to join the chatroom called #raynet.
Questions: We had some questions in email conversations and they are reproduced below in no particular order. Some of them go outside the scope of this server project and it is not strictly necessary to be conversant with all of the topics raised to get the server going.
Q: I have a number of Raspberry Pis: B, B+ and 2. I only have the one Pi 2, so is it worth using it for this, or will a less-powerful one do the job OK?
A: The image works well on all PI model Bs , B+ and 2.
Q: I have a WRT54GL v1.1 (16MB/4MB) and a WRT54GS v3 which has been upgraded to 64MB/8MB (currently running DD-WRT). I have another that also has an SD-card slot - I bought them in the 'States, already modded. Is it worth using the "larger" one, or is all that extra RAM going to be wasted? (Is there a better use I can put it to?) Could the one with the SD-Card slot be the TFTP server for the phones as well as acting as a node?
A: This doesn't relate to the image at all. A router with an SD card slot may be handy, but very few have them and since the PI server carries out all the server functions there is no point in looking especially to use a router with an SD card.
Q: Not all 8GB micro-SD cards are created equal! The first (no-name) one I tried was reported as about 160,000 sectors too small to fit your image. I swapped to using a SanDisk and that was fine.
A: This point has been added to the main instructions above - thank you.
Q: I didn't know all the answers [to the script questions] before I started, thinking I'd wing it, but I then found I had to fire up the Linksys node, which I'd only flashed with BBHN the day before, to find what the IP settings were.
A: Yep - you need to know ALL the answers before you start running the script.
Q: It would be handy to have advice on how to choose things like Domain and Host names, IP ranges and subnet masks (should they match/fit in with any other net that may be connected to, such as my home network, or can they/do they need to be different?). I don't know how Mesh interacts with an established network - my experience has all been with a single network (albeit quite complicated) and I'm not clear if Mesh is a separate network, or if not how it relates to others.
A: Realistically I would recommend doing a bit of reading and getting familiar with IP networking and Broadband Hamnet before setting up the server. The point of the image is to provide a ready built server with all the applications ready configured for your network - it wasn't to tell you how to configure your network and integrate it into your home network. There are security issues there and I would advise only doing this once you are confident. But here are some suggestions anyway - remember that there are lots of ways of doing this. Our advice as given above, remains that if you don't know the answer to what domain name you want to use that you leave it as local.mesh. The advice also remains to select an IP address in the range of your LAN on the mesh node you are connecting the PI to.
Q: What I need to know is if a Mesh Node acts as a router to connect outside of the Mesh network? I realise the Linksys WRTs *are* routers, but I'm not clear if that function is still being used when they're flashed for Mesh. I'm doing a lot of things at once - flashing and setting up a Linksys, setting up a Cisco phone, setting up a Pi, (as well as setting up another Pi as an APRS Digipeater - (I was granted an NoV for this recently) and at the moment I'm a bit swamped with unknowns .I understand IP addressing, and the /29 etc. notation (which indicates the number of 1 bits in the subnet mask, which I've never seen anyone say specifically - I don't know why there are two ways of indicating it!) but routing between networks is not something I've done beyond LAN-to-WAN on a router.
A: Your node decides on its own network range. In answer to a subsequent question I'm not sure that knowledge of the algorithm will make much difference to you but if you look at the /etc/config directory of the Linksys node you will find the scripts containing the algorithm for this choice. I really don't recommend bothering with this - all you need to know is the network address and the gateway address and the CDR (the /29 or subnet mask). For information on the CDR notation, google it, there are many, many explanations of subnet masking on the web - I just checked - 17 million results ! For anyone who wants to ask more questions on this point there are descriptions of the method on the OLSR website. OLSR is the networking system that Broadband Hamnet have repurposed for amateur radio use. But again, unless you knmow that you need to know how the address is chosen because you understand all of this uimplicitly, just ignore it - the address is important, not the method the router uses to choose it.
Your node will have its own IP address. Your node will run a DHCP server, the role of which is to give IP addresses away to anyone who asks who is connected to a LAN port. Make sure your node is set up for 13 host direct mode. Make a note of your node's LAN IP address from the main status screen. It will have /28 on the end because you set the mode to 13 host direct. If you have never attached anything else with a fixed IP address to the node before then add 1 to the node address. This is your new Raspberry PI address which can be entered in the script. Make sure you use the node setup screen to go to port forwarding/DHCP and reserve the IP address that you have just given, against the MAC address from the PI and the hostname that you gave to the PI .
Q: OK, I dont' remember seeing that said anywhere, and it defaults to 5 host direct mode, so that explains the /29 range rather than the /28 in the instructions.
A: It wasn't said because it isn't necessary to change it. I notice many of our US brethren don't bother making that change (if they did they would probably make it part of the package). But I do it. The only important thing is to make your network choices consistent and we've covered that elsewhere. Remember that this is about providing an image for a server - for general MESH questions I refer you to the broadband hamnet forums.
Q: Is there an IPCONFIG or IFCONFIG command on the Pi? That way I can confirm the address it's been given?
A: PI is one of the most supported machines on the planet. Google "how to check IP address on PI" and take your pick. ifconfig will show you most of what you need but not all. For problems relating to editing files, file locations, PI passwords, IP routing, IPTables there are much better explanations on the web than I can ever give here. If you are going to support a PI server you'll need to keep that google button hot ! Ask any of the FEEDNET team though if you're stuck or don't understand something that you're reading.
Q: Incidentally, having this [the mesh LAN mode] set to 13 doesn't fit with your advice on the web page to specify 20 telephones ?
A: The reason I suggest at least 20 telephones is that its quite a reasonable number for a typical RAYNET group (40 might be better for many) In your networking environment probably none of the telephones will be on the same subnet as the PI. Maybe one - your own. So the advice does not clash at all. The twenty or forty telephones will be all over the place connected to other nodes using their own IP ranges. I gave sound advice, it is correct and any thoughts otherwise are just wrong. Sorry !
Many hundreds, indeed thousands theoretically can connect to different points of a large mesh network. Only 12 can connect to your mesh node directly with a cable (you'll need a switch of course or a wifi access point). But any server must be configured for the end number of users, not those just attached to the local subnet. Google is used by over a billion people for example but they don’t have a billon addresses on their local subnet !
Q: For the Cisco 7940 I believe I'll need to set up the Pi as a TFTP erver, and set the Linksys to point there as part of DHCP, how do I do these?
A: The PI image is configured already with a TFTP server and Cisco/VOIP will work from word go.
Q: Ah I didn't know that - so already set up with a TFTP server, an email server, and a Web server - anything else?
A: Raspberry PI2 makes an ideal server to provide VOIP, File Store, Email, IRC and web facilities across a mesh network. These powerful little computers can take a little time to set up for those not familiar with Linux. Presented here is a downloadable FEEDNET image that comes complete with all of these applications . On the service page elsewhere on the web there are a lot of details about these applications.
The files your 7940 need are in the appropriate server directory already. Don't touch them directly at this stage and if you copy anything over from another Cisco system then I advise starting again with a fresh image.
You need to enter the MAC address of your telephone in upper case when asked during the script setup. This will modify the TFTP server files accordingly and your telephone should work immediately - once it knows where your PI is located.:
Q: I understand one of the config files for the phone needs its MAC address in its name - are you saying the Pi has already done that when I entered the info above?
A: Yes, the point of the script is to ask you questions, then rewrite the config files to make a basic working system. If you answer the questions correctly, you get a working system. In the case of the CISCO, if you ensure that the Telephone is looking at the PI for its TFTP service (the only bit outside of my control regarding the PI image) it will load all the correct configs including the firmware that it needs (standard Cisco practice to check firmware on every switch-on). I really don't want to sound patronising (I get into trouble :-) but I've known people give up after weeks of trying to get Cisco phones working. You will do better than that but don't underestimate the process either. Cisco are very nice, but unless you already know how to use them, or want to spend some time, or use a prebuilt server like the one I set up for you, then they are not always worth it. My recommendation is to use the script, put the MAC address in and provide the number range. in order to use the default configuration.
Q: Also, not sure of the format of the MAC address to type in - is it just the digits, as on the 7940 label, or with colons between the digit-pairs, as is usually done?
A: The MAC address should be entered upper case and without colons.
Q: How do I make my phone look at the correct place for a TFTP server.
A: You need start an SSH session with your linksys and edit the following file using the vi command:
You need to enter the line that I show you below starting with
It needs to be EXACTLY correct but with the address of your PI replacing the address of my PI as shown below.
# other useful options:
# default route(s):
# dns server(s):
If you make mistakes here you may need to reset your node.
If you EVER save a new config item on your node you will need to repeat this process as it will be overwritten.
Q: Understood [ about resetting the node]. Is there no way to save this and copy it back rather than editing the file each time?
A: Yes - you can write a script. But you'll have to load the script when you flash the router and I tend to not make too many changes to the routers config once its finished so I'm happy with it as it is. You only need to do the DHCP change on nodes that have Cisco Telephones directly connected to them. For other VOIP stuff it is totally unnecessary and serves no purpose.
Q: At the end of setting up the Pi with your image file, it boots to a command line, and I have no idea what to do next!
A: Have a good long slow cold beer. You are finished That command line is telling you that you have configured an email server, web server, TFTP server, IRC server, SSH server in the sapce of ten minutes !
Q: Unfortunately at the moment I don't have spare "workbench space" so every time I want to play with this stuff I have to set up the Pi, its keyboard, its monitor, the Linksys, a laptop to talk to them, perhaps the 7940, and then disconnect/put away everything at the end.
A: No monitor or keybaord needed - use SSH. Look it up on the web there are hundreds of thousands of references and it takes two minutes to figure out. Old mobile phones are good for VOIP testing. I use the Zoiper application.
Q: I got the IP addresses out by 1 on the Pi: 208/209 instead of 209/210 for Network/Node. Shall I rerun the firsttime script to change these, or is there an easier way?
A: You can rerun the script or you can change them in the /etc/network/interfaces file. If you choose the latter you will have to edit all the server config files accordingly using vi. You'll neeed to know what they are and where they are. You'll need to know which bits need changing. Some are hundreds of lines long. Its actually very timeconsuming suporting a simple written script - impossible to advise on how to configure several applicaiotns. In fact pointless too, its all there on the web. The web server is lighttpd. You can google it for example and see how to setup the config file and where you need to put the IP address. Personally I do think its better to use the script. I know that when the script is used, all the services work. This knowledge is helpful because if you have a problem it almost certainly means its your client config that needs looking at.
Q: Can you point me to the instructions for the next stage, please?
A: It depends on what you want to do. The script saves you from researching how to make changes manually. If you want to make changes manuallly you need to look at the manuals for each application - Asterisk, for example has several config files and ultimately you need to know how to use them if you're going to run a server. Our image gets you a working system with a minimum of knowledge. To do more, you need to learn more. But very importantly, only those that want to operate servers need learn all this stuff - other RAYNET team members just configure their PCs with their new RAYNET email addresses and they send and receive photos, configure their phones for VOIP and make and receive calls.
Q: I'm new to Pi and almost all instructions about installing new things start with the ...update and ...upgrade instructions, so I assumed it was standard practice. Should I be upgrading ? What distro is your image based on ?
A: You can upgrade it if you want. Its just about priorities. I think if you want to implement this image and run a server for a group when you do not have a lot of Linux knowledge you've gotsufficient work to do without the issues that upgrading might bring (although usually it is fine).. The image is Raspbian Wheezy, a derivative of Debian. It was up-to-date March 2015. If you want to know the versions of all the software that go to make up this image then google the use of dpkg and apt-get. Sometimes you need to know these things so its worth gaining the knowledge. For example the Asterisk software was branched three years ago for the version which has the amateur radio repeater software in it, so you don't necessarily want the most up to date version of Asterisk as it might not do everything you want. That's just an example. I recommend not doing any updates for many, many months yet. Your time is betters spent learning how servers work. We may release another image in a few months and that might be the best way to do your update - by then you will know the answers to the questions for the script and it really does only then take a few minutes to set up a new PI SD card
Comment Box is loading comments...