hamberthm at gmail.com
2017-Mar-10 22:25 UTC
[Nut-upsuser] Need nutdrv_atcl_usb for Windows port
UPDATE: I managed to build the windows port using a guide a user posted a while ago. I?ve also corrected a couple of variables like the SleepEx() function instead of the sleep() used in Linux. I?ve successfully compiled the EXE for nutdrv_atcl_usb but when I execute it via upsdrvctl it gives the following output: C:\MinGW\msys\1.0\home\Administrator\nut-2.6.5-7\drivers>nutdrv_atcl_usb nutdrv_atcl_usb:./.libs/lt-nutdrv_atcl_usb.c:233: FATAL: couldn't find nutdrv_atcl_usb. Now I have no idea how to continue? Gesendet von Mail f?r Windows 10 Von: hamberthm at gmail.com Gesendet: Dienstag, 7. M?rz 2017 00:50 An: nut-upsuser at lists.alioth.debian.org Betreff: Need nutdrv_atcl_usb for Windows port Hello! I?ve posted this a while ago, I have an UPS that reports itself as ?ATCL FOR UPS?. I was suggested by you to use a Linux box and try whether the NUTDRV_ATCL_USB works or not with my UPS. I?ve done so and YES it works. Now I need to know how can I get a port of this driver to the Windows version of NUT. I?m a complete noob in programming, and I have basic C knowledge. PLEASE I need a helping hand ? Regards Humberto Gesendet von Mail f?r Windows 10 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20170310/0d3355aa/attachment.html>
On Mar 10, 2017, at 5:25 PM, hamberthm at gmail.com wrote:> > UPDATE: I managed to build the windows port using a guide a user posted a while ago.Which guide?> I?ve also corrected a couple of variables like the SleepEx() function instead of the sleep() used in Linux. I?ve successfully compiled the EXE for nutdrv_atcl_usb but when I execute it via upsdrvctl it gives the following output: > > C:\MinGW\msys\1.0\home\Administrator\nut-2.6.5-7\drivers>nutdrv_atcl_usb > nutdrv_atcl_usb:./.libs/lt-nutdrv_atcl_usb.c:233: FATAL: couldn't find nutdrv_atcl_usb. > > Now I have no idea how to continue? >The lt-*.c part indicates that the problem is likely related to libtool. Do you need any of the functionality like nut-scanner which requires libtool? If not, it might be possible to reconfigure for a static build. It might help to see the ./configure parameters you used, plus any patches. Also, versions of the various MinGW/msys components would probably be useful for anyone else trying to build for Windows.
Humberto Möckel
2017-Mar-11 21:29 UTC
[Nut-upsuser] Need nutdrv_atcl_usb for Windows port
Hello Charles and first of all, thank you so mucho for replying. I really appreciate your help. This is the guide I was talking about: http://lists.alioth.debian.org/pipermail/nut-upsdev/2016-April/007171.html All the versions of MinGW and msys plugins I'm using are exactly the ones listed on that guide written by Denis Serov. The procedure I used to compile is also the same as Denis suggested, but I made some changes on my own in the "build NUT" step since I added the "nutdrv_atcl_usb.c" source file from the last version of NUT, not present in the latest Windows build. Those are: - Patched file "nut-usbinfo.pl" as otherwise it will abort the make process with an error. In the section "process the driver name" with the following code (same as latest NUT linux version): elsif ($nameFile eq "nutdrv_atcl_usb.c") { $driver="nutdrv_atcl_usb"; - Patched the "makefile.am" in the drivers folder so it will include the source in the build. I added nutdrv_atcl_usb to the USB_LIBUSB_DRIVERLIST and added the LDADD/CFLAGS. NOTE:* I have no idea what those edits do.* The only thing I wanted is the compiler to see the new source and compile it. So I just blindly searched mentions of the driver inside all the latest linux build sources and tried to patch them the same way on the outdated windows port. The two files above were all I could find where the driver was mentioned. Also made two minor changes to the source file itself, fixed one variable that was giving error at building (I think it was something like USB sleep that I fixed to 5000), and the SleepEx() function instead of the sleep() one since the windows port was redefining sleep() to Sleep() and this one doesn't return 0 once the time has elapsed. For the build commands, I use as follows. I added the flag "--enable-maintainer-mode" as I read in the developer guide to allow regeneration of the makefile.in: [shell] cd /home/Administrator/nut-2.6.5-7 autogen.sh --enable-maintainer-mode ./configure --with-doc=html-single CPPFLAGS="-DWINVER=0x0501 -D_WIN32_WINNT=0x0501" --enable-maintainer-mode export XML_CATALOG_FILES=/mingw/etc/xml/catalog make cd /docs/man make html-man Now in response to you suggestion; I have no idea what NUT Scanner does and if I need it or not. The only thing I want is to use this driver so I can manage my UPS with NUT, and if possible to publish the changes I made so other people can use it. I will wait for your answer anxiously. It has been a week of hours of trial and error and making this to work would be so nice! THANKS! On Sat, Mar 11, 2017 at 11:20 AM, Charles Lepple <clepple at gmail.com> wrote:> On Mar 10, 2017, at 5:25 PM, hamberthm at gmail.com wrote: > > > > UPDATE: I managed to build the windows port using a guide a user posted > a while ago. > > Which guide? > > > I?ve also corrected a couple of variables like the SleepEx() function > instead of the sleep() used in Linux. I?ve successfully compiled the EXE > for nutdrv_atcl_usb but when I execute it via upsdrvctl it gives the > following output: > > > > C:\MinGW\msys\1.0\home\Administrator\nut-2.6.5-7\drivers>nutdrv_atcl_usb > > nutdrv_atcl_usb:./.libs/lt-nutdrv_atcl_usb.c:233: FATAL: couldn't find > nutdrv_atcl_usb. > > > > Now I have no idea how to continue? > > > > The lt-*.c part indicates that the problem is likely related to libtool. > Do you need any of the functionality like nut-scanner which requires > libtool? If not, it might be possible to reconfigure for a static build. > > It might help to see the ./configure parameters you used, plus any > patches. Also, versions of the various MinGW/msys components would probably > be useful for anyone else trying to build for Windows.-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20170311/606fed0b/attachment.html>