BACnet MS/TP Wireshark Live Capture

Wireshark 2.0 brought some new features, including extcap.  Extcap allows an external application to capture packets and move them into Wireshark via a pipe.  It is the perfect feature for serial packets, such as BACnet MS/TP on RS-485, which don’t have a network interface.

How does it work?  After installing version Wireshark 2.0 or later, find the Extcap folder on your computer.  The folder is listed under Wireshark Help About Folders menu option.

help-about-wireshark-folders

Copy mstpcap.exe into the Extcap folder (create the folder if it doesn’t exist).

program-files_wireshark_extcap

Run Wireshark, and notice the new BACnet MS/TP Interfaces associated with each serial port.

wireshark-interface-list

Adjust the MS/TP Baud Rate for the particular interface.

wireshark-mstp-interface-settings

Start or Stop captures using the Capture Start or Capture Stop options after selecting the Interface.

bacnet_ms_tp_on_com6_wireshark_start_capture

Posted in BACnet | 7 Comments

A Photographer Story

A few days ago I went into a local used record & book store, and stumbled across a vinyl album that reminded me of a photo story.  Here is the cover of the album from the band AD:

Kerry Livegren AD

The band toured while I was in college, and I was on the newspaper and yearbook photo staff.  I was assigned to photograph the band.  I went to the field-house early while the band was setting up, and talked to the band members.  The drummer, Dennis Holt, asked me if I would take some photos of him and his drum kit during the show and send them to him so he could have some promotional photos.

AD - the people in the band

The concert was dark and my film was slow and I didn’t have a tripod.  I developed the film and tried to make some prints the next day in the darkroom at school. Unfortunately, I shot a bunch of very dark photos.  It was disappointing for me to not have any good photos to send to Dennis. It’s amazing to me to now have digital cameras that shoot in near darkness and display the image that was captured instantly.  I can now attend a concert and take photos, even with a point and shoot camera, and know instantly if I captured a decent shot.

Kiss Alive 35 - Gene Simmons Yes Tour Van Halen

In September, 2015, I stumbled upon a website called Tookapic, a site encouraging and enabling 365 day photo projects, and integrated it into a photography class that I’m teaching my daughter.  I also began uploading photos every day to the site.  It’s a very fun community of photographers who are polite and encouraging.

Posted in photography | Leave a comment

Raspberry PiFace

I have been using a Raspberry Pi for various things since it was invented. It is a great little low cost computer. We recently celebrated Pi Day (3/14/15) here in the USA. Our local Science Center hosted a Pi Day programming workshop using Raspberry Pi, and my teenage daughter attended with her cousin and a friend. The following day, Anna showed me on her Ubuntu laptop how to use Scratch to perform some programming, and also showed me the Squirrel Eat Squirrel game in Python that she modified.

At the BACnet Summer 2014 meeting, I was given a Raspberry Pi and a PiFace card when I was presented the BACnet Swan Award.  During that meeting, I decided it would be fun to play with the Raspberry Pi and the PiFace card.  I first made a Raspian SD card, connected an Ethernet cable from my laptop, connected to the Raspberry Pi via SSH, downloaded the PiFace interface code, installed the build tools (apt-get build-essentials) and BACnet Protocol Stack, and wrote a quick BACnet example application that modeled the inputs as Binary Inputs and relays as Binary Outputs using the open source BACnet Protocol Stack library hosted on Sourceforge.net.  I posted the project in the demo/ folder of the project during the meeting.  My friend David Fisher, who originated the BACnet Swan Award in memory of our friend Bill Swan, kindly tested the BACnet interface to verify interoperability (and make some relays click!) over the WiFi LAN we configured for the meeting.

 

Posted in BACnet, Linux | Leave a comment

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 | 2 Comments

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 | 2 Comments

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