Couple of issues with pibeacon...

forestfield
Posts: 83
Joined: Mon Dec 29, 2014 12:58 pm
Location: West Sussex

Couple of issues with pibeacon...

Post by forestfield »

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 --
User avatar
kw123
Posts: 8705
Joined: Sun May 12, 2013 4:44 pm
Location: Dallas, TX
Contact:

Re: Couple of issues with pibeacon...

Post by kw123 »

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
forestfield
Posts: 83
Joined: Mon Dec 29, 2014 12:58 pm
Location: West Sussex

Re: Couple of issues with pibeacon...

Post by forestfield »

My pleasure to have helped.

-- Paul --
User avatar
kw123
Posts: 8705
Joined: Sun May 12, 2013 4:44 pm
Location: Dallas, TX
Contact:

Re: Couple of issues with pibeacon...

Post by kw123 »

will be fixed tomorrow.

Karl
User avatar
kw123
Posts: 8705
Joined: Sun May 12, 2013 4:44 pm
Location: Dallas, TX
Contact:

Re: Couple of issues with pibeacon...

Post by kw123 »

posted new version with those fixes ... .295
forestfield
Posts: 83
Joined: Mon Dec 29, 2014 12:58 pm
Location: West Sussex

Re: Couple of issues with pibeacon...

Post by forestfield »

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 --
User avatar
kw123
Posts: 8705
Joined: Sun May 12, 2013 4:44 pm
Location: Dallas, TX
Contact:

Re: Couple of issues with pibeacon...

Post by kw123 »

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


Sent from my iPhone using Tapatalk
User avatar
kw123
Posts: 8705
Joined: Sun May 12, 2013 4:44 pm
Location: Dallas, TX
Contact:

Re: Couple of issues with pibeacon...

Post by kw123 »

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
User avatar
kw123
Posts: 8705
Joined: Sun May 12, 2013 4:44 pm
Location: Dallas, TX
Contact:

Re: Couple of issues with pibeacon...

Post by kw123 »

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
forestfield
Posts: 83
Joined: Mon Dec 29, 2014 12:58 pm
Location: West Sussex

Re: Couple of issues with pibeacon...

Post by forestfield »

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
>>> 
User avatar
kw123
Posts: 8705
Joined: Sun May 12, 2013 4:44 pm
Location: Dallas, TX
Contact:

Re: Couple of issues with pibeacon...

Post by kw123 »

Did you use one of my preconfigured ssd or did you start from a fresh raw image directly from the rpi site?
forestfield
Posts: 83
Joined: Mon Dec 29, 2014 12:58 pm
Location: West Sussex

Re: Couple of issues with pibeacon...

Post by forestfield »

Would almost certainly have been a raspberry pi image - since I had the pi-zeros before pibeacon.
User avatar
kw123
Posts: 8705
Joined: Sun May 12, 2013 4:44 pm
Location: Dallas, TX
Contact:

Couple of issues with pibeacon...

Post by kw123 »

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
Post Reply

Return to “piBeacon”