EnviroMon and Linux

Post your Linux discussions here
Post Reply
robot101
Newbie
Posts: 0
Joined: Sun Nov 28, 2010 6:04 pm

EnviroMon and Linux

Post by robot101 »

My father has a variety of EnviroMon temperature and humidity sensors fitted around the house due to an ongoing preoccupation with energy efficiency. For reasons of my sanity, I'm trying to migrate the last few Windows machines in his house over to Linux, as well as make graphs of the temperature readings accessible remotely without requiring a Windows PC running 24/7.

The first was fairly easy - EnviroMon seems to run perfectly well under Crossover, I just had to symlink .cxoffice/EnviroMon/dosdevices/com2 to /dev/ttyUSB0. The second is harder - we have an ARM NAS running Linux under the stairs. My end goal is that the agent can run on the ARM box and a local client can poll for the current readings and put them into Cacti 24/7, and as necessary the full EnviroMon client can be run on a desktop system to do any interactive graphing or reprogramming.

Unfortunately the ancient emagtlnx from Pico is (in my opinion, fairly needlessly!) only provided as an x86 binary and doesn't work under qemu (in fact, it really barely works for me at all even on an x86 box running Ubuntu 10.10). So, using strace and the emcltlnx.c as my guides, I've had a go at reimplementing it in Python so I can run it on the ARM box. It seems to work fairly robustly now, and can handle two clients talking to the logger in parallel.

My next plan is to write an em_client.py and the glue to make it a Cacti data source.

So, a few questions...
* Is this useful to people? Let me know how you get on.
* Does anyone from Pico want to tell me whether this looks right or not? Feel free to ship it. :)
* Are there any documents about how the logger requests are put together? I'd like to know how to probe which sensors are attached from my Linux client, and ideally also their string names. Otherwise when the logger is reprogrammed, my Linux client will get its readings mixed up and mess up the beautiful Cacti graphs.
* Is the logger protocol stateful? As in - if the full EnviroMon is in the middle of reprogramming, and my Linux client sends in a request for the current readings, how badly wrong will everything go? :)

Cheers,
Rob
Attachments
em_agent.py.txt
Python EnviroMon UDP <-> Serial agent
(8.83 KiB) Downloaded 731 times

Post Reply