¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

Crestron & Wiegand keypads


 

Anyone know of a good Wiegand interface that can sit between a Wiegand keypad and the crestron so codes can be changed on a touch panel instead?


 

Yes an Arduino can do this¡­ the Wiegand signal is pretty simple and matches the 5 volts of the basic Arduinos that are most suited for this.? What do you want to receive in Crestron, RS232 or network packets or something else? Mike


On Sat, Feb 22, 2025 at 15:00 MrDigitronic via <service=[email protected]> wrote:
Anyone know of a good Wiegand interface that can sit between a Wiegand keypad and the crestron so codes can be changed on a touch panel instead?


 

Some of the Wiegand keypads I have used in the past support other protocols as well. One of them being rs232


 

Fly by the seat of your pants for a moment with me and ride with me on this.

Go on Amazon and purchase a "UNO Screw Terminal Block Breakout Module with Aluminum Enclosure, for UNO R3" ($38).? Also buy the Arduino R3 ($27).? And grab a 12 volt barrel-connect power supply (if your Wiegand keypad wants 12 volts as power, which is typical).

Grab one of this guy for $12: "RS232 to TTL Converter Module COM Serial Port,2-in-1 rs232 to rs485/TTL Converter Adapter,RS232 to RS485 Converter,RS232 to TTL 3.3V/5V Serial Adapter with DB9 Feamle Connector to 5-pin Terminal block"

Assemble the Arduino into the enclosure.

Hook your Wiegand card reader up to the screw terminals.? The VIN screw is going to give you the same DC voltage as your 12 (or whatever) volt power supply...that's typically the red wire on your Wiegand.? Black is going to be ground, hook that up to any GND screw terminal.? Wiegand data 0 (green) and data 1 (white), hook them to screws #2 and #3 on the Arduino (not screws zero and one).? Note that screw terminals 2 and 3 are blessed with the best features for picking up the Wiegand signal, I selected these on purpose.

Screws zero and one on the Arduino are the best for serial communication.? Zero is RX and one is TX.? Use a 3-conductor wire to hook them to that $12 serial adapter...Gnd, RX, and TX.? (nothing needs to be connected to A and B, those are RS485-only).??

Finally, go on ChatGPT and type the following: "I have an Arduino Uno R3 and I connected it to a Wiegand keypad.? The keypad sends 4 wiegand bits with each keypress.? The ten numeric keys send the bits you would expect (think binary coded decimal), and then the other combinations of bits might stand for the other keys (star, enter, etc.)... please just give me the hexadecimal letters A thru F for the other six possibilities since I'm not sure which corresponds to which key, I will figure it out later.? As for wiring, Wiegand data 0 is connected to Arduino pin 2.? Wiegand data 1 is connected to Arduino pin 3.? I have a TTL-to-RS232 serial adapter connected to pins 0 and 1.? Write me an Arduino sketch that, every time a Wiegand keypress occurs, a character is sent over the serial pins at 9600 baud that I can capture with other equipment.? Please ensure that all 4 bits arrive within 100 milliseconds so that I don't translate spurious line noise into characters."

With 95%+ probability, the latest ChatGPT will provide a sample of working code that you can flash to the Arduino and will perform exactly the function we asked for.? Use the free Arduino IDE available from arduino.cc to compile and flash it over USB.

The USB flashing feature uses the same serial port internally as screw terminals 0 and 1 and they could conflict.? If flashing fails, temporarily disconnect the TTL RS232 adapter from screws 0 and 1 to allow the USB flash do its thing, and then reconnect.? Only needs to be done once, the flashing is permanent until overwritten with another flash.? Arduinos boot instantly (less than 100 milliseconds) so in all likelihood, the device will just permanently work and never skip a beat.

Enjoy the ride!!!!

Mike















On Wed, Feb 26, 2025 at 6:31?PM Eric Luckart via <eluckart=[email protected]> wrote:
Some of the Wiegand keypads I have used in the past support other protocols as well. One of them being rs232






 

And to save any brave souls the step of bothering ChatGPT for the code, I did this step myself, and I tested that this will compile and flash, but don't have a Wiegand keypad handy to immediately test it.? Any issues let me know, but at a glance (and I've done lots of Wiegand Arduino integrations in the past) this looks like it's going to work.


On Wed, Feb 26, 2025 at 8:23?PM Michael Caldwell-Waller via <bowser77=[email protected]> wrote:

Fly by the seat of your pants for a moment with me and ride with me on this.

Go on Amazon and purchase a "UNO Screw Terminal Block Breakout Module with Aluminum Enclosure, for UNO R3" ($38).? Also buy the Arduino R3 ($27).? And grab a 12 volt barrel-connect power supply (if your Wiegand keypad wants 12 volts as power, which is typical).

Grab one of this guy for $12: "RS232 to TTL Converter Module COM Serial Port,2-in-1 rs232 to rs485/TTL Converter Adapter,RS232 to RS485 Converter,RS232 to TTL 3.3V/5V Serial Adapter with DB9 Feamle Connector to 5-pin Terminal block"

Assemble the Arduino into the enclosure.

Hook your Wiegand card reader up to the screw terminals.? The VIN screw is going to give you the same DC voltage as your 12 (or whatever) volt power supply...that's typically the red wire on your Wiegand.? Black is going to be ground, hook that up to any GND screw terminal.? Wiegand data 0 (green) and data 1 (white), hook them to screws #2 and #3 on the Arduino (not screws zero and one).? Note that screw terminals 2 and 3 are blessed with the best features for picking up the Wiegand signal, I selected these on purpose.

Screws zero and one on the Arduino are the best for serial communication.? Zero is RX and one is TX.? Use a 3-conductor wire to hook them to that $12 serial adapter...Gnd, RX, and TX.? (nothing needs to be connected to A and B, those are RS485-only).??

Finally, go on ChatGPT and type the following: "I have an Arduino Uno R3 and I connected it to a Wiegand keypad.? The keypad sends 4 wiegand bits with each keypress.? The ten numeric keys send the bits you would expect (think binary coded decimal), and then the other combinations of bits might stand for the other keys (star, enter, etc.)... please just give me the hexadecimal letters A thru F for the other six possibilities since I'm not sure which corresponds to which key, I will figure it out later.? As for wiring, Wiegand data 0 is connected to Arduino pin 2.? Wiegand data 1 is connected to Arduino pin 3.? I have a TTL-to-RS232 serial adapter connected to pins 0 and 1.? Write me an Arduino sketch that, every time a Wiegand keypress occurs, a character is sent over the serial pins at 9600 baud that I can capture with other equipment.? Please ensure that all 4 bits arrive within 100 milliseconds so that I don't translate spurious line noise into characters."

With 95%+ probability, the latest ChatGPT will provide a sample of working code that you can flash to the Arduino and will perform exactly the function we asked for.? Use the free Arduino IDE available from arduino.cc to compile and flash it over USB.

The USB flashing feature uses the same serial port internally as screw terminals 0 and 1 and they could conflict.? If flashing fails, temporarily disconnect the TTL RS232 adapter from screws 0 and 1 to allow the USB flash do its thing, and then reconnect.? Only needs to be done once, the flashing is permanent until overwritten with another flash.? Arduinos boot instantly (less than 100 milliseconds) so in all likelihood, the device will just permanently work and never skip a beat.

Enjoy the ride!!!!

Mike















On Wed, Feb 26, 2025 at 6:31?PM Eric Luckart via <eluckart=[email protected]> wrote:
Some of the Wiegand keypads I have used in the past support other protocols as well. One of them being rs232






 

Apologies for taking this off-topic, but this is an example of why it troubles me in the way that ChatGPT (and the like) may be used in a professional context - and (from our perspective) Crestron development/installation is explicitly not a consumer/DIY product.? While I'm sure this code "works", if people were to take the generated code and blindly run with it, it glosses over any sort of error checking and could be quite fragile.
?
As a trivial example - what happens to the wiegandData already captured in the 100ms timeout case?
Nothing - the next nibble that comes in will have the 4 new bits shifted on with the _existing data_ shifted up.? The result will almost certainly be > 9 and then you add the ASCII 'A' offset - so you'll get some weird data there - not even ASCII Hex.? The Wiegand protocol has a 50ms timeout (not 100ms) and packets are variable bit length - not always neat 4-bit boundaries - so there is room for trouble here.
?
It's also poor (IMO) code.? A "human" programmer would be more likely to use a built in function such as Serial.print(wiegandData & 0x7, HEX); instead of manually converting to ASCII.? Cleaner code, more readable, easier to understand and maintain (possibly by someone else!)
?
I'm not advocating against using AI in programming - we use it a lot (you can hardly move without bumping into Copilot anyway these days) - but I do think we should be VERY careful about swallowing what it generates.? LLMs might get things moving in the right direction, but if you don't understand what you're being fed, it could well blow up in your face.? Too many mixed metaphors there, sorry.
?
Michael - I'm not bashing your solution here - if it works in the context (and if there's a paying customer involved, they understand they're getting something bespoke, with the support challenges that brings with it) then all good.? My gripe is that people "believe" in ChatGPT far too much.
?
All the best,
Oliver


 

Hi Oliver!

I bet I'll meet you in the middle.? I actually did notice that we're not clearing wiegandBits in the timeout case after I posted, and had a small tweak in mind (just set it to zero in the timeout case).? That said, everyone in this forum has another willing resource -- a human being, namely myself (and others with your expertise as well), willing to review the code and perfect it -- assuming that was even necessary.? In this case, both things you mentioned would not have detracted from the device's ability to correctly translate a Wiegand keypress over 99.99% of the time,?with these edge cases resulting in garbage data in the event of actual on-Wiegand-wire line noise... something we would already get on the on-serial-wire line noise and can't do anything about (a shortcoming of serial comms)... and something a SIMPL serial in block would completely ignore.

So yes, if anyone uses this, it'll probably be on me to make sure this works correctly -- but otherwise, the brave soul will be out the <$100 they invested in my suggested experiment and it didn't rise to meeting their needs.

In my experience, the vast majority of these Wiegand keypads all pump out 4 bits per keypress, or can be configured to.? Both the Amazon ones and the professional security ones.

I think the point I'm trying to make is that ChatGPT enables us to punch well above our weight and parlay our existing programming experience into new worlds we never thought possible.? When you're an A/V installer who has a client asking about "can you integrate this keypad with Crestron" and the answer goes from "maybe" to "yes" to "definitely" (when people with actual experience weigh in with the solution), you've professionally solved a problem you weren't expecting from the client to ask you to fix.

I'll be as bold to say that WHEN someone gets this solution working, and reports that it is robust (you can ignore me for now -- I've got Arduino Wiegand keypad solutions working with over 99.999% uptime and reliability, but take it from the first guy who tries this idea I posted), you'll all have discovered that you can buy these Wiegand keypads on Amazon for $25... and they are outdoor rated and rain tolerant... and you can integrate them with Crestron to solve dozens of use cases needing a wall-mount numeric keypad... we are all better off!? And for those not wanting the sight of a $25 Wiegand keypad on their job, you can buy a $400 one from HID that's the exact same part used at your local airport and other highrise buildings instead of imported stuff for high security installs, and it will work with this Arduino exactly the same.? Wire it the same.

I silently cringe when we discuss the recent issues with CP4's failing, or database updates that magically break the basic functionality of the D3 scheduler for months, and then just tolerate this like it's so unfortunate there's no way around it, but then worry about how unprofessional Arduinos are.? In context, I'm just saying if you've got a solution that meets the client's needs, and it does so reliably, at a decent cost using materials with a strong supply chain, and boots 1000 times as fast and never needs software updates, what exactly are the criteria for the solution being "professional" again???


Mike














On Thu, Feb 27, 2025 at 2:58?AM Oliver Hall via <oliver.hall=[email protected]> wrote:
Apologies for taking this off-topic, but this is an example of why it troubles me in the way that ChatGPT (and the like) may be used in a professional context - and (from our perspective) Crestron development/installation is explicitly not a consumer/DIY product.? While I'm sure this code "works", if people were to take the generated code and blindly run with it, it glosses over any sort of error checking and could be quite fragile.
?
As a trivial example - what happens to the wiegandData already captured in the 100ms timeout case?
Nothing - the next nibble that comes in will have the 4 new bits shifted on with the _existing data_ shifted up.? The result will almost certainly be > 9 and then you add the ASCII 'A' offset - so you'll get some weird data there - not even ASCII Hex.? The Wiegand protocol has a 50ms timeout (not 100ms) and packets are variable bit length - not always neat 4-bit boundaries - so there is room for trouble here.
?
It's also poor (IMO) code.? A "human" programmer would be more likely to use a built in function such as Serial.print(wiegandData & 0x7, HEX); instead of manually converting to ASCII.? Cleaner code, more readable, easier to understand and maintain (possibly by someone else!)
?
I'm not advocating against using AI in programming - we use it a lot (you can hardly move without bumping into Copilot anyway these days) - but I do think we should be VERY careful about swallowing what it generates.? LLMs might get things moving in the right direction, but if you don't understand what you're being fed, it could well blow up in your face.? Too many mixed metaphors there, sorry.
?
Michael - I'm not bashing your solution here - if it works in the context (and if there's a paying customer involved, they understand they're getting something bespoke, with the support challenges that brings with it) then all good.? My gripe is that people "believe" in ChatGPT far too much.
?
All the best,
Oliver


 

And then --

Here is a minor revision that eliminates the potential issue Oliver pointed out? and adds another small tweak to forcefully ignore RFID card read messages but perhaps more importantly, is one I actually flashed onto an Arduino Uno this morning, tested with a $400 commercial grade HID MultiClass SE keypad (HID model RPK40), and confirmed actually works as I expect.? Observation for this reader, the?star key gives you 'A' as output, and the pound key gives you 'B'.

And here is a link to a pro-grade third-party Arduino Uno R3 substitute with robust levels of tolerance for transient currents, ESD, overvoltages (each pin has extra components to sink these).? I keep a few of them and use these for outdoor keypad and RFID applications, they're not much more in cost and worth the extra money in my opinion.?

Mike


On Thu, Feb 27, 2025 at 7:05?AM Michael Caldwell-Waller via <bowser77=[email protected]> wrote:

Hi Oliver!

I bet I'll meet you in the middle.? I actually did notice that we're not clearing wiegandBits in the timeout case after I posted, and had a small tweak in mind (just set it to zero in the timeout case).? That said, everyone in this forum has another willing resource -- a human being, namely myself (and others with your expertise as well), willing to review the code and perfect it -- assuming that was even necessary.? In this case, both things you mentioned would not have detracted from the device's ability to correctly translate a Wiegand keypress over 99.99% of the time,?with these edge cases resulting in garbage data in the event of actual on-Wiegand-wire line noise... something we would already get on the on-serial-wire line noise and can't do anything about (a shortcoming of serial comms)... and something a SIMPL serial in block would completely ignore.

So yes, if anyone uses this, it'll probably be on me to make sure this works correctly -- but otherwise, the brave soul will be out the <$100 they invested in my suggested experiment and it didn't rise to meeting their needs.

In my experience, the vast majority of these Wiegand keypads all pump out 4 bits per keypress, or can be configured to.? Both the Amazon ones and the professional security ones.

I think the point I'm trying to make is that ChatGPT enables us to punch well above our weight and parlay our existing programming experience into new worlds we never thought possible.? When you're an A/V installer who has a client asking about "can you integrate this keypad with Crestron" and the answer goes from "maybe" to "yes" to "definitely" (when people with actual experience weigh in with the solution), you've professionally solved a problem you weren't expecting from the client to ask you to fix.

I'll be as bold to say that WHEN someone gets this solution working, and reports that it is robust (you can ignore me for now -- I've got Arduino Wiegand keypad solutions working with over 99.999% uptime and reliability, but take it from the first guy who tries this idea I posted), you'll all have discovered that you can buy these Wiegand keypads on Amazon for $25... and they are outdoor rated and rain tolerant... and you can integrate them with Crestron to solve dozens of use cases needing a wall-mount numeric keypad... we are all better off!? And for those not wanting the sight of a $25 Wiegand keypad on their job, you can buy a $400 one from HID that's the exact same part used at your local airport and other highrise buildings instead of imported stuff for high security installs, and it will work with this Arduino exactly the same.? Wire it the same.

I silently cringe when we discuss the recent issues with CP4's failing, or database updates that magically break the basic functionality of the D3 scheduler for months, and then just tolerate this like it's so unfortunate there's no way around it, but then worry about how unprofessional Arduinos are.? In context, I'm just saying if you've got a solution that meets the client's needs, and it does so reliably, at a decent cost using materials with a strong supply chain, and boots 1000 times as fast and never needs software updates, what exactly are the criteria for the solution being "professional" again???


Mike














On Thu, Feb 27, 2025 at 2:58?AM Oliver Hall via <oliver.hall=[email protected]> wrote:
Apologies for taking this off-topic, but this is an example of why it troubles me in the way that ChatGPT (and the like) may be used in a professional context - and (from our perspective) Crestron development/installation is explicitly not a consumer/DIY product.? While I'm sure this code "works", if people were to take the generated code and blindly run with it, it glosses over any sort of error checking and could be quite fragile.
?
As a trivial example - what happens to the wiegandData already captured in the 100ms timeout case?
Nothing - the next nibble that comes in will have the 4 new bits shifted on with the _existing data_ shifted up.? The result will almost certainly be > 9 and then you add the ASCII 'A' offset - so you'll get some weird data there - not even ASCII Hex.? The Wiegand protocol has a 50ms timeout (not 100ms) and packets are variable bit length - not always neat 4-bit boundaries - so there is room for trouble here.
?
It's also poor (IMO) code.? A "human" programmer would be more likely to use a built in function such as Serial.print(wiegandData & 0x7, HEX); instead of manually converting to ASCII.? Cleaner code, more readable, easier to understand and maintain (possibly by someone else!)
?
I'm not advocating against using AI in programming - we use it a lot (you can hardly move without bumping into Copilot anyway these days) - but I do think we should be VERY careful about swallowing what it generates.? LLMs might get things moving in the right direction, but if you don't understand what you're being fed, it could well blow up in your face.? Too many mixed metaphors there, sorry.
?
Michael - I'm not bashing your solution here - if it works in the context (and if there's a paying customer involved, they understand they're getting something bespoke, with the support challenges that brings with it) then all good.? My gripe is that people "believe" in ChatGPT far too much.
?
All the best,
Oliver


 

What's professional? It's easy.
?
A project changes hands - either the client decides they want to work with a new integrator or the property is sold and the original integrator is a distant memory.
A new integrator comes onto the scene and, for argument's sake, the project is lacking in the documentation that we all take great pains to provide (maybe it /was/ provided, but it's been lost/thrown away).
There's an intermittent fault on the keypad - perhaps it's always been like that.? The integrator looks at an unbranded enclosure with an Arduino in it connected to the keypad, they check for basic wiring faults, and... now what?
If we take things to an extreme where ChatGPT generated code, it was pasted into the Arduino IDE and uploaded, tested on-site and it appeared?to work. (Yay!) Even the person that installed it may not understand how it worked.
?
My argument to that isn't about "can you do xyz" (that's often just a function of time/money).? It is about whether "you should do xyz" in a supportable, maintainable way. If the client understands that they're getting code that the person (being paid for their services) may not really understand; well fine - that's on the client (provided they WERE given full disclosure).? That's why customers pay a premium for products like Crestron - because there's a massive support infrastructure and integrator community behind it (admitting it's not perfect, and sometimes even dysfunctional).
?
As I said before, I'm not knocking the solution at all or suggesting it wouldn't work.? I'm not arguing about the quality of gear either - whether a keypad is $25 or $400 isn't the point.
?
Going back to my original point; which is about ChatGPT (and similar) giving a false sense of security to developers (in general - not exclusively automation integrators).? I feel (again, my personal opinion) that LLMs shouldn't be used as a substitute or crutch for actual understanding.
?
Sorry - I've gone *way* off topic.? I'll mute myself now :-)?


 

You¡¯ve got my full agreement on this one

The way I handle Arduino solutions in professional installs is to put the code and documentation in a Google drive folder and then print the link to the folder as a QR code sticker and place it next to the install.? This is necessary even for my own guys to know what it is, if unfamiliar.

I¡¯m just using the label printers with Bluetooth capability to get the QR codes onto a label. Copy and paste the link with iPhone.?

Mike





On Thu, Feb 27, 2025 at 07:57 Oliver Hall via <oliver.hall=[email protected]> wrote:
What's professional? It's easy.
?
A project changes hands - either the client decides they want to work with a new integrator or the property is sold and the original integrator is a distant memory.
A new integrator comes onto the scene and, for argument's sake, the project is lacking in the documentation that we all take great pains to provide (maybe it /was/ provided, but it's been lost/thrown away).
There's an intermittent fault on the keypad - perhaps it's always been like that.? The integrator looks at an unbranded enclosure with an Arduino in it connected to the keypad, they check for basic wiring faults, and... now what?
If we take things to an extreme where ChatGPT generated code, it was pasted into the Arduino IDE and uploaded, tested on-site and it appeared?to work. (Yay!) Even the person that installed it may not understand how it worked.
?
My argument to that isn't about "can you do xyz" (that's often just a function of time/money).? It is about whether "you should do xyz" in a supportable, maintainable way. If the client understands that they're getting code that the person (being paid for their services) may not really understand; well fine - that's on the client (provided they WERE given full disclosure).? That's why customers pay a premium for products like Crestron - because there's a massive support infrastructure and integrator community behind it (admitting it's not perfect, and sometimes even dysfunctional).
?
As I said before, I'm not knocking the solution at all or suggesting it wouldn't work.? I'm not arguing about the quality of gear either - whether a keypad is $25 or $400 isn't the point.
?
Going back to my original point; which is about ChatGPT (and similar) giving a false sense of security to developers (in general - not exclusively automation integrators).? I feel (again, my personal opinion) that LLMs shouldn't be used as a substitute or crutch for actual understanding.
?
Sorry - I've gone *way* off topic.? I'll mute myself now :-)?


 

¿ªÔÆÌåÓý

If I may suggest (just for the frequency of Google breaking things over the course of years) that some form of onsite media ¨C like a thumbdrive in the closeout documentation or labeled and attached to the rack ¨C may be a more robust long-term solution when Google links can change, permissions can be revoked etc., etc.

?

Though I have reservations about deploying Arduino in a general purpose system I will admit that for my own house I¡¯m using HID MultiClass SE readers (a mix of the RPK [keypad] and mullion-style RP [no keypad]), each with an ESP32 behind each reader doing both Weigand translation and LED/Beeper control connected to my WiFi which runs the access control for my house¡­ But I know the quality of my Arduino code and the edge-case handling well enough to know I¡¯d never put it in a client¡¯s project as-is.

?

The real answer is to move everything over to OSDP over RS485 since Wiegand is ancient but I only have a couple OSDP-capable MultiClass readers currently and OSDP has some of its own quirks/timing requirements which means I think I¡¯d still need to run the interface on a dedicated microcontroller to keep everything happy¡­and who has time for that when paying clients are waiting ?

?

If you find me at Masters this year ask me about the pitfalls of setting credential expiration on a girlfriend¡¯s (now wife¡¯s) access token and then forgetting about that¡­

?

--

Lincoln King-Cliby

Commercial Market Director
Sr. Systems Architect | Crestron Certified Master Programmer (Diamond)
ControlWorks Consulting, LLC

Direct: (+1)440.771.4807 | Cleveland: (+1)440.449.1100? | Boston: (+1)508.695.0188 | DC: (+1)202.381.9070? | London: (+44) (0)20 4520 4600
Crestron Services Provider | Biamp Authorized Independent Programmers | Extron Qualified Independent Programmer

?

From: [email protected] <[email protected]> On Behalf Of Michael Caldwell-Waller via groups.io
Sent: Thursday, February 27, 2025 10:12 AM
To: [email protected]
Subject: Re: [crestron] Crestron & Wiegand keypads

?

You¡¯ve got my full agreement on this one

?

The way I handle Arduino solutions in professional installs is to put the code and documentation in a Google drive folder and then print the link to the folder as a QR code sticker and place it next to the install.? This is necessary even for my own guys to know what it is, if unfamiliar.

?

I¡¯m just using the label printers with Bluetooth capability to get the QR codes onto a label. Copy and paste the link with iPhone.?

?

Mike

?

?

?

?

?

On Thu, Feb 27, 2025 at 07:57 Oliver Hall via <oliver.hall=[email protected]> wrote:

What's professional? It's easy.

?

A project changes hands - either the client decides they want to work with a new integrator or the property is sold and the original integrator is a distant memory.

A new integrator comes onto the scene and, for argument's sake, the project is lacking in the documentation that we all take great pains to provide (maybe it /was/ provided, but it's been lost/thrown away).

There's an intermittent fault on the keypad - perhaps it's always been like that.? The integrator looks at an unbranded enclosure with an Arduino in it connected to the keypad, they check for basic wiring faults, and... now what?

If we take things to an extreme where ChatGPT generated code, it was pasted into the Arduino IDE and uploaded, tested on-site and it appeared?to work. (Yay!) Even the person that installed it may not understand how it worked.

?

My argument to that isn't about "can you do xyz" (that's often just a function of time/money).? It is about whether "you should do xyz" in a supportable, maintainable way. If the client understands that they're getting code that the person (being paid for their services) may not really understand; well fine - that's on the client (provided they WERE given full disclosure).? That's why customers pay a premium for products like Crestron - because there's a massive support infrastructure and integrator community behind it (admitting it's not perfect, and sometimes even dysfunctional).

?

As I said before, I'm not knocking the solution at all or suggesting it wouldn't work.? I'm not arguing about the quality of gear either - whether a keypad is $25 or $400 isn't the point.

?

Going back to my original point; which is about ChatGPT (and similar) giving a false sense of security to developers (in general - not exclusively automation integrators).? I feel (again, my personal opinion) that LLMs shouldn't be used as a substitute or crutch for actual understanding.

?

Sorry - I've gone *way* off topic.? I'll mute myself now :-)?


 

I have put the time into a template code base getting ESP32¡¯s to be at least as reliable as Crestron gear. In other words I manually reboot my DM matrix at home more than I manually reboot ESP32s.

Some of the tools I use to get there include the hardware watchdog timer built into all these microcontrollers.? If my applications are not explicitly detecting round trip success (the definition of which is all role dependent), it¡¯s an automatic hard reset, which is no skin off ESP32¡¯s back.? That¡¯s another reason I like milliseconds boot time.? Hard resets, no big deal, and then my applications are designed around the expectation of regular hard resets for any suspected issue.? So for example, if the WiFi AP decides to change channel at 3am based on a nightly periodic local channel survey, there¡¯s a decent chance that my WiFi ESP32 devices will enjoy a hard reset within the same minute before arriving at the new channel, and nothing skips a beat.?

Also ESP32 has really undergone recent improvements at how well they can natively use Ethernet instead of WiFi.? ESP32 talking to Crestron over Ethernet is a really strong solution I wouldn¡¯t hesitate to use professionally.? I¡¯m using ESP32 specifically for sensors (temp/humidity/door position/etc.) and to drive LED signage with status messages received.? I have a PoE-powered ESP32 that reports to Crestron whether a fireplace is lit by looking at it across the room through a small thermal camera.? I have a WiFi ESP32 that looks at my driveway gate motor (via its relay outputs) and populates my Crestron touchscreens with a string reason of why/how the gate got opened last (e.g. via underground sensor, or touchscreen, or Amazon Key, or remote opener etc..).? ESP32s can do some amazing things as eyes and ears for a Crestron home.? They¡¯ve been an enjoyable rabbit hole to go down and get to know.?

Mike




On Fri, Feb 28, 2025 at 10:50 Lincoln King-Cliby via <lincoln=[email protected]> wrote:

If I may suggest (just for the frequency of Google breaking things over the course of years) that some form of onsite media ¨C like a thumbdrive in the closeout documentation or labeled and attached to the rack ¨C may be a more robust long-term solution when Google links can change, permissions can be revoked etc., etc.

?

Though I have reservations about deploying Arduino in a general purpose system I will admit that for my own house I¡¯m using HID MultiClass SE readers (a mix of the RPK [keypad] and mullion-style RP [no keypad]), each with an ESP32 behind each reader doing both Weigand translation and LED/Beeper control connected to my WiFi which runs the access control for my house¡­ But I know the quality of my Arduino code and the edge-case handling well enough to know I¡¯d never put it in a client¡¯s project as-is.

?

The real answer is to move everything over to OSDP over RS485 since Wiegand is ancient but I only have a couple OSDP-capable MultiClass readers currently and OSDP has some of its own quirks/timing requirements which means I think I¡¯d still need to run the interface on a dedicated microcontroller to keep everything happy¡­and who has time for that when paying clients are waiting ?

?

If you find me at Masters this year ask me about the pitfalls of setting credential expiration on a girlfriend¡¯s (now wife¡¯s) access token and then forgetting about that¡­

?

--

Lincoln King-Cliby

Commercial Market Director
Sr. Systems Architect | Crestron Certified Master Programmer (Diamond)
ControlWorks Consulting, LLC

Direct: (+1)440.771.4807 | Cleveland: (+1)440.449.1100? | Boston: (+1)508.695.0188 | DC: (+1)202.381.9070? | London: (+44) (0)20 4520 4600
Crestron Services Provider | Biamp Authorized Independent Programmers | Extron Qualified Independent Programmer

?

From: [email protected] <[email protected]> On Behalf Of Michael Caldwell-Waller via
Sent: Thursday, February 27, 2025 10:12 AM
To: [email protected]
Subject: Re: [crestron] Crestron & Wiegand keypads

?

You¡¯ve got my full agreement on this one

?

The way I handle Arduino solutions in professional installs is to put the code and documentation in a Google drive folder and then print the link to the folder as a QR code sticker and place it next to the install.? This is necessary even for my own guys to know what it is, if unfamiliar.

?

I¡¯m just using the label printers with Bluetooth capability to get the QR codes onto a label. Copy and paste the link with iPhone.?

?

Mike

?

?

?

?

?

On Thu, Feb 27, 2025 at 07:57 Oliver Hall via <oliver.hall=[email protected]> wrote:

What's professional? It's easy.

?

A project changes hands - either the client decides they want to work with a new integrator or the property is sold and the original integrator is a distant memory.

A new integrator comes onto the scene and, for argument's sake, the project is lacking in the documentation that we all take great pains to provide (maybe it /was/ provided, but it's been lost/thrown away).

There's an intermittent fault on the keypad - perhaps it's always been like that.? The integrator looks at an unbranded enclosure with an Arduino in it connected to the keypad, they check for basic wiring faults, and... now what?

If we take things to an extreme where ChatGPT generated code, it was pasted into the Arduino IDE and uploaded, tested on-site and it appeared?to work. (Yay!) Even the person that installed it may not understand how it worked.

?

My argument to that isn't about "can you do xyz" (that's often just a function of time/money).? It is about whether "you should do xyz" in a supportable, maintainable way. If the client understands that they're getting code that the person (being paid for their services) may not really understand; well fine - that's on the client (provided they WERE given full disclosure).? That's why customers pay a premium for products like Crestron - because there's a massive support infrastructure and integrator community behind it (admitting it's not perfect, and sometimes even dysfunctional).

?

As I said before, I'm not knocking the solution at all or suggesting it wouldn't work.? I'm not arguing about the quality of gear either - whether a keypad is $25 or $400 isn't the point.

?

Going back to my original point; which is about ChatGPT (and similar) giving a false sense of security to developers (in general - not exclusively automation integrators).? I feel (again, my personal opinion) that LLMs shouldn't be used as a substitute or crutch for actual understanding.

?

Sorry - I've gone *way* off topic.? I'll mute myself now :-)?


 

Yes! Heard that story in person in New Zealand, not good, but time has been a great healer for Lincoln + 1, but she'll never forget, it's too good a story not to bring it up from time to time. Sadly I won't be able to make it to Masters.
?
Lindsay


 

@Michael Caldwell-Waller I¡¯m interested in learning more about your enhanced template code for ESP32 devices. ?I also use ESP32 devices in my home and overall, they are reliable but would like to know how you have improved their reliability.

I have not used groups.io in years but just discovered that it has an iOS and ipadOS app. ?I have been trying to figure out how to tag specific people in a message. ?Read through help and could not find a way to do this. ?Any tips would be appreciated.


 

Hi Dean,

I threw the code on Github at? this morning.

The code comes as "Examples" you can compile with Arduino IDE and flash to ESP32 devices.? Edit the examples to add your WiFi credentials before flashing.

The Examples do nothing more than make a secure?connection to a free public MQTT server (HiveMQ), and report "Hello World" with the device MAC address and a counting number that increments every few seconds.? Upon success, you get serial messages, and a green light or message (assuming an LED or LCD to display it).? Upon failure, the hardware watchdog timer will force a hard reboot of the device.? You simply provide a WiFi SSID/password or an Ethernet connection to your flashed ESP32 device.

The goal is that you'll edit it to make a secure?connection to your own TCP / UDP / MQTT port, and edit it to report your?data to your?infrastructure.

I've already worked out WiFi, Ethernet, the secure connection over TLS (at least for MQTT), and everything.? The reason I'm highlighting secure is that I've already done the work to make sure that security works... you can disable it if you like... but out of the gate, we're using a good working certificate-based solution you can replace the certificate with your own, and don't have to "add security" as an afterthought.

My examples are centered around using M5Stack-branded ESP32 devices.? But you can use any, it's not hard tied to M5Stack... I just like their offering because (not only the low cost) but they're pre-populated into an enclosure and easy to slap into a rack or onto a DIN rail and then I don't waste too much time tinkering with hardware or looking at naked circuit boards.

Unfortunately you probably won't get a secure connection directly to a Crestron processor without some extra work.? For me I just use physical security.? I get the secure connection to Crestron by having one more device in the middle (the private MQTT server on an industrial Raspberry Pi) that's physically located in the same rack as the Crestron processor.? Everything from the ESP32's to the MQTT server is all secured with certificates.? Some middleware I published elsewhere makes the direct TCP connection into Crestron and provides direct access to SIMPL symbols through a custom S+ module I wrote.? This is one of many possible ways to do it.? One day I may take on the project of writing a S# MQTT client for the processor.

A cheap non-secure shortcut that works well in many instances, and requires no MQTT, is to just allow the ESP32 devices to send UDP packets straight to a UDP SIMPL?block.? No security, no guaranteed reliability, but in practice, will work very well as a "proof of concept" with quality on par with pointing an IR remote at a TV to change a volume.

Although I've been using this code for quite a while and?am happy with?how it performs, I literally packaged it into a library and threw it on to GitHub this morning.? Thanks for your patience in advance if I need to make a couple tweaks resulting from the way I published it.

Mike




On Sat, Mar 1, 2025 at 9:57?AM Dean Detton via <dean=[email protected]> wrote:
@Michael Caldwell-Waller I¡¯m interested in learning more about your enhanced template code for ESP32 devices.? I also use ESP32 devices in my home and overall, they are reliable but would like to know how you have improved their reliability.

I have not used in years but just discovered that it has an iOS and ipadOS app.? I have been trying to figure out how to tag specific people in a message.? Read through help and could not find a way to do this.? Any tips would be appreciated.


 

Separately you'd asked how I "improve their reliability".? I will speak to this primarily in principles and not in terms of any specific brand of device, and will make reference to the "Watchdog".

The way I look at reliability of electronics is like this:? Every computing device can malfunction and will do so at least some minimum frequency.? Every computing device is vulnerable to power supply voltage fluctuations, getting hit by cosmic radiation, and classes upon classes of software bugs in all of the "stacks" installed on them, that have cumulative effects the longer a device is powered up.

I believe all mission-critical electronic devices we depend on, should enjoy regular resetting wherever possible, at the hardware level (every piece of silicon with a "reset" input should have that signal asserted regularly).? It should be a normal function of the way it operates.? There should be "built-in testing" that continuously monitors whether the device is achieving its purpose, and resetting it if that's in doubt.

Sometimes this is at odds with the way we install AV gear... we spec out and use these wonderful high-end UPS's that ensure that devices can go for months and years without a reboot.? I say, wait, what?

We also have gear that takes one, two, three minutes to reboot.? Most of this gear?also has filesystems that will get corrupted if you suddenly reset them in the middle of writes.? It's not practical to hard reset a Crestron processor just because.? When it comes to equipment like this, I prefer to use this equipment for whatever its strengths are,?and nothing more.? And I do not like loading them with a "kitchen sink" worth of modules or applications on them.

But microcontrollers are a different animal.? Microcontrollers like ESP32 are so cheap that it is practical to dedicate them to a single purpose (like, "get this data and send it there").? Get this keypad input and send it via serial over there.? Listen on the network for a message, and display it on LCD / LED / wherever.? The purpose requires no real continuity for uptime and there's no writing or storage to corrupt.? When the thing can be reset in under 1 second, I DO IT!? haha.? I make sure to do it at times that will cause the application the least interruption,?or when an interruption is already suspected and resetting causes no additional harm.? That's what makes the end result so reliable.

This is what explains why I like to gravitate to microcontrollers (especially ones in industrial-strength enclosures) as "professional" solutions.? Just about every one of them has a "Hardware Watchdog Timer" feature right on the silicon itself, which will do a complete hard reset of the device if the dog isn't "fed" at some periodic interval.? It is the job of the application code, to constantly self-test and report "mission success" (i.e. feed the dog).? Even a completely hung processor will still reset because the dog is implemented on a dedicated part of the silicon, not in software.? The app design should include "watchdog resets will happen anytime" rather than "The UPS will keep this processor up for months at a time".

Mike








On Sat, Mar 1, 2025 at 9:57?AM Dean Detton via <dean=[email protected]> wrote:
@Michael Caldwell-Waller I¡¯m interested in learning more about your enhanced template code for ESP32 devices.? I also use ESP32 devices in my home and overall, they are reliable but would like to know how you have improved their reliability.

I have not used in years but just discovered that it has an iOS and ipadOS app.? I have been trying to figure out how to tag specific people in a message.? Read through help and could not find a way to do this.? Any tips would be appreciated.