¿ªÔÆÌåÓý

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

Re: Crestron & Wiegand keypads


 

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

Join [email protected] to automatically receive all group messages.