开发者

Moving .NET based data collection system to a remote, unattended installation?

I have a need to do some fairly simple (at least on the surface) data acquisition and logging. In a remote location (as in, on another continent), there will be a few RS-485 devices (our custom hardware product) using a proprietary protocol, plus a weather station (anemometer and vane). For the weather station, I have a couple of options: one outputs wind speed as a square-wave frequency and direction as an analog voltage; the other communicates over USB using an HID interface. The machine to which these devices connect needs to collect data, log it, and periodically transmit it over the Internet through a WiFi connection. This transmission can be either push or pull – that is, I can periodically access the machine remotely to pick up the latest data, or the machine can periodically upload the data to an FTP site or Web service. This machine needs to be installed in an attic, so it needs to work reliably without babysitting, and it needs to survive the environment (temperature, humidity, critters).

I have a .NET application that does most of this already, written against .NET 4. It's a GUI interactive application that displays the measured data and logs it to a file. (I actually have two versions of it with minor differences – one Winforms-based, and the other WPF.)

I've got about a week to develop the solution for the remote install, including identifying and purchasing any necessary equipment, doing any necessary coding, and making it work. Oh, and it has to be cheap. (Like, less than $500 would be nice. Anything over $1,000 is going to be a non-starter.)

Some things I've thought of or has been suggested to me:

  • Use a cheap netbook with an RS-485-to-USB interface. Well, maybe … but I really don't expect this to hold up in the environment. The hard drive isn't going to like extreme heat or cold, for example. An SSD is an option, but that's at least another $100, and I still don't have confidence that the machine's going to hold up to the humidity and critters. I could put it in an enclosure, but that's yet another expense. All-in-all, I just have the feeling this approach is way more expensive and complicated than it needs to be and not likely to be that reliable.
  • Use a small single-board or industrial computer. These are typically ruggedized, and many have RS-485 ports and watchdog timers built in. Some even have general-purpose digital I/Os. I haven't found any with analog voltage input so far, but those probably exist as well. Also, they typically use a CompactFlash card for storage. This feels like the right near-term approach, but the ones that run Windows typically run some embedded version of it (like Windows CE or Windows XP Embedded) – which is probably great, except that I have no experience with these and don't know ho开发者_JAVA百科w much work it will be to get my software up and running on it. Also, they typically have very low-powered processors, and I don't really know what kind of power I need. My app runs just fine on a modern desktop; I don't have a clue whether it will also work fine on one of these low-end CPUs. Some of these advertise that they're compatible with .NET 2.0, but I haven't seen anything past that, so at the very least I'd probably have to back-port everything to .NET 2.0. Oh, and many of these computers that I've found so far are quite expensive.
  • Use a wireless serial server. These things put a serial port on the network. You can connect to it remotely, and the serial port appears to be a local COM port, even though it may be located anywhere in the world. This is sort of an option for the RS-485 stuff. It avoids the issue of having to remotely administer a PC and make my software work remotely. However, I'm concerned about the bandwidth and reliability of an Internet connection to the other side of the world, and this doesn't help with the USB HID device. (Although, if this turns out to otherwise be a good approach, I might be able to find an RS-485 version of that device.)
  • Use a data logger. These, also, appear to be fairly expensive – especially those with WiFi – and I haven't found any that do everything I need. In particular, the high data rate and proprietary protocol of our RS-485 devices appears to be an obstacle. (Many of these are designed to work with MODBUS devices.) The USB HID-based weather station wouldn't work with this approach, so I'd have to use the one that outputs frequency and voltage.
  • Use a low-cost embedded microcontroller solution. Long term (e.g. future projects), this is probably the best approach. It's cheap, and I can program it to do exactly what I need. I don't see myself pulling this one off in a week, though. That's a total rewrite of my software and getting up to speed on the new CPU and development environment.

Does anyone have any experience with this sort of problem? What's the simplest, cheapest, most reliable way you can think of to pull this off? What products or approach(es) should I look at?


Maybe NetDuino+ might help. It's cheap, but you will have to think about power supply, RS232<>RS485 convertor, WiFi and enclosure. It supports .NET Micro Framework, so you could reuse a lot of your C# code. It also has analog and digital IO. GESBC-9260S has RS485 built in, optional WiFi, analog and digital IO. There's Linux on it, so you could probably get away with Mono to use your .NET code.


I ended up going with a CompuLab fit-PC2 running Windows Embedded Standard 7. For the RS-485 input, I used an isolated RS-485-to-USB interface from B&B Electronics. I ended up skipping the interface to the anemometer and vane, which simplified the problem considerably, since now I only needed to communicate with my RS-485 serial devices.

The fit-PC turned out to be a great solution:

  • It's cheap (I paid less than $400 for an 8-GB SSD model from Amazon)
  • it's efficient (only 8 W at full CPU load and 0.5 W standby!)
  • it has on-board WiFi and wired Ethernet
  • it auto powers on and reboots after a power failure
  • it has a hardware watchdog timer that can automatically reboot the PC if it locks up
  • it's tiny and decently rugged

Windows Embedded turned out to be very easy to deal with as well. I ported my app to a Windows Service that runs automatically on system startup and outputs data to a remote MySQL database. Windows embedded doesn't include a feature for .Net 4, so I had to install that separately, but otherwise everything ported over from my development system to the embedded system perfectly.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜