BACnet MS/TP and Automatic Addressing

Lego Coin Pusher GambleA recent query on the BACnet-L mailing list reminded me that I should probably post an update to my previous article about BACnet and Software Patents in 2009.  In the previous article, I lamented about a patent that was granted while the BACnet MS/TP working group had been working on standardizing several mechanisms to allow automatic MAC addressing.

The 3 methods of configuring an MS/TP MAC address without having to set a DIP switch that the MS/TP working group discussed many years ago included DHCP, ZeroConfig, and direct configuration via broadcast. Two of the methods have had proposals that moved from MS/TP working group into SSPC-135 BACnet committee in 2013, and are currently awaiting committee approval (or perhaps some updates from me).

STK-030:  MSTP Zero-Config
STK-034 (which combined STK-028): Who-Am-I and You-Are services.
CG-005: MSTP DHCP.

From STK-034:

The Who-Am-I service is used by a sending BACnet-user to indicate that it requires identity configuration via the You-Are service.

The You-Are service is used by a client BACnet-user to configure the MAC address and BACnet Device object instance number in a remote device.

From the STK-030:

This proposal describes a scheme for allowing devices to choose their own MAC address after monitoring the MS/TP line for available MAC addresses indicated by unanswered PollForMaster frames.

Since the token passes rapidly between nodes, and we must assume that the zero-configuration process may occur in the presence of statically configured nodes executing the current 135-2010 or earlier state machine, the only real opportunity to inject packet without holding a Token comes during the Poll For Master sequence.
* Assume the node has listened to the token passing for a while and selected an address at random (or a previously used address) from the list of addresses that appear to be available. The addresses will be selected from a range of 64 to 127, leaving addresses 0 to 64 for fixed address nodes which will reduce the likelihood of collisions due to variable start up time.
* Simply sending a Reply To Poll For Master is not enough of a confirmation, because there would be no way to distinguish nodes through their UIDs, nor to distinguish a dynamically addressed node from a statically configured node that happened to come online at that time.
* After responding with a Reply To Poll For Master frame at an unused address, and receiving a Token frame, a Test Request frame will be sent by a node wishing to claim an address. The Test Request frame will include some unique information in the Data portion of the frame. This will cause the Poll For Master and Token sending node to reply with a Test Response frame which will include the unique data.
* The zero configuration node will already have a list of peers, and can simply pass the Token to the Next Station, and continue with the normal Master Node State Machine.
* The zero configuration node will monitor all MS/TP traffic, and will stop using its chosen MAC address if it sees another node communicating with an identical source MAC. The zero configuration node will start searching for another MAC at that time. The monitoring can be easily done after some modification to the DataNotForUs transition and SKIP_DATA state of the Receive Node Finite State Machine for nodes that support Automatic Addressing of MS/TP.

This scheme was proposed during BACnet MS/TP working group meetings in Salt Lake City in June, 2008. The zero-configuration scheme was researched and developed, and actually implemented into products in May of 2010 to verify the approach, prior to creating this proposal in October of 2010.

There is an example of the STK-030 (initial proposed version – not up to date) method in the open source BACnet Protocol Stack hosted at bacnet.sourceforge.net in the bacnet-stack/ports/stm32f10x/automac.c and bacnet-stack/ports/stm32f10x/dlsmtp.c files.  The STK-030 proposal was reviewed by KMC and does not infringe on their patent.

Posted in BACnet, rights | 2 Comments

BACnet: The Global Standard for Building Automation and Control Networks

BACnet-book-NewmanMy friend and BACnet colleague, Mike Newman, the father of BACnet, recently finished writing a book about BACnet.  BACnet: The Global Standard for Building Automation and Control Networks, was recently published and is for sale at Amazon. I haven’t read the entire book yet, only portions of it while providing peer review for Mike, but it should be a fun and informative book to read.

Posted in BACnet | Leave a comment

AVR Dragon JTAG on Ubuntu Precise

Lt. Col. Pat Ichi Karg at Little Rock Air Show in F4 PhantomI have a BACnet Development Kit which uses the example firmware compiled from the open source BACnet Protocol Stack hosted on SourceForge.net using gcc-avr. I attempted to load the firmware onto the kit using an Atmel AVR Dragon USB JTAG programmer.  I connected the AVR Dragon to my Ubuntu Precise Linux Laptop and attached the 2×5 JTAG cable to the development kit board, and attempted to program using avrdude as I had many times over the last several years.

avrdude -c dragon_jtag -p m644p -P usb -B 8 -U hfuse:w:0x93:m -U lfuse:w:0xD7:m -U efuse:w:0xFC:m
avrdude: usb_open(): cannot read serial number "error sending control message: Operation not permitted"
avrdude: usb_open(): cannot read product name "error sending control message: Operation not permitted"
avrdude: usbdev_open(): error setting configuration 1: could not set config 1: Operation not permitted
avrdude: usbdev_open(): did not find any USB device "usb"
make: *** [writefuses] Error 1

Aha, I said, I must need to edit the UDEV rules for AVRICEas I did previously.  But alas, that did not solve the problem.  It seems the syntax for the UDEV rules have changed from using ‘SYSFS’ to using ‘ATTR’, and so the new rules use the following text in a /etc/udev/rules.d/45-atmel.rules file :

# udev rules file for atmel usb devices (for udev 0.98 version) 
# 
SUBSYSTEM!="usb_device", ACTION!="add", GOTO="avrisp_end"
# Atmel Corp.JTAG ICE mkII 
ATTR{idVendor}=="03eb", ATTR{idProduct}=="2103", MODE="660", GROUP="dialout"
# Atmel Corp. AVRISP mkII
ATTR{idVendor}=="03eb", ATTR{idProduct}=="2104", MODE="660", GROUP="dialout"
# Atmel Corp. Dragon
ATTR{idVendor}=="03eb", ATTR{idProduct}=="2107", MODE="660", GROUP="dialout"
LABEL="avrisp_end"

After saving the file, unplugging and plugging the AVR Dragon into the USB port, I was finally able to program the board.

avrdude -c dragon_jtag -p m644p -P usb -B 8 -U hfuse:w:0x93:m -U lfuse:w:0xD7:m -U efuse:w:0xFC:m
avrdude: jtagmkII_initialize(): warning: OCDEN fuse not programmed, single-byte EEPROM updates not possible
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.00s
avrdude: Device signature = 0x1e960a
avrdude: reading input file "0x93"
avrdude: writing hfuse (1 bytes):
Writing | ################################################## | 100% 0.01s
avrdude: 1 bytes of hfuse written
avrdude: verifying hfuse memory against 0x93:
avrdude: load data hfuse data from input file 0x93:
avrdude: input file 0x93 contains 1 bytes
avrdude: reading on-chip hfuse data:
Reading | ################################################## | 100% 0.00s
avrdude: verifying ...
avrdude: 1 bytes of hfuse verified
avrdude: reading input file "0xD7"
avrdude: writing lfuse (1 bytes):
Writing | ################################################## | 100% 0.01s
avrdude: 1 bytes of lfuse written
avrdude: verifying lfuse memory against 0xD7:
avrdude: load data lfuse data from input file 0xD7:
avrdude: input file 0xD7 contains 1 bytes
avrdude: reading on-chip lfuse data:
Reading | ################################################## | 100% 0.00s
avrdude: verifying ...
avrdude: 1 bytes of lfuse verified
avrdude: reading input file "0xFC"
avrdude: writing efuse (1 bytes):
Writing | ################################################## | 100% 0.01s
avrdude: 1 bytes of efuse written
avrdude: verifying efuse memory against 0xFC:
avrdude: load data efuse data from input file 0xFC:
avrdude: input file 0xFC contains 1 bytes
avrdude: reading on-chip efuse data:
Reading | ################################################## | 100% 0.00s
avrdude: verifying ...
avrdude: 1 bytes of efuse verified
avrdude: safemode: Fuses OK
avrdude done. Thank you.
Posted in Linux | Leave a comment

BACnet Committee Meets in San Antonio

Carl Neilson is the incoming Chairman of the BACnet committee.

Our BACnet committee and working groups met in San Antonio in June, 2012. The Riverwalkwas an interesting place to walk and find some food!  The BACnet committee leadership changed at this meeting: Carl Neilson is now chairing the committee, with Bernhard as vice-chair and Mike as Secretary.  David Fisher presented the annual Swan Award to Carl Neilson. Three old-timers, Steve Bushby, Mike Newman, David Fisher received recognition for 25 years since the inception the BACnet SPC.

Steve Bushby, Mike Newman, and David Fisher

View of San Antonio from BTL working group meeting.

The Alamo in San Antonio

Posted in BACnet | Leave a comment

BACnet Committee Meets in San Francisco

Our BACnet committee and working groups met in San Francisco in May, 2012.  It was fun to see friends, enjoy some cool weather, and eat some good food in a big city.

BACnet meetin in SF at PGEBACnet meeting in SF at PGE

Next door to Pacific Gas and Electric, our host, is a restaurant called Buca di Beppo, an Italian restaurant known for its large portions and eccentric decor.  We had lunch at one of the specialty tables – a “Pope’s Table” that seats 12-18.

One night, our group was feeling adventuresome, and loaded onto BART to find an infamous San Francisco dining establishment called Rosamunde Sausage Grill.

A lot of our proposals had gone out for public review in the Spring, and so we had to create comment responses to any of the comments received.  Some of the proposals sailed through the public review process without needing any substantive changes, which mean they will go to ASHRAE and be reviewed and approved for publication.

BACnet Property_List property

One of the new items that made it through publication was the Property_List property, which will be added to all objects for the new revision of BACnet. I proposed this little gem in 2007, and it was met with stiff resistance by those developing XML to describe BACnet devices.  The pundits said that if we introduced the Property_List property, everyone would use it instead of XML, and that we should wait until XML and the Application Profiles working group completed their work.  The proposal was tabled for a couple years, but came to life again during the Objects and Services working group meetings.  A few tweaks were made to the STK-026 proposal, and Add-135-2010ao was ready for public review.

12.x.X Property_List
This read only property is a BACnetARRAY of property identifiers, one property identifier for each property that exists within the object. The Object_Name, Object_Type, Object_Identifier, and Property_List properties are not included in the list.

Additionally, from the ReadPropertyMultiple specification:

The Property_List property shall not be returned when properties ALL or REQUIRED are requested.

Pretty simple, but pretty powerful for being able to discover all the properties in all the objects in a device.  One of the comments received in public review summed up our sentiments:

Property_List is a very good addition. If someone had thought of this in 1995, we could have avoided the evil “ALL” property. However, since this property is “required”, but didn’t previously exist, and since it is likely to be widely used, it is worth flagging the protocol revision at which it is introduced.

The Protocol_Revision hasn’t been issued yet for this change, since the enumerations and other numbers associated with the published specification are no longer created when the proposals are going through the public review process.

Posted in BACnet, travel | Leave a comment

BACnet Meeting and Plugfest in Atlanta

I went to the BACnet meetings in Atlanta in October, 2011. A couple of weeks later in November, 2011, I went to the BACnet Plugfest in Atlanta. Lots of fun!

The Lighting Applications working group met for a couple of days, and crafted responses to the public review comments for our Lighting Output object. We also got the draft for the next pubic review done, and it should be reviewed with only substantive changes. Good news for this object that has been in the works for many, many years. We also crafted public review responses for the Channel object and the WriteGroup service, and drafted a subsequent review document.

tin drum for lunch

Coleman, Dave, Dana, Don, and I ate at the Tin Drum restaurant for lunch. Delicious!

The BACnet meetings were again held in the spacious Georgia Tech Technology Square Research Building.

I brought a WattStopper DLM setup for the BACnet International Plugfest, held at the Westin hotel in Atlanta.  It’s always fun to have bright lights controlled by a BACnet universal dimmer!  I presented a workshop on the work that the Lighting Applications working group has been doing, with some tips for developers.  It was titled “New BACnet objects and services have been proposed to support lighting control. What can you do with them? What can you do to prepare your devices?”

Posted in BACnet | Leave a comment

BACnet Leader of the Pack Awards

BACnet International presented its annual “Leaders of the Pack” program to recognize the achievements of individuals and companies involved in the BACnet community. The Award Ceremony took place during the 2011 Facility Decisions Conference & Expo on October 11-12, 2011 in Las Vegas, NV.

I received one of the awards (although I wasn’t in Las Vegas), which was really unexpected.  The full list of recipients is listed on the BACnet International “Leaders of the Pack” website press release.

Pete Baselici was at the awards ceremony, so he received the award for me, and presented it to me when he returned.

Posted in BACnet | 1 Comment

BACnet Bill

Bill Swan at the January 2011 BACnet meeting in Las VegasI received the news yesterday that my friend, Bill Swan, died after a sudden illness.  I had just seen Bill at the interim BACnet meetings in San Francisco at the beginning of May, 2011.  A week later he was in Germany for a BACnet Plugfest.  Bill became critically ill a week later.

I have always enjoyed being around Bill. We had lots of things in common – photography, BACnet, microcontrollers, politics, family, and religion.  Twice a year we met together at BACnet meetings at the ASHRAE meetings over a weekend, and Bill would always be searching out a local Anglican church to attend, while I sought a Catholic church.  Twice a year we met during the week for BACnet interim meetings, usually in Germantown and Atlanta, and enjoyed the local food. We would compare photography ideas and equipment stories, talk about putting BACnet into tiny devices, and discuss elections and local politics.  We often talked about his family – his wife Kathy, and his daughters and how they were doing in school.

Bill Swan at the 2009 BACnet PlugfestBill was a prolific writer, and wrote the BACnet Bill blog and the Continuing Home blog.  He wrote numerous BACnet tutorials and articles.  He wrote numerous BACnet proposols (at least 89) to create new objects and services, or fix problems in BACnet, and collaborated on many more.  I recall Bill as ever the international collaborator, bringing needs from other countries into our BACnet committee.  I remember when Bill took over the BACnet Chair from Steve Bushby, and how he moved from being a timid leader, to running the BACnet meetings with confidence.

The BACnet committee and working groups are a small bunch of unique individuals, and any single contributor would be missed.  But Bill will be missed not just for his contributions, but for his friendship, creativity, and gentle nature that he brought with him.

Posted in BACnet | 2 Comments

BACnet Meetings and Embedded Systems Conference

I had BACnet meetings the week of May 2, 2011, in San Francisco. It also happened that the Embedded Systems Conference was the same week in San Jose. I perused my BACnet meeting schedule, and found that I could attend the Embedded Systems Conference on Thursday morning, which would enable me to see the exhibits, and also hear the keynote from Jeri Ellsworth.

My flight to San Francisco from Birmingham went through Houston.  In Houston, I got to ride the Automated People Mover train between concourses, always a highlight on my trips since I worked on these vehicles at several airport and downtown systems for Westinghouse Transportation Systems from 1992-1997.   The train performed flawlessly – perfect programmed stop, smooth acceleration, and very little jerk.  Much to my delight, San Francisco Airport also had Automated People Mover trains, and they also worked very well to get me to the rental car garage.

Guideway for the Automated People MoverView from Automated People Mover

The BACnet meetings were held at the The Pacific Energy Center in downtown San Francisco.  We discussed the Property_List property for objects, the Zero Config algorithm for MS/TP MAC addressing, and the You-Are service for address and device ID assignment. More importantly, we celebrated Cinqo de Mayo at Chevy’s.

BACnet Meeting at Pacific Energy CenterBACnet Meeting at Pacific Energy CenterCinco de Mayo at Chevy's

On Thursday I arrived at the Embedded Systems Conference a little early, and got to meet Jeri in her motion activated Light Emitting Dress before her talk. After the keynote, I toured the exhibits and picked up several new development kits from microcontroller vendors. The nice surprise was to see my STM32 Challenge contest entry displayed at the STM exhibit. I didn’t win, but I had fun.  The STM32 Design Challenge entry was just a simple port of my BACnet Protocol Stack to the STM32F103 ARM Cortex M3 XL-Density Performance Line microcontroller with 1 MByte of embedded Flash and 96K SRAM. I also created a printed circuit board to attach to the STM32 Discovery Kit so that I could integrate RS-485, LEDs, and a DIP switch.

Jeri Ellsworth keynote presentation at ESCT-Rex at ESCSTM32 Design Challenge Finalists

Posted in BACnet, travel | Tagged | Leave a comment

Cloudshark – Wireshark in the Cloud

Clouds from an AirplaneA post on the Wireshark developers mailing list showed up at the beginning of December, 2010, about the Cloudshark.org website.  Cloudshark is a website that allows you to view Wireshark captures online.  The captures can be in any capture format that Wireshark or T-Shark supports.  The site also allows linking to captures by using “http://cloudshark.org/view?url=” as the URL.  Here are a couple  captures that I have stored at my kargs.net/captures/ site:

BACnet MS/TP

Plugfest with Delta Controls

TimeSync Decode Noon

BACnet Services

Posted in BACnet | 1 Comment