You are here

Pi MeshChat Error Sending Message

30 posts / 0 new
Last post
w7acw
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
K5DLQ's picture
You might try reaching out to

You might try reaching out to the author, K7FPV

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

 

K7FPV
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

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

73,
Augustine
W8AWT

kg7bz
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
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
K5DLQ's picture
looks like a permissions

looks like a permissions issue to me....

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

AJ6GZ
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
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
KS7P's picture
Fix?

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
K5DLQ's picture
downgrade to Jessie

downgrade to Jessie

KL7VK
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?"
Kirby

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

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

Brad
AC7BR
 

KB5UGF
KB5UGF's picture
Those 2 fixes worked!

I tried both of your suggestions, both the  Apache2 config mod and the permissions change, and it worked like a charm. Thanks!

AB4YY
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

AB8XA
Yet another...

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!

AK6PW
MeshChat on a raspberry Pi - one way message sync.

I have just set up a meshchat node on a raspberry Pi.  It is on the 3B+

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

K5DLQ
K5DLQ's picture
from memory, you need to

from memory, you need to install the meshchat_api packages on one of your local nodes and configure meshchat to use it.  That's how it determines what other meshchat services are available on the network.

AK6PW
MeshChat on a raspberry Pi - all functional

That was it - missed the step to install the api package on the node - once done and rebooted, messaging both ways kicked in

Thank you!!

K6CCC
K6CCC's picture
Don't forget to reinstall api after update.

And don't forget that if you update software on the AREDN node, you get to re-install the api package.  I missed that step.

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.
 

KX8U
Tried every suggestion here and still does not work

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.      

nc8q
nc8q's picture
where to get a older copy of Raspbian
KX8U
Thanks. I'll try that tonight

Thanks. I'll try that tonight.

KX8U
Tried every suggestion here and still does not work Part 2

Before I tried to move to an older OS I tried editing permissions on the meshchat files in ​/var/www/html/ using ​​(sudo chmod 0666 /var/www/html/) and I no longer have the lock error. When I send a message however it just disappears. It used to show up in the lower half of the screen in Messages but no longer does. 
Any suggestions? Thanks again for the help.

Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer