Autor Thema: Presenced - Setup on rPi  (Gelesen 10575 mal)

Online Markus Bloch

  • Administrator
  • Hero Member
  • *****
  • Beiträge: 3562
Aw: Presenced - Setup on rPi
« Antwort #15 am: 15 August 2013, 16:36:30 »
Zitat von: andyclimb schrieb am Do, 15 August 2013 16:14

Can I ask if what the difference if between the normal and rpi version?


The only difference is the init script. On the raspberry there is an raspberry-like version used. But the presenced binary are both the same.

Zitat von: andyclimb schrieb am Do, 15 August 2013 16:14

Any ideas why my lan-ping might not be working?


Could you please set the loglevel attribute to 3 and send me the output of your fhem.log?

Markujs
Developer für Module: YAMAHA_AVR, YAMAHA_BD, FB_CALLMONITOR, FB_CALLLIST, PRESENCE, Pushsafer, LGTV_IP12, version

aktives Mitglied des FHEM e.V. (Technik)

Offline andyclimb

  • Full Member
  • ***
  • Beiträge: 141
Aw: Presenced - Setup on rPi
« Antwort #16 am: 15 August 2013, 17:11:27 »
RE 1st question, thank you..  I actually downloaded the wrong one, but they both work fine.

here is the output, I have my logs in reverse......



rtt min/avg/max/mdev = 41.511/107.622/203.713/62.563 ms
4 packets transmitted, 4 received, 0% packet loss, time 3004ms
--- 192.168.1.74 ping statistics ---

64 bytes from 192.168.1.74: icmp_req=4 ttl=64 time=64.3 ms
64 bytes from 192.168.1.74: icmp_req=3 ttl=64 time=41.5 ms
64 bytes from 192.168.1.74: icmp_req=2 ttl=64 time=120 ms
64 bytes from 192.168.1.74: icmp_req=1 ttl=64 time=203 ms
PING 192.168.1.74 (192.168.1.74) 56(84) bytes of data.
2013.08.15 16:05:41 3: PRESENCE (AMwifiiPhone) - ping command returned with output:
2013.08.15 16:05:38 3: PRESENCE_DoLocalPingScan: AMwifiiPhone|192.168.1.74|0|4
AM

Online Markus Bloch

  • Administrator
  • Hero Member
  • *****
  • Beiträge: 3562
Aw: Presenced - Setup on rPi
« Antwort #17 am: 15 August 2013, 17:37:37 »
The reverse logs are no problem (i also use them). Are there any more related loglines you can send me?

Markus
Developer für Module: YAMAHA_AVR, YAMAHA_BD, FB_CALLMONITOR, FB_CALLLIST, PRESENCE, Pushsafer, LGTV_IP12, version

aktives Mitglied des FHEM e.V. (Technik)

Offline andyclimb

  • Full Member
  • ***
  • Beiträge: 141
Aw: Presenced - Setup on rPi
« Antwort #18 am: 15 August 2013, 18:26:20 »
I'm afraid not.  Nothing was generated until i restarted the computer.  then I get the lines you can see, with the ping output shown and then nothing else.  even if send a status request there are no more log lines generated.  Could the ping output be causing it to stop working on the first attempt?

I can generate those lines again if i issue a rereadcfg.  

heres the full output right from loading.

2013.08.15 17:24:41 1: Connection refused from 127.0.0.1:45658

rtt min/avg/max/mdev = 44.757/153.608/213.338/65.089 ms
4 packets transmitted, 4 received, 0% packet loss, time 3003ms
--- 192.168.1.74 ping statistics ---

64 bytes from 192.168.1.74: icmp_req=4 ttl=64 time=213 ms
64 bytes from 192.168.1.74: icmp_req=3 ttl=64 time=190 ms
64 bytes from 192.168.1.74: icmp_req=2 ttl=64 time=165 ms
64 bytes from 192.168.1.74: icmp_req=1 ttl=64 time=44.7 ms
PING 192.168.1.74 (192.168.1.74) 56(84) bytes of data.
2013.08.15 17:24:41 3: PRESENCE (AMwifiiPhone) - ping command returned with output:
2013.08.15 17:24:38 3: PRESENCE_DoLocalPingScan: AMwifiiPhone|192.168.1.74|0|4
2013.08.15 17:24:36 1: Including ./log/fhem.save
DS: WNMiPhone
DS: WNMiPhone
2013.08.15 17:24:36 3: WNMiPhone device opened
2013.08.15 17:24:36 3: Opening WNMiPhone device 192.168.1.127:5111
DS: AMiPhone
2013.08.15 17:24:36 3: AMiPhone device opened
2013.08.15 17:24:36 3: Opening AMiPhone device 192.168.1.127:5111
2013.08.15 17:24:36 3: remoteTELNET: port 7073 opened
2013.08.15 17:24:35 3: localWEB: port 8087 opened
2013.08.15 17:24:35 3: FHEM2FHEM device opened (d3)
2013.08.15 17:24:35 3: FHEM2FHEM opening d3 at 192.168.1.127:7072
2013.08.15 17:24:35 3: FHEM2FHEM device opened (d2)
2013.08.15 17:24:35 3: FHEM2FHEM opening d2 at 192.168.1.127:7072
2013.08.15 17:24:35 1: TRX: TRX_0 device is none, commands will be echoed only
2013.08.15 17:24:35 1: COC device is none, commands will be echoed only
2013.08.15 17:24:35 3: WEBtablet: port 8085 opened
2013.08.15 17:24:35 3: WEBphone: port 8084 opened
2013.08.15 17:24:35 3: WEB: port 8083 opened
2013.08.15 17:24:35 3: telnetPort: port 7072 opened
2013.08.15 17:24:35 1: Including fhem.cfg
AM

Online Markus Bloch

  • Administrator
  • Hero Member
  • *****
  • Beiträge: 3562
Aw: Presenced - Setup on rPi
« Antwort #19 am: 15 August 2013, 21:28:07 »
Hi Andrew,

it seems to me that you have set the "allowfrom" attribute in your TELNET definitions. The problem is, that a loopback connection via 127.0.0.1 is needed to deliver the check results to the main FHEM process.

Please allow connections also from 127.0.0.1, then it should work.

Markus
Developer für Module: YAMAHA_AVR, YAMAHA_BD, FB_CALLMONITOR, FB_CALLLIST, PRESENCE, Pushsafer, LGTV_IP12, version

aktives Mitglied des FHEM e.V. (Technik)

Online Markus Bloch

  • Administrator
  • Hero Member
  • *****
  • Beiträge: 3562
Aw: Presenced - Setup on rPi
« Antwort #20 am: 15 August 2013, 21:45:26 »
I placed a patch in FHEM Development so after the patch is applied, it also should work without explicitly allowing 127.0.0.1

Greetings
Markus
Developer für Module: YAMAHA_AVR, YAMAHA_BD, FB_CALLMONITOR, FB_CALLLIST, PRESENCE, Pushsafer, LGTV_IP12, version

aktives Mitglied des FHEM e.V. (Technik)

Offline andyclimb

  • Full Member
  • ***
  • Beiträge: 141
Aw: Presenced - Setup on rPi
« Antwort #21 am: 16 August 2013, 11:34:46 »
Hi,

Ah that explains everything.  I disabled my 192.168.1.* restriction on the telnet port and bingo it stared working.   I have no idea that the loopback was required.  

Thanks again.

Not had a chance to try out the new patch, I'll test over the weekend if that works as well.  

thanks again for all your help Markus, the rPis are now very happy with 0% CPU usage!

Andrew
AM

Online Markus Bloch

  • Administrator
  • Hero Member
  • *****
  • Beiträge: 3562
Aw: Presenced - Setup on rPi
« Antwort #22 am: 16 August 2013, 11:43:14 »
Yeah that's a bit tricky as the user doesn't know that. My patch from yesterday was applied today by Rudi and tomorrow after you execute an update and restart, you can use your allowfrom-filter normal as usual.

Have a nice weekend.

Markus
Developer für Module: YAMAHA_AVR, YAMAHA_BD, FB_CALLMONITOR, FB_CALLLIST, PRESENCE, Pushsafer, LGTV_IP12, version

aktives Mitglied des FHEM e.V. (Technik)

Offline andyclimb

  • Full Member
  • ***
  • Beiträge: 141
Aw: Presenced - Setup on rPi
« Antwort #23 am: 18 August 2013, 23:21:26 »
Hi,

Sorry I've been away for the weekend.  I've had a chance to apply the patches and they work great.  Getting rid of the telnet IP restriction also fixed the ping.  I've not tried to put it back yet, to test the other patch..

On to the next question!!!

I'm trying to get a notify and a watchdog to work of the presence instance, coming from a collectord...  I just cant get it to work...  I've tried

AMiPhone:present
AMiPhone.present
AMiPhone:present*

I've generated a userReading
home {if (Value("AMiPhone")=="present") {Value("AMiPhone")}; if (Value("AMiPhone")=="absent") {Value("AMiPhone")} }
which gives me

2013-08-18_22:11:24 AMiPhone home: present
2013-08-18_22:10:53 AMiPhone home: present
2013-08-18_22:09:45 AMiPhone home: present
2013-08-18_22:09:08 AMiPhone home: present
2013-08-18_22:08:37 AMiPhone home: present

The thought being that the lack of : stopped the event being registered in fhem as presence generates the events shown below in a file log...

2013-08-18_10:40:17 AMiPhone present

but

AMiPhone:home.present as a RegExp does not work for this either...  the reason that im confused is that the code shown below works just fine when the presence module is used with a local-bluetooth device, which suggests an issue with thecollectord... unless of course im doing something totally wrong!  I've just also tested an instance of a pan-bluetooth but talking directly to the presenced instance and that works too (using testbluetooth:present set tvlamp on) .  so this is exclusively something wrong with the presenced implementation...

amiphonebt:present|amiphonewifi:present set amishome_count 0



Sorry for all the trouble..any help appreciated...

Andrew

AM

Online Markus Bloch

  • Administrator
  • Hero Member
  • *****
  • Beiträge: 3562
Aw: Presenced - Setup on rPi
« Antwort #24 am: 19 August 2013, 00:02:25 »
I'm sorry, but i don't really understand what you are trying to achieve.

Could you please post the relevant configuration statements in your fhem.cfg and an explanation of your problem.

In general for notify's and watchdogs, please use "AMiPhone:present". But it also depends on your configuration.

Greetings

Markus

Developer für Module: YAMAHA_AVR, YAMAHA_BD, FB_CALLMONITOR, FB_CALLLIST, PRESENCE, Pushsafer, LGTV_IP12, version

aktives Mitglied des FHEM e.V. (Technik)

Offline andyclimb

  • Full Member
  • ***
  • Beiträge: 141
Aw: Presenced - Setup on rPi
« Antwort #25 am: 19 August 2013, 11:40:23 »
I want to write a regexp for AMiPhone that works for notify and watchdog. The problem is that for me it doesn't work when the PRESENCE module uses collectord.  here is the code...

This is the presence a module connecting to a local collectord.

define AMiPhone PRESENCE lan-bluetooth 98:B8:E3:7A:38:0F  0.0.0.0:5222

This is the presence a module connecting to a remote presenced.

define AMiPhone PRESENCE lan-bluetooth 98:B8:E3:7A:38:0F  192.168.1.127:5111

Both of these work and return the correct present/absent..... as they should

The problem is that the notify shown below ONLY works for the AMiPhone (remote presenced) and not the local collectord.  

define testnotify notify AMiPhone:present set lamp on

Does this make sense?
AM

Online Markus Bloch

  • Administrator
  • Hero Member
  • *****
  • Beiträge: 3562
Aw: Presenced - Setup on rPi
« Antwort #26 am: 19 August 2013, 17:42:11 »
Yes, now i understand :-)

When you use the first definition (local collectord), what readings where created and what state is displayed on the detail view in FHEMWEB?

Markus
Developer für Module: YAMAHA_AVR, YAMAHA_BD, FB_CALLMONITOR, FB_CALLLIST, PRESENCE, Pushsafer, LGTV_IP12, version

aktives Mitglied des FHEM e.V. (Technik)

Offline andyclimb

  • Full Member
  • ***
  • Beiträge: 141
Aw: Presenced - Setup on rPi
« Antwort #27 am: 20 August 2013, 14:27:12 »
I figured it out!  I made a mistake and defined event-on-change, event-on-update rules which meant that no events were generated for state changes.  

I can't believe that it took me that long to work it out!
AM