展示HN:我用1600美元的ESP32替换了一个价值12万美元的保龄球中心系统

7作者: section331 天前原帖
我可能是地球上唯一一个拥有自己保龄球中心的 SRE(网站可靠性工程师)。这份工作比你想象的要复杂得多。 我和家人买下了一个位于美国中西部乡村的废弃 8 条道保龄球中心。在我们的小镇上,家庭娱乐的选择并不多。你听说过“食品沙漠”吗?这里是一个“休闲沙漠”。 这个保龄球中心被废弃是有充分理由的。屋顶漏水,电力系统时常出现浪涌,而我那台 70 年的保龄球设备(至今)仍然运转不太正常。让我特别感兴趣的是那个记录分数的系统。它是你在比赛中关注的东西,但除此之外,它又显得不那么重要。结果发现这些东西真的很酷,但价格却离谱。 我们的系统安装于 2008 年,花费了六位数。它能够计算球速和轨迹,基于摄像头的瓶子检测(在集成电路上进行物体检测和三角函数!),处理犯规、动画、瓶子设置机和球返回。对于它的年代来说,这些功能非常酷。 从商业角度来看,我的设施只花了我 10.5 万美元。更换分数记录系统的费用在 8 万到 12 万美元之间,具体取决于功能、供应商和设备的年龄。请注意,没有升级或服务合同,每个功能和定制都是新的费用项目。这是对 2008 年安装的系统进行 1:1 替换的费用。考虑到科技界的快速发展,这真是令人难以置信。 更换零件的费用令人震惊,每对道的费用高达 4000 美元。但等等,保龄球机本身已经 70 年了,那这个“先进”的系统到底在干什么呢?不过是激活一个继电器来触发那台老机器。其他一切都是纯机械的。与此同时,我手里拿着一张六位数的发票。我很不高兴。 考虑到开放硬件、计算机视觉、实时事件流和全球范围内运行的大规模开源产品的现状,我必须找到一种方法自己来做这件事。 到目前为止,我已经为每对道构建了一个等效的原型,成本大约为 200 美元,如果你想要更高档一点则是 400 美元。使用 ESP32 和 ESPNow,并配备 RS485 作为备用,报告给一个实际上只是 Redis 和一个与 ESP32 网关相连的状态机的树莓派道计算机。 由于一切都基于 ESP32,我抽屉里有一把备用控制器,已经预先刷好或等待刷写。所有都是常见的现成硬件:微控制器连接到继电器、光耦合器和红外断射传感器,每个都运行稍微不同的固件。编写固件和协议才是真正的难点。 这是一个 ESPNow 星型拓扑网络:每个节点从其传感器发出事件并接受控制命令,报告给通过 UART 连接到树莓派的网关节点。从那里开始就是事件流:接收的数据包被翻译并放入 Redis,命令根据需要传回网络。RS485 作为有线备用,适用于嘈杂的射频环境。 一旦数据进入 Redis,就变成了熟悉的中间件/React/websocket/pub-sub 相关内容。任何 React 开发者都可以构建自己的用户界面和保龄球动画。由于一切都运行在普通硬件上,作为业主的我可以随心所欲,并且我拥有所有数据。维修只需五分钟;我可以在 10 分钟内更换一对道的设备。我敢打赌,像我这样的保龄球中心可以在一两个小时内从零启动并运行。 我们称之为 OpenLaneLink,我计划在准备好后开源硬件、固件和软件栈。保龄球很有趣,我希望帮助保持像我这样的保龄球馆的可负担性。 我讨厌供应商锁定。我不喜欢封闭系统,每次出现问题都要打电话支持,或者为“白标”自己的设备而付费。想要晚上变成 Tron 主题?祝你好运,找到一个在世纪之交购买的东西的霓虹灯新拟态主题。 这一切都让我感到烦恼。诚然,保龄球设备是小众的,但开放硬件和软件的前景非常令人惊叹。 感谢你的阅读!如果有人对更多关于这项保龄球项目的帖子感兴趣,请告诉我。
查看原文
I might be the only SRE on Earth with his own bowling center. It&#x27;s a more in-depth gig than you&#x27;d think.<p>My family and I bought an abandoned 8-lane bowling center in the rural mid-west. In our small town there weren&#x27;t many recreation options for families. You&#x27;ve heard of a food desert? This is an R&amp;R desert.<p>It had been abandoned for a good reason. The roof leaks, the electrical system was constantly surging, and my 70-year-old bowling equipment (still) doesn&#x27;t work perfectly. The system that keeps your score is particularly interesting to me. It&#x27;s the thing you watch during your game, but it fades into the background beyond that. Turns out these things are really cool, but absurdly expensive.<p>Ours was installed in 2008 and cost six figures. It&#x27;s calculating ball speed and trajectory, camera-based pin detection (object detection and trig, on ICs!), runs the fouling, the animations, the pinsetting machine and ball return. Very cool stuff for its age.<p>From the business perspective, my facility only cost me $105k. To forklift-replace the score keeping system runs anywhere between $80-$120k, depending on features, vendor, and unit age. No upgrades or service contracts, mind you, and every feature and customization is a new line item. That&#x27;s for a 1:1 replacement on a system installed in 2008. Incredible, given how fast the tech world moves.<p>Replacement parts cost a shocking $4000 per pair of lanes. But wait, the bowling machines themselves are 70 years old, so what&#x27;s this &quot;advanced&quot; system actually doing back there? Actuating a single relay to trigger that big old machine. Everything else is strictly mechanical. Meanwhile I&#x27;ve got a six-figure invoice in my hand. I&#x27;m upset.<p>Given the state of open hardware, computer vision, real-time event streaming, and open source running megascale products worldwide, there had to be a way to do this myself.<p>So far I&#x27;ve built an equivalent prototype for about $200 per lane-pair, $400 if you&#x27;re fancy. ESP32 and ESPNow with an RS485 fallback, reporting to a raspberry pi lane computer that&#x27;s really just redis and a state machine bolted to an ESP32 gateway for the mesh.<p>Since it&#x27;s all ESP32, I&#x27;ve got a fistful of spare controllers in a drawer, pre-flashed or waiting to be. All common off-the-shelf hardware: microcontrollers wired to relays, optocouplers, and IR-break-beam sensors, each running slightly different firmware. Writing the firmware and protocol is the actual hard part.<p>It&#x27;s an ESPNow star-topology mesh: each node emits events from its sensors and accepts commands for its controls, reporting to a gateway node connected to the raspi over UART. From there it&#x27;s event streaming: RX packets get translated and tossed into redis, commands relay back out to the mesh as needed. RS485 sits underneath as a wired fallback for noisy RF environments.<p>Once the data&#x27;s in redis, it&#x27;s familiar middleware&#x2F;React&#x2F;websocket&#x2F;pub-sub stuff. Any React dev can build their own UI and bowling animations. Since it all runs on commodity hardware, I can do legit anything I want as the proprietor, and I own all my data. Repairs take five minutes; I can swap the rig on a lane pair in under 10. I&#x27;d bet a house like mine could go from zero to running in an hour or two.<p>We&#x27;re calling it OpenLaneLink, and I plan to open source the hardware, firmware, and software stack when it&#x27;s ready. Bowling is fun, and I want to help keep it affordable for alleys like mine. I hate vendor lock-in. I&#x27;m not a fan of closed systems, calling support for every hiccup, or paying to &quot;white label&quot; my own equipment. Want to go Tron-themed for a night? Good luck finding a neon neumorphic theme in something bought at the turn of the century.<p>All that bugged me. Sure, bowling equipment is niche, but the open hardware and software landscape is amazing.<p>Thanks for reading! Let me know if anyone&#x27;s interested in more posts about this bowling nonsense.