john30 / ebusd

daemon for communication with eBUS heating systems
GNU General Public License v3.0
560 stars 130 forks source link

FreeBSD #11

Closed beam closed 7 years ago

beam commented 8 years ago

Hi, can you add FreeBSD support?

john30 commented 8 years ago

ebusd should already be compilable under FreeBSD. AFAIK you need to use the "--with-argp-lib" and "--with-argp-include" options of configure pointing to argp-standalone directories.

beam commented 8 years ago

Hi, i installed https://www.freshports.org/devel/argp-standalone/ and no extra options needed for argp. But i have to make some patches for code compilation:

diff --git a/src/ebusd/network.cpp b/src/ebusd/network.cpp
index 7d586c6..13e9505 100644
--- a/src/ebusd/network.cpp
+++ b/src/ebusd/network.cpp
@@ -28,6 +28,10 @@
 #include <poll.h>
 #endif

+#ifndef POLLRDHUP
+#define POLLRDHUP 0x2000
+#endif
+
 using namespace std;

 int Connection::m_ids = 0;
diff --git a/src/lib/ebus/device.h b/src/lib/ebus/device.h
index 3a8892e..71b0047 100644
--- a/src/lib/ebus/device.h
+++ b/src/lib/ebus/device.h
@@ -23,6 +23,8 @@
 #include <iostream>
 #include <fstream>
 #include <arpa/inet.h>
+#include <netinet/in.h>
+#include <sys/socket.h>
 #include <netdb.h>
 #include "result.h"

diff --git a/src/lib/utils/tcpsocket.cpp b/src/lib/utils/tcpsocket.cpp
index 27ed4a8..81ef810 100644
--- a/src/lib/utils/tcpsocket.cpp
+++ b/src/lib/utils/tcpsocket.cpp
@@ -20,6 +20,7 @@
 #include <cstdlib>
 #include <fcntl.h>
 #include <arpa/inet.h>
+#include <netinet/in.h>
 #include <netdb.h>
 #include <string.h>

Now i can run ebusd, but can't read from /dev/ttyU2. When i start ebusd TX and RX LEDs on adapter are on (which is diferrent from when i connect it to linux, where only incoming LED is blinking), but nothing is shown in ebusd. No idea what to do now.. :/

beam commented 8 years ago

Any idea?

john30 commented 8 years ago

which interface are you using?

beam commented 8 years ago

I bought this https://www.mikrocontroller.net/topic/346833#4405093 . Scheme is at the begging of threat. It's eBUS<->USB (FT232R) adapter.

john30 commented 8 years ago

well, the interface works, I know that. I can only assume that you have problems with the serial communication to the device. I'm not familiar with BSD, so I guess you'll have to find out yourself...

beam commented 8 years ago

Yes, when i boot on same PC linux it works, but under FreeBSD :(

john30 commented 8 years ago

It'll probably be a difference in the handling of terminal devices in BSD compared to Linux.

john30 commented 7 years ago

closed due to inactivity

rousseldenis commented 2 years ago

@john30 Could you please explain a little bit how to configure before launching make as I have argp.h not found error ?

Many thanks

rousseldenis commented 2 years ago

@john30 Could you please explain a little bit how to configure before launching make as I have argp.h not found error ?

Many thanks

Ok, found how to do it.

./configure --with-argp-lib --with-argp-include