We are trying to setup MeshChat on Raspberry Pi's and have 2 issues.
1: is the Error Sending Message: Could not get Lock.
2: We don't see chats from the same Zone as on the regular MeshChats
One of the Pi's is on a Pi2 and one is Pi3, both are running Jessie Stretch Desktop
Any help would appreciated
1: is the Error Sending Message: Could not get Lock.
2: We don't see chats from the same Zone as on the regular MeshChats
One of the Pi's is on a Pi2 and one is Pi3, both are running Jessie Stretch Desktop
Any help would appreciated
Both Roger and I emailed him, I guess he's real busy and referred Roger to the forum.
Here's additional info, maybe someone can give me a hint where to look:
Meshchat was installed following the directions. Looks to have installed properly. In fact it's syncing with the other nodes on our network, populating it's database with all the texts from the other nodes just fine. Nothing make it to the Web interfact though. The problem is when we try to send a text we get the message Could not get Lock.
Looking in /var/log/apache2/error.log, I see many of:
touch : cannot touch '/tmp/meshchat/lock' : No such file or directory.
clould not get lock at /usr/lib/cgi-bin/meshchatlib.pm line 35
However the file does exist and if I delete it, it's instantly re-created. There is plenty of file activity in that directory as Meshchat syncs with the other nodes.
We're both running the latest version of Raspbian from the Raspberrypi.org site.
Any idea what's happening and what went wrong? I'm not a linux guru or even much of a programmer, but I've been playing with Linux since Linus released it when I had a 386SX/25 and had to install it from floppies.
mkdir -p /tmp/meshchat
touch /tmp/meshchat/lock
chown -R www-data:www-data /tmp/meshchat
chown www-data:www-data /tmp/meshchat/lock
Wait a few mins and try, if still not working:
/etc/init.d/meshchatsync restart
OK, tried that. No change. Both directory and file show owner/group as www-data. Everything is working with syncing with other nodes, MeshChat's database is getting all the text from other nodes, just can't display on web page.
I thought I'd try an older version of OS, installed on a version of Jessie from 9/2016. WORKS right off! Something has changed in Raspbian.
73,
Augustine
W8AWT
August KG7BZ
Jim W8ERW
Just so others who are having the same problem see it, MeshChat Pi works on a 9/2016 version of Jessie. Does not work on the newer Stretch from 2017.
Kirby
In addition the AREDN team doesn't support unofficial packages, any adddon software will often be asked to be removed before any support is given for issues .
I put a new Pi, based on Raspanian Stretch, on our local mesh yesterday and had the same issues outlined in this thread. After some investigation, I have a fix for the issue. Before I outline the fix, I should note that the problem isn't the MeshChat software, but rather it is in the systemd startup config for Apache. The systemd startup config specifies that a private /tmp directory should be used for the Apache process. Because of this, the Apache process cannot see the /tmp/meshchat directory, including the lock file in that directory. This causes all the errors you see in the Apache log file.
To fix this issue, do the following:
MeshChat on a Stretch based Raspberry Pi should work now.
An alternative fix is to change the MeshChat code to use a different path. This can be done by changing the Perl $meshchat_path variable in /usr/lib/cgi-bin/meshchatconfig.pm. I didn't go down this path because if you ever update the MeshChat package this change would be lost unless Trevor made a similar change in his code.
Enjoy!
Brad
AC7BR
Brad
AC7BR
I just dealt with this problem on my Pi 4 with Raspian GNU/Linux 11 (bullseye). I read through the thread and indeed got things working. Here were the commands I issued:
---------------------------------
'sudo chmod 0666 /tmp/meshchat/lock'
Shutdown the Apache process via the command 'sudo systemctl stop apache2'
Copy the Apache2 startup config to the user systemd area. The command is 'sudo cp /lib/systemd/system/apache2.service /etc/systemd/system/apache2.service'
Using your favorite editor, modify /etc/systemd/system/apache2.service and change the PrivateTmp=true parameter to PrivateTmp=false
'sudo systemctl daemon-reload'
Restart the Apache process via the command 'sudo systemctl start apache2'
---------------------------------
This took care of the "Error Sending Message: Could not get Lock" issue.
Now I'm left with a lesser situation where when files are added, they are for some reason listed twice on the MeshChat "Files Available" listing. More to research.
Thanks for this thread.
Regards,
Kent, KL5T
So, thanks for the instructions - and, as with some others, I also needed the important DAEMON command. Cheers, John VE7JEY on Vancouver Island
Seems that running before
did the trick for me to reload the proper configuration before starting apache
Thank you, Brad!
Followed your instructions to fix the "Error Sending Message: Could not get Lock" issue. Everything works great now! I will have to document this in my offline book of tricks.
Craig
VA3AOU
did not work.
Thanks Brad! That fixed my MeshChat problem and now after months (since I upgraded to Stretch), it is up and running again. I did have to do the permissions change to get file uploading to work. All seems well now!
73 - Mike ab4yy
I ran into this problem on a new 3B+ I bought from Newark at Hamvention this weekend to replace my 3B on Jesse. Then I came here.
Brad, you're my hero! Thank you!
After doing a clean install on the Pi & installing meshchat, I followed the instructions by AC7BR
1 - changing the PrivateTmp=false
2 - chmod 0666 /tmp/meshchat/lock
I was able to clear the lock error and send a message.
I then jumped on another node and saw my message appear.- sending from my node works!!
The only problem I have left is how to get the sync working both ways. My node sends messages but does not receive (When on the other node, I sent a message and it did not appear on my node).
Any thoughts on what I need to look at?
Regards,
Peter - AK6PW
Thank you!!
I had installed the api several days ago, and confrmed that it was there. Today installed the newest nightly build, and then spent a while getting MeshChat working on a RasPi here. It was working only one way. Finally checked for installed packages on the node and it was not there. Re-installed the api and all of a sudden, MeshChat started syncing with other nodes. Based on my testing, this is not an uncommon problem.
I have read through every post and tried all the suggestions and still get the lock error.
I did a fresh install of Buster from the Raspbian site. Did the upgrade/update. Installed Apache 2. Installed MeshChat 1.02. No matter what I've tried I can't past the lock error. Not sure where to get a older copy of Raspbian as suggested here however. Very frustrated as I am to demo this for a ham club next Monday. Any help I could get will be greatly appreciated.
Try:
https://downloads.raspberrypi.org/raspbian/images/
Any suggestions? Thanks again for the help.
Thanks to AC7BR for the fix in comment #18!!
I spent many hours beating my head on this setup, on a new Raspberry Pi 4 running Raspbian Buster. After solving several other issues, this last one stumped me, and these instructions finally resolved it. Actually, it didn't work at first... I also had to reboot the Pi to get it to start showing the messages other nodes.
Thanks AC7BR!
I've tried every suggestion in this forum thread without any luck. New MeshChat install won't sync with other MeshChat nodes and I get the dreaded "Could not get lock error" Anyone want to share an image file of their working MeshChat on a Rpi?
I have the API loaded on a MikroTik hap ac lite with the latest AREDN firmware.
MeshChat is installed on a Rpi 3B+ running Stretch (could get Jessie to work with my HDMI display)
I'm open to all suggestions for fixing this thing.
Thanks, David-N5MXI
Message #18 in this thread solved the - Could not get lock - error for me.
Please share
that meshchat_1.02_all.ipk is installed on the node.
that the node's [Advertised Services Name] matches the meshchatconfig.pm in the RPi;
Example config;
/usr/lib/cg--bin/meshchatconfig.pm: our $pi_zone = '[Advertised Service Name]';
I hope this helps, Chuck
Joe AE6XE
Joe - I've been following the thread you mentioned in your last message. https://github.com/aredn/aredn_ar71xx/issues/522 My brain cell started hurting when you all started talking about IPtables etc... I can't tell if a resolution has been found yet or not. If yes, is there a patch I can load or will installing the nightly build correct the problem?
I also have a MikroTik which is probably the reason my MeshChat won't work. If you need another MikroTik node to be a guinea pig for testing, mine is available.
David
Joe AE6XE
Just completed the firmware update on my MikroTik hap ac with the nightly build that was just released. Update loaded fine however I still get the "can't get lock" error message on MeshChat. MeshChat doesn't sync with other nodes.
So the procedure described here/above doesn't work for you? I suppose you could change the $meshchat_path to "/var/www/html/meshchat" in your /usr/lib/cgi-bin/meshchatconfig.pm file, which would eliminate using the /tmp directory altogether.
This issue typically results from how the Apache web server is configured to allow or deny use of the /tmp directory on Linux. You'll usually see messages like this in /var/log/apache2/error.log ----- "cannot touch /tmp/meshchat/lock" which causes MeshChat to report that it "could not get a lock" Either fix the permissions in Apache as described above & change the permissions on the lock file, or point MeshChat to a different $meshchat_path where it can put its lock file.
install the API package
after the firmware upgrade?
Pages