Still waiting for someone to discover how to fix the "Could not get Lock" error in MeshChat. I wish I knew how to do programing so I could troubleshoot the problem.
As mentioned above, the "Could not get a lock" issue is not a problem in the MeshChat code itself. The issue results from how the latest Apache web server is configured to allow or deny use of the /tmp directory. Either fix the permissions in Apache as described here & change the permissions on the lock file as described here (restart Apache afterward), or point MeshChat to a different $meshchat_path where it can put its lock file such as "/var/www/html/meshchat" in your /usr/lib/cgi-bin/meshchatconfig.pm file which eliminates using the /tmp directory altogether (restart meshchatsync afterward).
I have MeshChat 1.02 installed on the R-Pi 3B and the API installed on the AREDN node (a NanoStation Loco M2 XM) with 3.20.3.1 firmware. The last step in Trevor's install instructions is to edit the meshchatconfig.pm file to show service name and node name. I think I am using the GEANY text editor in the R-Pi to make the edits. The R-Pi refuses to accept the SAVE command. uname -a shows Linux 4.19.75-V7+ of 24 Sep 2019. Any suggestions?
This may be a permissions issue.
Do a 'ls -l' on the filename.
Wild guess: the file you are editing is 'owned' by 'pi' and you are editing as a user '<username>'.
If this is a permissions issue:
logon as the owner of the file (su <ownername>) or
preface the invocation your console text editor with 'sudo' as in 'sudo GEANY <filename>' or
if GEANY is a GUI editor, please use a console text editor.
'vi' is the standard/classic/legacy text editor.
I am a dinosaur and use an old editor, 'joe', because I first leaned 'Wordstar' back around 1978-1983.
In trying to open the meshchatconfig.pm file, I saw a message that it was already opened by another editor. Probably relic of my trying to work it before. Yes, GEANY is a GUI editor. Raspberry Pi OS distribution apparently has VIM, NANO, and maybe other editors, but did not have JOE.
I had seen something about folks using NANO text editor, so I did all the CDs up and down to get to the file, then nano <filename> to work it. I've never used NANO before, and it has probably been decades since I used any legacy text editor. I did sudo su before starting, hopefully to give me enough privileges. Apprehensive, I scrolled to the file end, changed our $ local_meshchat_node = '<my AREDN node name> ', then CTRL+Y, CTRL+S (belt and suspenders), and CTRL+X to get out.
I opened the file, and it does appear to be correct and ready to go. Now on to the next set of problems
This is for the benefit of the community. I was having one-way sync issues. My MeshChat program, installed on a Raspberry PI Zero, was receiving messages from other nodes, but not sending messages.
After watching this video, I checked ports on my external router and in my node forwarding settings.
I'm not sure why, but this guy recommends forwarding port 8080 to port 80 of the node to of the meshchat device. I did that. I don't know if it made a difference. But something else seems to have worked...
It turns out my external router had a port forward setting for port 8080 directed to my HAP LITE. I remember setting this up to give somebody access to the settings page of my node via the Internet. I turned off the port forwarding on the external router and now two way sync is working.
This is an attempt to summarize the instructions for fixing the "Could not get Lock" issue that folks see when setting up MeshChat on new versions of Raspbian. I just went through another install from scratch (first time in years), and had to re-learn this all over again. Hopefully this summary of several previous comments will save others some time.
Once you have your Raspberry Pi set up and MeshChat installed, run the following commands in the terminal:
Change permissions on the lock file:
sudo chmod 0666 /tmp/meshchat/lock
Shut down the apache process:
sudo systemctl stop apache2
Copy the Apache2 startup config file to the user systemd area:
Using your favorite editor, modify the apache2.service file, for example:
sudo nano /etc/systemd/system/apache2.service
Change the PrivateTmp=true parameter to PrivateTmp=false
Hint: in the Nano editor use Ctrl-X or Cmd-X to exit, Y to save, Enter/Return to confirm filename
Reload the system control daemon:
sudo systemctl daemon-reload
Restart the Apache process:
sudo systemctl start apache2
Reboot the Pi:
sudo reboot
If you've correctly installed the latest MeshChat API package (currently on Github) on the local node, and set up the service link, then sending messages and syncing should all work now.
Hopefully I got that all right. Let me know if anyone sees issues. de KJ6WEG
I was having problems with my MeshChat node (http://km6zpo-meshchat.local.mesh/meshchat/) syncing after several Hap firmware upgrades. Nothing had changed about my MeshChat software - didn't even do any system updates - so I was baffled. I am currently running:
firmware version:
model:
20240124-f3d49ea
MikroTik RouterBOARD 952Ui-5ac2nD (hAP ac lite)
As mentioned above, the "Could not get a lock" issue is not a problem in the MeshChat code itself. The issue results from how the latest Apache web server is configured to allow or deny use of the /tmp directory. Either fix the permissions in Apache as described here & change the permissions on the lock file as described here (restart Apache afterward), or point MeshChat to a different $meshchat_path where it can put its lock file such as "/var/www/html/meshchat" in your /usr/lib/cgi-bin/meshchatconfig.pm file which eliminates using the /tmp directory altogether (restart meshchatsync afterward).
I have MeshChat 1.02 installed on the R-Pi 3B and the API installed on the AREDN node (a NanoStation Loco M2 XM) with 3.20.3.1 firmware. The last step in Trevor's install instructions is to edit the meshchatconfig.pm file to show service name and node name. I think I am using the GEANY text editor in the R-Pi to make the edits. The R-Pi refuses to accept the SAVE command. uname -a shows Linux 4.19.75-V7+ of 24 Sep 2019. Any suggestions?
This may be a permissions issue.
Do a 'ls -l' on the filename.
Wild guess: the file you are editing is 'owned' by 'pi' and you are editing as a user '<username>'.
If this is a permissions issue:
'vi' is the standard/classic/legacy text editor.
I am a dinosaur and use an old editor, 'joe', because I first leaned 'Wordstar' back around 1978-1983.
In trying to open the meshchatconfig.pm file, I saw a message that it was already opened by another editor. Probably relic of my trying to work it before. Yes, GEANY is a GUI editor. Raspberry Pi OS distribution apparently has VIM, NANO, and maybe other editors, but did not have JOE.
I had seen something about folks using NANO text editor, so I did all the CDs up and down to get to the file, then nano <filename> to work it. I've never used NANO before, and it has probably been decades since I used any legacy text editor. I did sudo su before starting, hopefully to give me enough privileges. Apprehensive, I scrolled to the file end, changed our $ local_meshchat_node = '<my AREDN node name> ', then CTRL+Y, CTRL+S (belt and suspenders), and CTRL+X to get out.
I opened the file, and it does appear to be correct and ready to go. Now on to the next set of problems
Thanks again for your insiteful tip!
-Tim K5RA
After watching this video, I checked ports on my external router and in my node forwarding settings.
https://www.youtube.com/watch?v=TFQ61B8MmLQ
I'm not sure why, but this guy recommends forwarding port 8080 to port 80 of the node to of the meshchat device. I did that. I don't know if it made a difference. But something else seems to have worked...
It turns out my external router had a port forward setting for port 8080 directed to my HAP LITE. I remember setting this up to give somebody access to the settings page of my node via the Internet. I turned off the port forwarding on the external router and now two way sync is working.
You can either change the port forwarding rule or you can change the port entry in your MeshChat service definition.
This is an attempt to summarize the instructions for fixing the "Could not get Lock" issue that folks see when setting up MeshChat on new versions of Raspbian. I just went through another install from scratch (first time in years), and had to re-learn this all over again. Hopefully this summary of several previous comments will save others some time.
Once you have your Raspberry Pi set up and MeshChat installed, run the following commands in the terminal:
Hint: in the Nano editor use Ctrl-X or Cmd-X to exit, Y to save, Enter/Return to confirm filename
If you've correctly installed the latest MeshChat API package (currently on Github) on the local node, and set up the service link, then sending messages and syncing should all work now.
Hopefully I got that all right. Let me know if anyone sees issues. de KJ6WEG
It worked and my MeshChat on the Pi is functional. Really appreciate the very clear instructions, so simple, even a biologist could do it. ;-)
Lee
model:
MikroTik RouterBOARD 952Ui-5ac2nD (hAP ac lite)
Two things helped me fix this which I'll copy from this article: https://wcaredn.ca/services/meshchat/home
Install the meshchat-api package Note that this part will need to be done everytime the node is upgraded. :
From the Port Forwarding, DHCP, ans Services page:
73
Orv W6BI
73,Chuck
--2024-02-20 23:18:58-- https://s3.amazonaws.com/aredn/meshchat_1.02_all.deb
Resolving s3.amazonaws.com (s3.amazonaws.com)... 52.216.208.168, 52.216.144.198, 52.216.146.29, ...
Connecting to s3.amazonaws.com (s3.amazonaws.com)|52.216.208.168|:443... connected.
HTTP request sent, awaiting response... 403 Forbidden
2024-02-20 23:18:59 ERROR 403: Forbidden.
what do you think? I need the new version for my rasperry pi.
Pages