Couple of issues with pibeacon...

Posted on
Tue Jul 02, 2019 9:42 am
forestfield offline
Posts: 83
Joined: Dec 29, 2014
Location: West Sussex

Couple of issues with pibeacon...

Hi Karl,
I've just upgrade my pibeacon to 7.105.293 from a much older version, and I had a couple of issues.

a. I don't use any homeseer security (fear not - I have some reverse proxy's for internet access to homeseer). So in the 'master' config I have 'DIGEST, BASIC or no authentication' set to 'use do not use security...', and the 'userid and password both blank'. The plugin wouldn't set running until I entered a dummy username and password. Looks like the code in plugin.py around line 8787ish - perhaps this should 'break' if no security is set?

Code: Select all
        while True:
            if self.userIdOfServer !="" and self.passwordOfServer !="" : break
            self.indiLOG.log(20, u"userid or password not configured in config")
            self.sleep(20)


b. Had some problems with exim! Eventually tracked this down to line 1425ish. of master.py
Code: Select all
os.system("sudo chown -R  pi:pi "+G.logDir)


I think this is a hangover from when the logFile was in /run/..., and the line should be something like
Code: Select all
os.system("sudo chown -R  pi:pi "+G.logDir+"piBeacon.log")


Otherwise, thanks for a v. useful plugin; I know have 6 beacons running and can locate my keyring to a room! (More seriously I use it as presence detection to set Home/Away automatically!

-- Paul --

Posted on
Tue Jul 02, 2019 10:41 am
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Couple of issues with pibeacon...

1. that IF is a crude way of check if anything is configured, can change that.
... as i have not ventured in to "no security" is

add:
Code: Select all
and if authentication !="none"  # other options: digest or basic

should doit?

2. s.system("sudo chown -R pi:pi "+G.logDir) should be removed, was ok when log file was in pibeacon run directory. Will remove that one.


and thanks for the useful feedback


Karl

Posted on
Tue Jul 02, 2019 11:05 am
forestfield offline
Posts: 83
Joined: Dec 29, 2014
Location: West Sussex

Re: Couple of issues with pibeacon...

My pleasure to have helped.

-- Paul --

Posted on
Tue Jul 02, 2019 8:28 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Couple of issues with pibeacon...

will be fixed tomorrow.

Karl

Posted on
Wed Jul 03, 2019 7:46 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Couple of issues with pibeacon...

posted new version with those fixes ... .295

Posted on
Thu Aug 29, 2019 3:05 pm
forestfield offline
Posts: 83
Joined: Dec 29, 2014
Location: West Sussex

Re: Couple of issues with pibeacon...

Hi Karl,
I upgraded to 7.109.303, and I still have problems...

1. The plugin still gets stuck in the authentication loop. In your master.py you have
Code: Select all
if self.userIdOfServer !="" and self.passwordOfServer !=""  and self.pluginPrefs.get(u"authentication", u"digest") != "none": break

I changed it to
Code: Select all
if (self.userIdOfServer !="" and self.passwordOfServer !="")  or self.pluginPrefs.get(u"authentication", u"digest") == "none": break

and this seems to work for me.

2. Once I got the server started I was getting all sorts of timeouts and failures from my pibeacons. I *think* this is because the latest version of the pibeacon code has
Code: Select all
import serial

in master.py (and some others), but there's no serial module in the plugin's pi directory to upload so mater.py doesn't't start properly

I've just reverted to 7.105.293 and I think I'm back back to normal operation - i.e 4/7 beacons running correctly, still have 3/7 to reload/restart

Regards
-- Paul --

Posted on
Thu Aug 29, 2019 9:02 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Couple of issues with pibeacon...

I am out until Tuesday next week. Then I will be spending time on get things straightened out.


Sent from my iPhone using Tapatalk

Posted on
Fri Aug 30, 2019 1:43 am
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Couple of issues with pibeacon...

Serial should be part of std python

Could you do
ssh pi@....

python
Import serial
exit()

You should not get an error message.

Karl


Sent from my iPhone using Tapatalk

Posted on
Fri Aug 30, 2019 9:29 am
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Couple of issues with pibeacon...

it looks as if your ssd does not have serial installed.

I checked my RPIs they all have serial installed.

you could do :
ssh pi@..
Code: Select all
sudo apt-get install python-serial
that should do it.

I will add to master.py in the next release:
Code: Select all
try:
  import serial
except:
  os.system("sudo apt-get install python-serial")

to make sure your ssd has serial installed.

Karl

Posted on
Fri Aug 30, 2019 10:28 am
forestfield offline
Posts: 83
Joined: Dec 29, 2014
Location: West Sussex

Re: Couple of issues with pibeacon...

Hi Karl,
The serial package isn't installed on any of my (7) pibeacons, or (6) raspberry pis! (The latter are used for other things). They're all running buster, and have all been upgraded from jessie/wheezy or whatever came before these. Maybe serial wasn't in older pythons, and doesn't get installed as the o/s is upgraded.

i.e.
Code: Select all
ssh pibeacon3
Warning: No xauth data; using fake authentication data for X11 forwarding.
Linux pibeacon3 4.19.66+ #1253 Thu Aug 15 11:37:30 BST 2019 armv6l

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
No mail.
Last login: Tue Aug 20 16:37:14 2019 from 10.100.101.12
paulw@pibeacon3:~$ python
Python 2.7.16 (default, Apr  6 2019, 01:42:57)
[GCC 8.2.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import serial
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named serial
>>>

Posted on
Fri Aug 30, 2019 10:31 am
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Couple of issues with pibeacon...

Did you use one of my preconfigured ssd or did you start from a fresh raw image directly from the rpi site?

Posted on
Fri Aug 30, 2019 11:34 am
forestfield offline
Posts: 83
Joined: Dec 29, 2014
Location: West Sussex

Re: Couple of issues with pibeacon...

Would almost certainly have been a raspberry pi image - since I had the pi-zeros before pibeacon.

Posted on
Fri Aug 30, 2019 11:42 am
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Couple of issues with pibeacon...

Ok. I installed serial on my ssd images published for download.


You have to do
sudo apt-get install serial-python
Then everything should work.


Sent from my iPhone using Tapatalk

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 4 guests