是否有可用且完整的 1-Wire .NET 库?

发布于 2025-01-03 03:49:48 字数 589 浏览 0 评论 0原文

我有一个 1-Wire USB 适配器(蓝色的),想在一个小型 Linux 盒子上使用它来监控温度。 Linux 盒子现在出了故障,所以与此同时,我想在 Windows 桌面上使用基于 .NET 的监控软件来记录温度。但似乎不存在一个可用的 .NET 库。 Maxim SDK 附带的那个需要 J#,但我没有但想使用。我什至不确定是否可以将它与基于 .NET 4.0 的应用程序一起使用,因为 J# 已停止使用。 SourceForge (owdotnet) 上的另一个“开源项目”的日期是 2008 年,看起来已经死了。甚至没有任何关于它的信息页面。 Maxim SDK还附带了一个“Compact .NET”版本,它至少可以找到连接到适配器的设备,但我似乎需要自己实现整个1-Wire协议(发送原始字节,等待一小会儿) ,以及诸如此类的东西)。所以现在这没有多大帮助。谷歌没有找到任何其他东西。你?

我的印象是整个 1-Wire 已经死了。它只能在 Linux 系统上使用(使用 owfs,编译起来非常庞大),而且整个产品生态系统并不活跃。还有哪些其他解决方案可以测量温度、环境参数(湿度、水、压力等)和状态(如打开的门),甚至可以做一些不需要花费很多钱的开关(打开和关闭灯)(就像“家庭自动化”一样)?并且最好也可以通过 .NET 代码访问?

I have a 1-Wire USB adapter (that bluish one) and wanted to use it from a small Linux box to monitor temperatures. The Linux box is out of order right now, so in the meantime I wanted to use my .NET-based monitoring software on my Windows desktop to log the temperatures. But there doesn't seem to exist a single usable .NET library for .NET out there. The one that ships with the Maxim SDK requires J# which I do not have and want to use. I'm not even sure if I can use it with my .NET 4.0-based application since J# is discontinued AFAIK. The other "open-source effort" on SourceForge (owdotnet) is dated 2008 and looks pretty dead. There's not even any information page about it. The Maxim SDK also comes with a "Compact .NET" version which can at least find a device attached to the adapter, but I'd need to implement the whole 1-Wire protocol myself it seems (sending raw bytes, waiting a short while, and that sort of stuff). So that doesn't help much right now. Google didn't find anything else. Do you?

I have the impression that the whole 1-Wire thing is pretty dead. It can only be used on Linux systems (with owfs, which is like huge to compile), and the whole products ecosystem isn't exactly active. What other solutions are there to measure temperatures, environmental parameters (humidity, water, pressure, and the like) and states (like open doors) and maybe even do switch things (turn lights on and off) that don't cost a fortune (as with "home automation")? And are preferably also accessible from .NET code?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

眼泪都笑了 2025-01-10 03:49:48

好吧,为了回答问题,这个问题已经存在了足够长的时间了。

我得出的结论是没有这样的库可用。

如果您发现了什么,请添加您的答案,以便我可以在这里更新内容。

Alright, for the sake of answering questions, this question has been here long enough.

I have come to the conclusion that there is no such library available.

Just add your answer if you find something, please, so I can update things here.

羞稚 2025-01-10 03:49:48

你不需要 OWFS,尽管我明白为什么它会让生活更轻松。我过去尝试过,但它没有达到我想要的效果,因为我有一些不受支持的设备。

我目前使用 OWW,目前我正在 Raspberry Pi 上运行它,它确实运行得很好。然而,它仅基于Linux。

很抱歉,我无法帮助您解决 .net 查询,因为我从未使用过它。除了 Maxim 之外,我似乎找不到其他基于 .net 的东西。

You don't need OWFS, although I can see why it would make life easier. I tried it in the past but it didn't do what I wanted it to as I had some devices which were unsupported.

I currently use OWW which I am running on a Raspberry Pi at the moment and it works very well indeed. However, it is linux based only.

I am sorry but I cannot help with your .net query as I have never used it. It does seem that there is nothing else .net based that I can find apart from the Maxim one.

能怎样 2025-01-10 03:49:48

我不确定对您的问题了解得足够多,无法给您一个正确的答案(但这是一个开始,我们有可能一起改进它。)

我知道您在 J# 中有一些可以完成这项工作的东西。

AJ# 应用程序编译成普通的 .NET 程序集。您是否有 J# 代码(在这种情况下,您可以使用旧的 J# 编译器将其编译为库,然后在 .NET 应用程序中引用此库以从任何 .NET 语言使用它),或者您是否已经有 ab 程序集,在在这种情况下,您可以随意将其与任何语言一起使用。

否则,您可以找到一个本机库,然后使用 C++/CLI 创建 围绕它创建一个 .NET 包装器
根据我的经验,这个选项非常有效。主要问题是 32/64 位兼容性:您的 .NET 应用程序需要限制为本机 dll 格式(64 位或 32 位)

I am not sure to know enough of your probleme to give you a proper answer (but it's a start, and it's possible that we will be able to improve it together.)

I understand that you have something in J# which does the work.

A J# application compiles into a normal .NET assembly. Do you have the J# code (in this case you could compile it into a Library using the old J# compiler, then reference this Library in your .NET app to use it from any .NET language) or do you have already ab assembly, in which case feel free to use it with any language.

Otherwise, you could find a native Library, then create a .NET wrapper around it using C++/CLI.
This option works really well from my experience. The main gotcha is the 32/64 bit compatibility: Your .NET app will need to be restricted to the native dll format (64 bit or 32 bit)

作死小能手 2025-01-10 03:49:48

我在上一个工作项目中也遇到了同样的麻烦。

我使用了 OW.NET 并在几周前在 sourceforge 项目中提供了一个 svn 补丁文件Container41 类。通过我的补丁,该设备系列的大部分功能都应该得到支持。

但是,是的,没有完整的库。 Maxim 的 J# 库就是一个糟糕的笑话。

I'd run in the same trouble with my last project on work.

I've used OW.NET and provided a svn patch file some weeks ago in the sourceforge project for the Container41 class. With my patch, mostly all functionallity for this device family should be supported.

But yes, there is no complete library. And the J# library from Maxim is a bad joke.

十秒萌定你 2025-01-10 03:49:48

我在树莓派上使用 DS1820 1 线温度传感器。
这是基于新的 System.Device.Gpio nuget 包。
目前它只是一个概念证明。
https://github.com/dos-ise/OneWire

I am using an DS1820 1-wire temperature sensor on a raspberry pi.
This is based on the new System.Device.Gpio nuget package.
At the moment it is just a proof of concept.
https://github.com/dos-ise/OneWire

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文