FHEM Forum

FHEM => English Corner => Thema gestartet von: Lectere am 11 Dezember 2014, 13:10:55

Titel: FHEM for windows, does WOL and mail work
Beitrag von: Lectere am 11 Dezember 2014, 13:10:55
I know wake on lan and mail needs some linux lib's to work.

Do those things work on a windows installation?
Titel: Antw:FHEM for windows, does WOL and mail work
Beitrag von: ChrisD am 11 Dezember 2014, 22:06:11
I use both on Windows

ChrisD
Titel: Antw:FHEM for windows, does WOL and mail work
Beitrag von: Lectere am 14 Dezember 2014, 11:41:09
Thanks Chris,

I've installed perl, and made a c:\fhem\ folder.

Now I'm stuck on; Device COM1 does not appear to exist. Testing impossible

When I install cpan Win32::SerialPort

:/  :( :o

Titel: Antw:FHEM for windows, does WOL and mail work
Beitrag von: ChrisD am 14 Dezember 2014, 20:44:06
Your computer probably has no serial port on COM1. Win32::SerialPort however needs a serial port to do some tests. You can check in Device Manager if you have any COM-Ports. It is possible to have Win32::SerialPort use another (existing) port for testing:

- open CPAN (Start - Run - cpan), you should get the cpan prompt
- o conf makepl_arg TESTPORT=COMx (COMx must exist in Device Manager)
- install Win32::SerialPort
- if it succeeds: o conf makepl_arg ""

If there are no COM-Ports you first have to install one.

ChrisD
Titel: Antw:FHEM for windows, does WOL and mail work
Beitrag von: Lectere am 14 Dezember 2014, 23:07:25
Very clear, thanks a lot Chris!,

That got me going!, I'm stuck on something else now;

For a second or two after starting the service, I can turn on/off lights, but then something goes wrong with the serial communication. This error appears;


2014.12.14 23:05:09 1: PERL WARNING: Error in PurgeComm at ./FHEM/DevIo.pm line 371.
2014.12.14 23:05:09 1: PERL WARNING: Error in GetCommTimeouts at ./FHEM/DevIo.pm line 371.


Titel: Antw:FHEM for windows, does WOL and mail work
Beitrag von: ChrisD am 15 Dezember 2014, 09:55:05
Which version of Perl are you using (Strawberry/Activestate/Cygwin, 32/64 bit) ?

ChrisD



Titel: Antw:FHEM for windows, does WOL and mail work
Beitrag von: Lectere am 15 Dezember 2014, 14:01:22
I'm using Strawberry Perl (5.18.4.1-32bit)

Downloaded and installed it yesterday.,..
Titel: Antw:FHEM for windows, does WOL and mail work
Beitrag von: ChrisD am 15 Dezember 2014, 18:31:21
Do you have any modules that use BlockingCall (PRESENCE, FRITZBOX, HMinfo, MPD, OPENWEATHER, ...) ?

They don't work correctly with Strawberry or Activestate Perl, you must use Cygwin Perl.

ChrisD
Titel: Antw:FHEM for windows, does WOL and mail work
Beitrag von: Lectere am 15 Dezember 2014, 21:58:06
I've tried cygwin, but I can't find modules: MAIL::Lite and NET::Wake...

Titel: Antw:FHEM for windows, does WOL and mail work
Beitrag von: ChrisD am 16 Dezember 2014, 12:31:44
You can install the modules with CPAN. Before using CPAN you should check if make, binutils, gcc-core and gcc-g++ are installed (in Cygwin Setup). Some (older) modules will still complain about a missing compiler when you try to install them. This might help:
- open Cygwin terminal
- enter:

cd /bin
ln -s gcc.exe gcc-4
ln -s gcc.exe 'g++-4'


The module names in CPAN are case-sensitive, to install
ZitatMAIL::Lite and NET::Wake
you should use (in a Cygwin terminal)
cpan Mail::Lite
cpan Net::Wake


Win32::SerialPort doesn't exist in Cygwin, instead you can use Device::SerialPort. You will have to change your FHEM config because Device::SerialPort uses different names: COM1 -> /dev/ttyS0, COM5 -> /dev/ttyS4.

ChrisD