After cloning the master repo I cannot for the life of me get anything to compile.
I remember a few months ago I managed to get the demo apps to compile into .exe files for windows, but after cleaning my machine and re-cloning the repo I can't even do that. I remember I mucked around editing the makefiles directly, I'm sure that's the wrong way to go about it.
My ultimate goal is to get the Arduino Uno port working, then transition everything to a Microchip Studio project for AVR devices.
I have MinGW/MSYS2 installed, with a whole bunch of the w64_x86 packages/tool chains installed, and a whole bunch of pacman -Syu commands etc. to get everything up to date.
My PATH variable has C:\msys64\mingw64\include and C:\msys64\usr\include added.
The initial error was something about asm/types.h couldn't be found, but this was to do with the linux port which I don't car about at the moment, so just deleting that folder made that error go away.
Now I run build.bat from the bacnet-stack root, I get:
C:\Users\lance\OneDrive\Documents\GitHub\bacnet-stack>build.batBuildwithMinGWandMSYS:mingw.sourceforge.netmake-s-Cports/atmega168cleanThesystemcannotfindthepathspecified.make-s-Cports/bdk-atxx4-mstpcleanThesystemcannotfindthepathspecified.make-s-Cports/at91sam7scleanThesystemcannotfindthepathspecified.make-s-Cports/stm32f10xcleanThesystemcannotfindthepathspecified.make-s-Cports/stm32f4xxcleanThesystemcannotfindthepathspecified.make-s-Csrccleanmake-s-Cappscleanprocess_begin:CreateProcess(NULL,uname-s,...)failed.make-s-Capps/routercleanmake-s-Capps/router-ipv6cleanmake-s-Capps/router-mstpcleanmake-s-Capps/gatewaycleanmake-s-Cports/lwipcleanmake-s-Ctestcleanrm-rf./buildmake-s-Cappsallprocess_begin:CreateProcess(NULL,uname-s,...)failed.InfileincludedfromC:/Users/lance/OneDrive/Documents/GitHub/bacnet-stack/ports/win32/bip-init.c:46:C:/Users/lance/OneDrive/Documents/GitHub/bacnet-stack/ports/win32/bacport.h:76:10:warning:'timezone'redeclaredwithoutdllimportattribute:previousdllimportignored[-Wattributes]76|longinttimezone;|^~~~~~~~InfileincludedfromC:/Users/lance/OneDrive/Documents/GitHub/bacnet-stack/ports/win32/mstimer-init.c:32:C:/Users/lance/OneDrive/Documents/GitHub/bacnet-stack/ports/win32/bacport.h:76:10:warning:'timezone'redeclaredwithoutdllimportattribute:previousdllimportignored[-Wattributes]76|longinttimezone;|^~~~~~~~InfileincludedfromC:/Users/lance/OneDrive/Documents/GitHub/bacnet-stack/ports/win32/datetime-init.c:18:C:/Users/lance/OneDrive/Documents/GitHub/bacnet-stack/ports/win32/bacport.h:76:10:warning:'timezone'redeclaredwithoutdllimportattribute:previousdllimportignored[-Wattributes]76|longinttimezone;|^~~~~~~~Infileincludedfrommain.c:49:C:/Users/lance/OneDrive/Documents/GitHub/bacnet-stack/ports/win32/bacport.h:76:10:warning:'timezone'redeclaredwithoutdllimportattribute:previousdllimportignored[-Wattributes]76|longinttimezone;|^~~~~~~~InfileincludedfromC:/Users/lance/OneDrive/Documents/GitHub/bacnet-stack/src/bacnet/basic/object/client/device-client.c:35:C:/Users/lance/OneDrive/Documents/GitHub/bacnet-stack/ports/win32/bacport.h:76:10:warning:'timezone'redeclaredwithoutdllimportattribute:previousdllimportignored[-Wattributes]76|longinttimezone;|^~~~~~~~C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe:C:/Users/lance/OneDrive/Documents/GitHub/bacnet-stack/src/bacnet/basic/object/client/device-client.o:device-client.:(.data$timezone+0x0):multipledefinitionof`timezone'; main.o:main.c:(.data$timezone+0x0): first defined hereC:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Users/lance/OneDrive/Documents/GitHub/bacnet-stack/apps/lib/libbacnet.a(bip-init.o):bip-init.c:(.data$timezone+0x0): multiple definition of `timezone';main.o:main.c:(.data$timezone+0x0):firstdefinedhereC:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe:C:/Users/lance/OneDrive/Documents/GitHub/bacnet-stack/apps/lib/libbacnet.a(datetime-init.o):datetime-init.:(.data$timezone+0x0):multipledefinitionof`timezone';main.o:main.c:(.data$timezone+0x0):firstdefinedherecollect2.exe:error:ldreturned1exitstatusmake[2]:***[bacrp.exe]Error1make[1]:***[readprop.all]Error2make:***[apps]Error2C:\Users\lance\OneDrive\Documents\GitHub\bacnet-stack>
if I just run directly the command make clean all I get:
C:\Users\lance\OneDrive\Documents\GitHub\bacnet-stack>makecleanallmake-s-Cports/atmega168cleanThesystemcannotfindthepathspecified.make-s-Cports/bdk-atxx4-mstpcleanThesystemcannotfindthepathspecified.make-s-Cports/at91sam7scleanThesystemcannotfindthepathspecified.make-s-Cports/stm32f10xcleanThesystemcannotfindthepathspecified.make-s-Cports/stm32f4xxcleanThesystemcannotfindthepathspecified.make-s-Csrccleanmake-s-Cappscleanprocess_begin:CreateProcess(NULL,uname-s,...)failed.make-s-Capps/routercleanmake-s-Capps/router-ipv6cleanmake-s-Capps/router-mstpcleanmake-s-Capps/gatewaycleanmake-s-Cports/lwipcleanmake-s-Ctestcleanrm-rf./buildmake-s-Cappsallprocess_begin:CreateProcess(NULL,uname-s,...)failed.make[2]:***Noruletomaketarget`/bip-init.o', needed by `C:/Users/lance/OneDrive/Documents/GitHub/bacnet-stack/apps/lib/libbacnet.a'.Stop.make[1]:***[lib.all]Error2make:***[apps]Error2C:\Users\lance\OneDrive\Documents\GitHub\bacnet-stack>
but I assume that's something to do with not setting the BACNET_PORT variable, as the .bat does?
Further, I can't even see how you would compile the arduino port. Would you please be able to point me in the right direction here?
Do I need to setup some config files or something?
Do I have MinGW installed incorrectly or some packages missing? Maybe I should try MinGW32 instead of 64?
Sorry I'm a bit of a noob, I'm used to a nice IDE and just hitting the "upload" button... hahaha
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The apps/Makefile does some substitution for the targeted ports/ folder files, and needs a bit of help to compile on a native setup (can also be used to cross-compile). I created a 'win32' target in the root makefile to accomplish this on Windows. Traditionally, Makefile are used on POSIX systems (Linux, BSD, etc), so the default 'make' without tweaking only works on POSIX.
To build the example command line applications for BACnet/IP under Windows use git bash.
git bash: https://git-scm.com/downloads
$ make win32
Unfortunately, I have not kept the Makefile builds working under Windows command line and Power Shell (not sure what I broke from 0.8.x branch)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for your reply, I appreciate you taking the time to answer my question.
Unfortunately I could not get the Git bash shell to do anything different from CMD.exe or MinGW64 on my machine - still the same complaint about timezone being declared in multiple places.
Then I faffed around with the PATH variable, and removed the mingw64\bin folder... now "make" is pointing to usr\bin\make.exe? Then I get the following gobbledegook:
$makewin32makeBACNET_PORT=win32-s-CappsallInfileincludedfrom/C/users/lance/OneDrive/Documents/GitHub/bacnet-stack/src/bacnet/bacstr.c:40:/C/users/lance/OneDrive/Documents/GitHub/bacnet-stack/src/bacnet/bacstr.c:Infunction‘octetstring_init_ascii_hex’:/C/users/lance/OneDrive/Documents/GitHub/bacnet-stack/src/bacnet/bacstr.c:1014:39:warning:arraysubscripthastype‘char’[-Wchar-subscripts]1014|if(!isalnum(ascii_hex[index])){|~~~~~~~~~^~~~~~~Infileincludedfrom/usr/include/w32api/winsock2.h:56,from/C/users/lance/OneDrive/Documents/GitHub/bacnet-stack/ports/win32/bacport.h:49,frommain.c:49:/usr/include/w32api/psdk_inc/_fd_types.h:100:2:warning:#warning"fd_set and associated macros have been defined in sys/types. This can cause runtime problems with W32 sockets"[-Wcpp]100|#warning"fd_set and associated macros have been defined in sys/types. \ | ^~~~~~~In file included from /C/users/lance/OneDrive/Documents/GitHub/bacnet-stack/ports/win32/bacport.h:49, from main.c:49:/usr/include/w32api/winsock2.h:1031:34: error: conflicting types for ‘select’; have ‘int(int, fd_set *, fd_set *, fd_set *, struct __ms_timeval * const)’ 1031 | WINSOCK_API_LINKAGE int WSAAPI select(int nfds,fd_set *readfds,fd_set *writefds,fd_set *exceptfds,const PTIMEVAL timeout); | ^~~~~~In file included from /usr/include/sys/types.h:50, from /usr/include/stdio.h:61, from main.c:28:/usr/include/sys/select.h:76:5: note: previous declaration of ‘select’ with type ‘int(int, fd_set *, fd_set *, fd_set *, struct timeval *)’ 76 | int select __P ((int __n, fd_set *__readfds, fd_set *__writefds, | ^~~~~~In file included from main.c:49:/C/users/lance/OneDrive/Documents/GitHub/bacnet-stack/ports/win32/bacport.h:62: warning: ignoring ‘#pragma warning ’ [-Wunknown-pragmas] 62 | #pragma warning(disable : 4996) |/C/users/lance/OneDrive/Documents/GitHub/bacnet-stack/ports/win32/bacport.h:64: warning: ignoring ‘#pragma comment ’ [-Wunknown-pragmas] 64 | #pragma comment(lib, "winmm.lib")|make[2]:***[Makefile:27: main.o]Error1make[1]:***[Makefile:163: readprop.all]Error2make:***[Makefile:18: win32]Error2
So I'm assuming I'm just an idiot for trying to use gcc on Windows? Maybe I'll get my act together and get a Linux dual boot going at some point... haha
However, on a more positive note I was able to compile the atmega168 port:
$ make atmega168
make -s -C ports/atmega168 clean all
../../src/bacnet/bacreal.c: In function'encode_bacnet_double':
../../src/bacnet/bacreal.c:180:31: warning: 'my_data.byte[7]' is used uninitialized in this function[-Wuninitialized]
apdu[0]= my_data.byte[7];
~~~~~~~~~~~~^~~
../../src/bacnet/bacreal.c:181:31: warning: 'my_data.byte[6]' is used uninitialized in this function[-Wuninitialized]
apdu[1]= my_data.byte[6];
~~~~~~~~~~~~^~~
../../src/bacnet/bacreal.c:182:31: warning: 'my_data.byte[5]' is used uninitialized in this function[-Wuninitialized]
apdu[2]= my_data.byte[5];
~~~~~~~~~~~~^~~
../../src/bacnet/bacreal.c:183:31: warning: 'my_data.byte[4]' is used uninitialized in this function[-Wuninitialized]
apdu[3]= my_data.byte[4];
~~~~~~~~~~~~^~~
device.c: In function'Device_Read_Property':
device.c:315:9: warning: case value '513' not in enumerated type'BACNET_PROPERTY_ID'{aka 'enum <anonymous>'}[-Wswitch]case(BACNET_PROPERTY_ID)513:
^~~~
device.c:308:9: warning: case value '9600' not in enumerated type'BACNET_PROPERTY_ID'{aka 'enum <anonymous>'}[-Wswitch]case(BACNET_PROPERTY_ID)9600:
^~~~
device.c: In function'Device_Write_Property':
device.c:435:9: warning: case value '9600' not in enumerated type'BACNET_PROPERTY_ID'{aka 'enum <anonymous>'}[-Wswitch]case(BACNET_PROPERTY_ID)9600:
^~~~
text data bss dec hex filename
2024611434720707 50e3 bacnet.elf
There is also a nice Atmel project file there that miraculously opened on my machine OK. I was able to get the project building & writing to my Arduino Uno using avrdude. I have it half working (using "MS/TP", except really it's just a USB cable to the Uno... I guess the Uno's USB chip kind of takes the place of a serial-to-COM port adapter in this case, haha) - the device is discovered but I can't read any properties & Yabe reports a lot of garbage data... see attached image if you're interested.
I think from here I'll be able to bring in the IP datalink & WizNet5100 libraries & get it working on BACnet/IP myself :)
I may come back and ask you for help at some point, if that's OK!
#!/bin/shaliasmake=mingw32-make.exe
PATH=/c/msys64/mingw64/bin:$PATHexportMAKE=mingw32-make.exe
#export CC=mingw32-gcc.exeexportOBJCOPY=objcopy.exe
#export AR=ar.exe#export SIZE=size.exeexportCC=x86_64-w64-mingw32-gcc.exe
exportAR=x86_64-w64-mingw32-gcc-ar.exe
exportNM=x86_64-w64-mingw32-gcc-nm.exe
#make clean#make all
make BACNET_PORT=win32 clean
make BACNET_PORT=win32 BUILD=release clean all
It seems like I got a whole lot further this time! However, after half of the .o files were created, it STILL crashed... don't panic - keep reading! ...with the following error, again, complaining apout multiple definitions of timezone:
lance.t@WGTNLAP06MINGW64/c/users/lance.t/source/GitHub/BACSTACK_C/bacnet-stack$./build.shmingw32-make.exe-s-Cports/atmega168cleanmingw32-make.exe-s-Cports/bdk-atxx4-mstpcleanmingw32-make.exe-s-Cports/at91sam7scleanmingw32-make.exe-s-Cports/stm32f10xcleanmingw32-make.exe-s-Cports/stm32f4xxcleanmingw32-make.exe-s-Csrccleanmingw32-make.exe-s-Cappscleanmingw32-make.exe-s-Capps/routercleanmingw32-make.exe-s-Capps/router-ipv6cleanmingw32-make.exe-s-Capps/router-mstpcleanmingw32-make.exe-s-Capps/gatewaycleanmingw32-make.exe-s-Cports/lwipcleanmingw32-make.exe-s-Ctestcleanrm-rf./buildmingw32-make.exe-s-Cports/atmega168cleanmingw32-make.exe-s-Cports/bdk-atxx4-mstpcleanmingw32-make.exe-s-Cports/at91sam7scleanmingw32-make.exe-s-Cports/stm32f10xcleanmingw32-make.exe-s-Cports/stm32f4xxcleanmingw32-make.exe-s-Csrccleanmingw32-make.exe-s-Cappscleanmingw32-make.exe-s-Capps/routercleanmingw32-make.exe-s-Capps/router-ipv6cleanmingw32-make.exe-s-Capps/router-mstpcleanmingw32-make.exe-s-Capps/gatewaycleanmingw32-make.exe-s-Cports/lwipcleanmingw32-make.exe-s-Ctestcleanrm-rf./buildmingw32-make.exe-s-CappsallInfileincludedfromC:/users/lance.t/source/GitHub/BACSTACK_C/bacnet-stack/ports/win32/bip-init.c:46:C:/users/lance.t/source/GitHub/BACSTACK_C/bacnet-stack/ports/win32/bacport.h:76:10:warning:'timezone'redeclaredwithoutdllimportattribute:previousdllimportignored[-Wattributes]76|longinttimezone;|^~~~~~~~InfileincludedfromC:/users/lance.t/source/GitHub/BACSTACK_C/bacnet-stack/ports/win32/mstimer-init.c:32:C:/users/lance.t/source/GitHub/BACSTACK_C/bacnet-stack/ports/win32/bacport.h:76:10:warning:'timezone'redeclaredwithoutdllimportattribute:previousdllimportignored[-Wattributes]76|longinttimezone;|^~~~~~~~InfileincludedfromC:/users/lance.t/source/GitHub/BACSTACK_C/bacnet-stack/ports/win32/datetime-init.c:18:C:/users/lance.t/source/GitHub/BACSTACK_C/bacnet-stack/ports/win32/bacport.h:76:10:warning:'timezone'redeclaredwithoutdllimportattribute:previousdllimportignored[-Wattributes]76|longinttimezone;|^~~~~~~~Infileincludedfrommain.c:49:C:/users/lance.t/source/GitHub/BACSTACK_C/bacnet-stack/ports/win32/bacport.h:76:10:warning:'timezone'redeclaredwithoutdllimportattribute:previousdllimportignored[-Wattributes]76|longinttimezone;|^~~~~~~~InfileincludedfromC:/users/lance.t/source/GitHub/BACSTACK_C/bacnet-stack/src/bacnet/basic/object/client/device-client.c:35:C:/users/lance.t/source/GitHub/BACSTACK_C/bacnet-stack/ports/win32/bacport.h:76:10:warning:'timezone'redeclaredwithoutdllimportattribute:previousdllimportignored[-Wattributes]76|longinttimezone;|^~~~~~~~C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe:C:/users/lance.t/source/GitHub/BACSTACK_C/bacnet-stack/src/bacnet/basic/object/client/device-client.o:device-client.:(.data$timezone+0x0):multipledefinitionof`timezone'; main.o:main.c:(.data$timezone+0x0): first defined hereC:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/users/lance.t/source/GitHub/BACSTACK_C/bacnet-stack/apps/lib/libbacnet.a(bip-init.o):bip-init.c:(.data$timezone+0x0): multiple definition of `timezone';main.o:main.c:(.data$timezone+0x0):firstdefinedhereC:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe:C:/users/lance.t/source/GitHub/BACSTACK_C/bacnet-stack/apps/lib/libbacnet.a(datetime-init.o):datetime-init.:(.data$timezone+0x0):multipledefinitionof`timezone';main.o:main.c:(.data$timezone+0x0):firstdefinedherecollect2.exe:error:ldreturned1exitstatusmingw32-make[2]:***[Makefile:19: bacrp.exe]Error1mingw32-make[1]:***[Makefile:163: readprop.all]Error2mingw32-make:***[Makefile:42: apps]Error2
So actually, the solution was to comment out the line long int timezone; in bacport.h and datetime-init.h in the win32 port folder! Judging by the comments around that line, it was added in as a hack to get around some error with time.h, which now appears fixed.
Got BACnet MS/TP working on an Arduino Uno using a Microchip Studio project with AVRDUDE setup as an External Tool, and the ATMega168 port in the ports folder.
Without an RS485 line driver there is garbage on the data lines, as the code sends 4 octets of 0xFF (plus 4x start & 4x stop bits) with the RS485 TX Enable pin LOW in order to "busy wait" for exactly 40 bit times.
There was also a bug that stopped the PROP_OBJECT_LIST from working correctly - the reference to Handler_Transmit_Buffer was not being used at all inside the Encode_Property_APDU method. NOTE: This specifically refers to the h_rp.c file in the ATMega168 port folder.
/* most cases will be error */ack_len=rp_ack_encode_apdu_init(&Handler_Transmit_Buffer[pdu_len],service_data->invoke_id,&data);/* FIXME: add buffer len as passed into function or use smart buffer */data.error_class=ERROR_CLASS_OBJECT;data.error_code=ERROR_CODE_UNKNOWN_OBJECT;property_len=Encode_Property_APDU(&Handler_Transmit_Buffer[pdu_len + ack_len],&data);
Works when changed to:
/* most cases will be error */ack_len=rp_ack_encode_apdu_init(&Handler_Transmit_Buffer[pdu_len],service_data->invoke_id,&data);/* configure our storage */data.application_data=&Handler_Transmit_Buffer[pdu_len + ack_len];/* FIXME: add buffer len as passed into function or use smart buffer */data.error_class=ERROR_CLASS_OBJECT;data.error_code=ERROR_CODE_UNKNOWN_OBJECT;property_len=Encode_Property_APDU(&data);
Screenshot shows the device being browsed & polled in Yabe.
Hi Steve and team,
After cloning the master repo I cannot for the life of me get anything to compile.
I remember a few months ago I managed to get the demo apps to compile into
.exe
files for windows, but after cleaning my machine and re-cloning the repo I can't even do that. I remember I mucked around editing the makefiles directly, I'm sure that's the wrong way to go about it.My ultimate goal is to get the Arduino Uno port working, then transition everything to a Microchip Studio project for AVR devices.
I have MinGW/MSYS2 installed, with a whole bunch of the
w64_x86
packages/tool chains installed, and a whole bunch ofpacman -Syu
commands etc. to get everything up to date.My PATH variable has
C:\msys64\mingw64\include
andC:\msys64\usr\include
added.The initial error was something about
asm/types.h
couldn't be found, but this was to do with the linux port which I don't car about at the moment, so just deleting that folder made that error go away.Now I run build.bat from the bacnet-stack root, I get:
if I just run directly the command
make clean all
I get:but I assume that's something to do with not setting the
BACNET_PORT
variable, as the.bat
does?Further, I can't even see how you would compile the arduino port. Would you please be able to point me in the right direction here?
Do I need to setup some config files or something?
Do I have MinGW installed incorrectly or some packages missing? Maybe I should try MinGW32 instead of 64?
Sorry I'm a bit of a noob, I'm used to a nice IDE and just hitting the "upload" button... hahaha
The apps/Makefile does some substitution for the targeted ports/ folder files, and needs a bit of help to compile on a native setup (can also be used to cross-compile). I created a 'win32' target in the root makefile to accomplish this on Windows. Traditionally, Makefile are used on POSIX systems (Linux, BSD, etc), so the default 'make' without tweaking only works on POSIX.
To build the example command line applications for BACnet/IP under Windows use git bash.
git bash: https://git-scm.com/downloads
$ make win32
Unfortunately, I have not kept the Makefile builds working under Windows command line and Power Shell (not sure what I broke from 0.8.x branch)
re: arduino port - hasn't been kept up to date since it's contribution by Miguel Fernandes - sorry!
Hi Steve,
Thanks for your reply, I appreciate you taking the time to answer my question.
Unfortunately I could not get the Git bash shell to do anything different from CMD.exe or MinGW64 on my machine - still the same complaint about
timezone
being declared in multiple places.Then I faffed around with the PATH variable, and removed the mingw64\bin folder... now "make" is pointing to usr\bin\make.exe? Then I get the following gobbledegook:
So I'm assuming I'm just an idiot for trying to use gcc on Windows? Maybe I'll get my act together and get a Linux dual boot going at some point... haha
However, on a more positive note I was able to compile the atmega168 port:
There is also a nice Atmel project file there that miraculously opened on my machine OK. I was able to get the project building & writing to my Arduino Uno using avrdude. I have it half working (using "MS/TP", except really it's just a USB cable to the Uno... I guess the Uno's USB chip kind of takes the place of a serial-to-COM port adapter in this case, haha) - the device is discovered but I can't read any properties & Yabe reports a lot of garbage data... see attached image if you're interested.
I think from here I'll be able to bring in the IP datalink & WizNet5100 libraries & get it working on BACnet/IP myself :)
I may come back and ask you for help at some point, if that's OK!
Cheers
Lance
Sometimes I make changes in my environment and forget that others cannot follow that. I checked my git bash .bashrc file:
I probably ended up force-using mingw32 after spending days trying to get mingw64 to do the same. Does that get win32 to compile for you?
I updated build.bat to compile using MinGW32 in Windows Command Prompt.
I update build.sh to compile using MinGW32 in git-bash environment.
https://sourceforge.net/p/bacnet/src/ci/1c1b6762472d89851ebf7d9bd15e99d21c8f5de6/
Ah ha. From Microsoft's documentation: "You cannot run a doskey macro from a batch program"
Not to worry, what I did here is make a copy of
mingw32-make.exe
and call itmake.exe
.Then I had to modify the files as follows - adding the
x86_64-w64-
prefix to the binaries:build.bat
:build.sh
:It seems like I got a whole lot further this time! However, after half of the
.o
files were created, it STILL crashed... don't panic - keep reading! ...with the following error, again, complaining apout multiple definitions oftimezone
:So actually, the solution was to comment out the line
long int timezone;
inbacport.h
anddatetime-init.h
in thewin32
port folder! Judging by the comments around that line, it was added in as a hack to get around some error withtime.h
, which now appears fixed.using
set BACNET_IFACE=xxx.xxx.xxx.xxx
andbaciam.exe 1111
from command prompt, I see the entry pop into Yabe, as expected.Thanks for your help!
Update for those interested,
Got BACnet MS/TP working on an Arduino Uno using a Microchip Studio project with AVRDUDE setup as an External Tool, and the ATMega168 port in the
ports
folder.Without an RS485 line driver there is garbage on the data lines, as the code sends 4 octets of 0xFF (plus 4x start & 4x stop bits) with the RS485 TX Enable pin LOW in order to "busy wait" for exactly 40 bit times.
There was also a bug that stopped the PROP_OBJECT_LIST from working correctly - the reference to
Handler_Transmit_Buffer
was not being used at all inside theEncode_Property_APDU
method. NOTE: This specifically refers to theh_rp.c
file in the ATMega168 port folder.Works when changed to:
Screenshot shows the device being browsed & polled in Yabe.
Thank you for posting the resulting solution! I pushed a fix into ports/atmega168 today.
https://github.com/bacnet-stack/bacnet-stack/pull/323