You are here

Pi MeshChat Error Sending Message

20 posts / 0 new
Last post
Pi MeshChat Error Sending Message

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

K5DLQ's picture
You might try reaching out to

You might try reaching out to the author, K7FPV

Both Roger and I emailed him,

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/ 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 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.


Try these commands on your pi

Try these commands on your pi:

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.

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.

w8awt's picture
Have you found a fix? I'm

Have you found a fix? I'm having exactly the same problem. I cant see anything comming  from my nodes and I cant post anything using meshchat installed on the Pi.


I haven't had the time to

I haven't had the time to look into this further. Maybe sometime in the next month. Nobody else has responded and neither has the author of MeshChat.
August KG7BZ

w8erw's picture
MeshChat Pi

I am also having the same issues with a Pi 3 and Raspbian Stretch.  I have had a couple of additional non related issues as well.  I am beginning to think this all may be a Pi 3/Stretch problem.  It appears that something(s) are lacking in this combination.  I have a battery backup hat that will not configure correctly, a real time clock which does the same and now MeshChat does not operate as intended.  I have kept up with th Pi upgrades thinking this may solve the problems which has not happened.
Jim W8ERW 

K5DLQ's picture
looks like a permissions

looks like a permissions issue to me....

Works on older OS

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.

Don't stretch it or you'll break it

Agreed... Did two clean installs and confirmed it works up to 7/5/2017 Jessie. Something in Stretch breaks it.

w6bi's picture
Sounds like my problem.

My MeshChat nodes stopped working recently and I suspect that's the issue, as I believe they've all been upgraded to Stretch.  I'll check.

KS7P's picture

Has a fix for this problem been made?  I too am trying to setup a new node with MeshChat and get the 'Could not get Lock' message.  Running Raspian/stretch.

K5DLQ's picture
downgrade to Jessie

downgrade to Jessie

Meshchat on RPI

New to BBHN and what is the advantage in running Meshchat on an RPI as opposed to running Meshchat on station radio as a "package?"

It is recommend to NEVER run

It is recommend to NEVER run add-on software on the mesh node. Add-on programs consume valuable limited resources on a mesh node that could be better served letting the node do what it is built to do which is route packets in a high speed manner.

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 .

K5DLQ's picture
And running it on a Pi you

And running it on a Pi you get additional features (automated actions) and MUCH more storage space to serve files.

AC7BR's picture
One way to fix this issue

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:

  • Shutdown the Apache process via the command 'sudo systemctl stop apache2'
  • Copy the Apache2 startup config to the user systemd area.  The command is '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
  • Restart the Apache process via the command 'sudo systemctl start apache2'

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/  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.



AC7BR's picture
One other thing

One other thing I did is to change the permissions on the lock file as it was only read/write by root.  To do this, run the command

  • chmod 0666 /tmp/meshchat/lock

I did this prior to finding the fix I outline above.  I don't know if there is code in MeshChat to take care of the permissions but if the fix above doesn't work try this too.


Thanks Brad!  That fixed my

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

Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer