README 6.99 KB
Newer Older
1
2
This README file last updated: april 2018  
  
Eric - kg6wxc's avatar
Eric - kg6wxc committed
3
4
REQUIREMENTS:
-------------
5
6
7
8
9
10
Apache webserver (or equiv)  
PHP  
PHP mysqli extension   
MySQL/MariaDB  
An available AREDN Mesh node, preferably connected to an AREDN network...  
Map Tiles, either in a static directory or available via some tile server.  
Eric - kg6wxc's avatar
Eric - kg6wxc committed
11

Eric - kg6wxc's avatar
Eric - kg6wxc committed
12
13
MAP TILE SERVER INFO
-------------
14
15
16
**Without a map tile server or static tiles, Mesh users may not see any map tiles.**  
On the mesh, you *cannot* expect the client to have internet access in order to retrieve the tiles, you must provide them yourself, one way or another.  
The main map webpage will *try* and check for internet access in the near future. (it's in the works)  
Eric - kg6wxc's avatar
Eric - kg6wxc committed
17
  
18
19
20
21
22
It is *way* beyond the scope of this README file to help in setting up a map tile server.  
You are unfortunaly on your own there.  
It is a time consuming and computationaly expensive process, but can be done on "normal" hardware.  
It also takes 100's of GB of HD space if you want to map the entire world, and that *does not* include the tiles themselves, that is only for the data required to **make** the map tiles.  
A good place to start for more info is: [https://switch2osm.org/serving-tiles/](https://switch2osm.org/serving-tiles/)  
23
If you attempt it, be patient, you *will* get it wrong more than a few times but in the end you might be surprised. :)  
24
25
  
You might be able to convice KG6WXC to create local map tiles for you, if the area you want is in the USA...  
Eric - kg6wxc's avatar
Eric - kg6wxc committed
26

Eric - kg6wxc's avatar
Eric - kg6wxc committed
27
28
INITIAL SETUP FOR A RASPBIAN 9 (Stretch) SYSTEM
-------------
29
30
**1: Import the SQL file to create the database**  
*Example*:    sudo mysql < node_map.sql
31

32
**2: Create a user for the database, you might have to login to the mysql server as root.**  
33
34
35
36
37
Here is an example of creating a mySQL user on Raspbian (which would apply for most linuxes):  
	sudo mysql  
		CREATE USER 'mesh-map'@'localhost' IDENTIFIED BY 'password';  
		GRANT SELECT, DELETE, DROP, INSERT, TRIGGER, UPDATE on node_map.* TO 'mesh-map'@'localhost';  
		FLUSH PRIVLEGES;  
38

39
**3: Decompress user-files.tar.gz**  
40
41
42
43
44
*Example*: tar -zxvf user-files.tar.gz  
This will create the files for the settings, They are distributed in compressed format  
so that *your* files do not get overwritten when the rest of the scripts get updated.  
(if anyone has a better idea for how to keep the user edited files "away" from the git repo,  
yet still in the same directory, it'd be great to hear about it)  
45
  
46
47
48
49
The file scripts/user-settings.ini is probably the most important.  
It is **very important** to make sure your SQL username and password are correct in scripts/user-settings.ini!!  
Also important is, if the system that this is running on cannot resolve "localnode.local.mesh" you can  
change that in the user-settings.ini file.  
50
  
51
52
There are many other things you can change in the ini files. Default Map center position, the header messages, etc.  
*Please read* the comments in the user-settings.ini file for more info about the different settings.  
53
  
54
55
56
There is also a "custom.ini" file that can be used for more site specific overrides if needed.  
If you have a need to "hide" passwords, or set the system to use offline maps only, etc... this is the file to do it in.

57
**3.5: To make sure it is all working at this point is probably a good idea.**  
58
59
60
61
62
63
64
65
66
You should now be able to run get-map-info.php from the scripts directory.  
I would suggest giving it a test run first.  
Run it like this for test mode: ./get-map-info.php --test-mode-no-sql  
That will just make sure the scripts can reach your localnode and the rest of the network.  
With --test-mode-no-sql, the script will output it's progress, but is not updating the database.  
  
If the --test-mode-no-sql is successful, you can go ahead and run the script with --test-mode-with-sql or just without any arguments.  
Run: ./get-map-info.php --test-mode-with-sql to have it output it's progress and update the database.  
Run: ./get-map-info.php without arguments for "normal" mode, where there is no on screen output. (this is for cron)  
Eric - kg6wxc's avatar
Eric - kg6wxc committed
67

68
**4: Edit httpd-meshmap.conf to reflect the correct directories.**
Eric - kg6wxc's avatar
Eric - kg6wxc committed
69

70
**5: Copy httpd-meshmap.conf to the apache2 "Conf Available" directory, /etc/apache2/conf-available**  
71
72
Once the file is copied, run: sudo a2enconf httpd-meshmap  
If successful, it will tell you to reload apache, do so.  
73
*Other linux distibutions may require you to copy this file into /etc/httpd/extra and then edit /etc/httpd/httpd.conf and add the line: Include extra/httpd-meshmap.conf somewhere.*  
Eric - kg6wxc's avatar
Eric - kg6wxc committed
74

75
**6: Load up the page: http://myhostname/meshmap/index.php and you should hopefully see your data.**  
76
Map tiles are one of the biggest issues with something like this and are beyond the scope of this README file.
Eric - kg6wxc's avatar
Eric - kg6wxc committed
77

78
79
80
**7: The cronscript.sh file is to automatically run the polling script and can be run from cron every minute.**  
(or at whatever interval you choose)  
The script will only run when the polling intervals in the user-settings.ini file have expired.  
81
  
82
You **must** edit the cronscript.sh file and make sure the path to get-map-info.php is correct!  
83
84
85
86
87
88
  
A cron entry is as easy as this:
	* * * * * /home/pi/meshmap/cronscript.sh  
  
Use crontab -e to edit your users cron jobs.  
  
Eric - kg6wxc's avatar
Eric - kg6wxc committed
89
90
UPDATING
------------
91
92
Simply run a "git pull" from the meshmap directory and the scripts will be updated from the git repo.  
The user-settings.inc, meshmap-settings.ini, cronscript.sh, and custom.inc files will *not* be affected by updating.  
93
94
95
96
The settings in the ini files *may* still change in future versions.  
For now tho, if the ini files change, and you still have the old ones in use, things will probably break! Be Warned!  
Hopefully in the future this process can be more automated.  
  
97
If you make changes beyond the user editable files I encourage you to perhaps push the changes upstream, please contact kg6wxc@gmail.com if you wish to do so.  
98
  
99
I am making changes all the time, it would be a good idea to run "git pull" from time to time to find any updates.  
Eric - kg6wxc's avatar
Eric - kg6wxc committed
100
101
102

NOTES ON USAGE OF THE MAP PAGES
------------
103
104
105
106
107
108
109
110
http://(hostname)/meshmap/node_report.php will show you all the info in the DB without trying to map anything.  
This can be useful to see if all the data is there or to find nodes that have no location set. (or other issues)  
    
There is an "admin" page, which is still in the works, what is there now does work tho.  
Try to load up: http://(hostname)/meshmap/admin/admin.php in your web browser.  
I've tried to provide instructions on the admin pages themselves.  
From the admin pages you can "fix" a nodes location, which can be helpful for those users that forget the "-" in front of their longitude. :)  
The admin pages also allow for the addition of "Non Mesh" Markers, fire stations, police stations, EOC's , etc...  
Eric - kg6wxc's avatar
Eric - kg6wxc committed
111
112
113

CONTRIBUTING
------------
114
115
**Contribution is encouraged!!**  
I can't think of *everything*!  
116
If you find an improvement, typo, or whatever, please, send an email to kg6wxc@gmail.com and we can get you setup with write access if you'd like!  
117
118
119

CREDITS
------------
120
121
122
2016-2018 - Eric Satterlee / KG6WXC  
  
Addtional Credit to: Mark/N2MH and Glen/K6GSE for their work on this project.