====== Mesh Chat ======
Using Mesh Chat is easy: simply click on a Mesh Chat service and enter your callsign.
{{ meshchat01.png }}
{{ meshchat02.png?800 }}
At the moment, we have about half a dozen Mesh Chat instances that sync to each other:
|[[aredn>http://va7fi-linux.local.mesh/meshchat/ |VA7FI-Linux]] |Runs on a linux laptop and has a few GB of available space|
|[[aredn>http://va7lmp-1.local.mesh:8080/meshchat/ |VA7LMP-1]] |Runs on the hAP and has 512 kB of available space |
|[[aredn>http://ve7ax-2.local.mesh:8080/meshchat |VE7AX-2]] |Runs on the hAP and has 512 kB of available space |
|[[aredn>http://ve7kod-server2.local.mesh/meshchat/ |VE7KOD-server2]] |Runs on a linux server and has about 1.5 TB of available space.Currently offline.|
|[[aredn>http://ve7sst-home.local.mesh/meshchat |VE7SST-home]] |Runs on the hAP and has 512 kB of available space |
|[[aredn>http://ve7zdh-hap-1.local.mesh:8080/meshchat |VE7ZDH-hap-1]] |Runs on the hAP and has 512 kB of available space |
And if you're running [[https://linuxmint.com/|Linux Mint]], you can create a super convinient [[webapp|Web App]] to load it quickly without the clutter of a regular browser.
===== File Sharing =====
MeshChat can also be used for file sharing by clicking on the FILES tab at the top. The file will be physically stored on the node you are using at the moment, but can be accessed by all nodes. To delete a file, you must be logged into the MeshChat node that is storing the file.
{{ meshchatfiles.png }}
Also be mindful of the storage capacity of different nodes. When MeshChat is installed on a hAP, it only has 512 kB of space. In the example above, MeshChat is installed on a cheap Linux laptop and has almost 4 GB of free space.
|<100% - ->|
^ Mesh Chat on a hAP ^ Mesh Chat on a Linux Laptop |
| {{ storage01.png }} | {{ storage02.png }} |
===== Mesh Chat on a Linux Server =====
Before we get started with the details, let's have a look at the big picture. There are 3 different "names" that we'll have to keep track of:
* The AREDN Node name configured in the ''Basic Setup'' page. Mine in is ''VA7FI-HAP-1''. Yours will be different.
* The Hostname of the linux computer running the service. Mine is ''VA7FI-Linux''. Yours will be different.
* The Service name. Here we use ''MIMeshChat''. Use the same if you want your instance to sync with that one. This is also called the Mesh Chat "Zone".
Here's where that information shows up on the ''Node Status'' page once it's all done and ready:
{{ statuspage.png |}}
And in the Mesh Chat app:
{{ meshchat00.png |}}
In what follows, it'll be important to keep track of where to enter this information so it's configured properly.
==== Server Install ====
* Follow the steps in the Prerequisites section of the [[../linuxserver/home#prerequisites |Linux Server page]].
==== Mesh Chat Install ====
Following the instructions on [[http://www.trevorsbench.com/meshchat-messaging-for-mesh-networks |Trevorsbench]]:
* Download and install Mesh Chat:
wget https://s3.amazonaws.com/aredn/meshchat_1.02_all.deb
sudo dpkg -i meshchat_1.02_all.deb
* Edit the configuration file:
sudo pico /usr/lib/cgi-bin/meshchatconfig.pm
and edit the last two lines so that the zone matches the other Mesh Chat instances, and the node is the name of your AREDN node. In my case:
our $pi_zone = 'MIMeshChat';
our $local_meshchat_node = 'VA7FI-HAP-1';
On LinuxMint there's an issue that needs to be fixed before continuing. Essentially, the current setup uses files in the ''/tmp'' folder, which the Apache server is not allowed to edit. So the solution was to create that folder somewhere else and set the permissions properly.((The ''/tmp'' issue is discussed here: [[https://www.arednmesh.org/content/pi-meshchat-error-sending-message]]))
* Create these folders:
sudo mkdir /var/www/html/meshchat/tmp/
sudo mkdir /var/www/html/meshchat/tmp/meshchat/
* And change the ownership and permissions:
sudo chown www-data:www-data -R /var/www/html/meshchat/tmp/
sudo chmod 770 -R /var/www/html/meshchat/tmp/
* Edit the config file:
sudo pico /usr/lib/cgi-bin/meshchatconfig.pm
* And replace every instance of ''/tmp/'' by ''/var/www/html/meshchat/tmp/'' (line 2, and 18):
our $lock_fh;
our $meshchat_path = '/var/www/html/meshchat/tmp/meshchat';
...
our $tmp_upload_dir = '/var/www/html/meshchat/tmp/web/upload';
...
* For reference, the permissions for the files in ''/usr/lib/cgi-bin/'' are:
-rwxr-xr-x 1 www-data www-data meshchat
-rw-r--r-- 1 root root meshchatconfig.bac
-rw-r--r-- 1 www-data www-data meshchatconfig.pm
-rw-r--r-- 1 www-data www-data meshchatconfig-stretch.pm
-rw-r--r-- 1 www-data www-data meshchatlib.pm
* Restart the services:
sudo systemctl daemon-reload
sudo /etc/init.d/apache2 restart
sudo /etc/init.d/meshchatsync restart
At this point, you should be able to run Mesh Chat from the computer where it's installed using this address:
[[http://localhost/meshchat/]] \\
But it won't be able to talk to your AREDN node yet.
==== AREDN Configuration ====
If you had previously installed MeshChat 1.02 on a Raspberry PI or Linux machine and later upgraded your node to 3.22.6.0, you may notice that MeshChat stopped synching. The following instructions have been updated to help fix that.((See [[https://github.com/kn6plv/meshchat|kn6plv/meshchat]] (for AREDN in Lua) on Github, and this [[https://www.arednmesh.org/content/mesh-chat-3226|discussion]] on arednmesh.))
Install the ''meshchat-api'' package Note that this part may need to be done every time the node is upgraded. :
* For AREDN prior to v3.22.6.0, download [[https://s3.amazonaws.com/aredn/meshchat-api_1.02_all.ipk |meshchat-api 1.02]]
* For AREDN v3.22.6.0 or later, download [[https://github.com/hickey/meshchat/releases| meshchat-api_2.x_all.ipk]]
* From the ''Administration'' page, click on ''Upload Package'' Browse... to install it.
From the ''Port Forwarding, DHCP, ans Services'' page:
- Setup a DHCP Address Reservation for the Linux computer
- Advertise the service
- Forward WAN port 8080 to LAN port 80
- Don't for get to Save Changes
{{ meshchatportforwarding.png }}
===== References =====
Mesh Chat has gone through different maintainers since its original inception. As such, you might find information dispersed across different websites.
==== v0.4 – v1.02 ====
Original version by Trevor Paskett (K7FPV) was last updated in 2020.
* Github: https://github.com/tpaskett/meshchat/tree/master
* Personal Website: http://www.trevorsbench.com/meshchat-messaging-for-mesh-networks/
==== v2.0 – v2.10 ====
Tim Wilkinson (KN6PLV) maintained MeshChat up until September 2023
* Github: https://github.com/kn6plv/meshchat
==== v2.11 – ... ====
Gerard Hickey (WT0F) is the current MeshChat maintainer.
* https://github.com/hickey/meshchat/releases