Hi,
Im currently developing an application using you library to monitor all the energy meters on our building in real-time. Although i got to say the library is quite well made and architecture, i'm facing a weird problem with it right now.
My program is running ok, and polls about 50 meters, but, sometimes it just hangs/freezes right when i call the method master.destroy.
You can see the log from my program here:
2010-02-03 11:29:21,861 INFO [main] (s3.meters_poller.meters.Acrel3000eMeter) - Frequency :50048
2010-02-03 11:29:22,049 INFO [main] (s3.meters_poller.meters.Acrel3000eMeter) - ####################################
2010-02-03 11:29:22,096 INFO [main] (s3.meters_poller.meters.Acrel3000eMeter) - ############################## ID 81
2010-02-03 11:29:22,330 INFO [main] (s3.meters_poller.meters.Acrel3000eMeter) - Energy :409937
2010-02-03 11:29:24,143 INFO [main] (s3.meters_poller.meters.Acrel3000eMeter) - Voltage Phase A :23145
2010-02-03 11:29:24,408 INFO [main] (s3.meters_poller.meters.Acrel3000eMeter) - Voltage Phase B :22818
2010-02-03 11:29:24,674 INFO [main] (s3.meters_poller.meters.Acrel3000eMeter) - Voltage Phase C :22868
2010-02-03 11:29:24,939 INFO [main] (s3.meters_poller.meters.Acrel3000eMeter) - Current Phase A :43608
2010-02-03 11:29:25,205 INFO [main] (s3.meters_poller.meters.Acrel3000eMeter) - Current Phase B :41427
2010-02-03 11:29:25,455 INFO [main] (s3.meters_poller.meters.Acrel3000eMeter) - Current Phase C :41558
2010-02-03 11:29:25,768 INFO [main] (s3.meters_poller.meters.Acrel3000eMeter) - Power Phase A :611
2010-02-03 11:29:26,080 INFO [main] (s3.meters_poller.meters.Acrel3000eMeter) - Power Phase B :583
2010-02-03 11:29:26,346 INFO [main] (s3.meters_poller.meters.Acrel3000eMeter) - Power Phase C :605
2010-02-03 11:29:26,596 INFO [main] (s3.meters_poller.meters.Acrel3000eMeter) - Power Factor Phase A :6200
2010-02-03 11:29:26,861 INFO [main] (s3.meters_poller.meters.Acrel3000eMeter) - Power Factor Phase B :6100
2010-02-03 11:29:27,158 INFO [main] (s3.meters_poller.meters.Acrel3000eMeter) - Power Factor Phase C :6300
2010-02-03 11:29:27,424 INFO [main] (s3.meters_poller.meters.Acrel3000eMeter) - Frequency :50097
2010-02-03 11:29:27,611 INFO [main] (s3.meters_poller.meters.Acrel3000eMeter) - ####################################
2010-02-03 11:29:27,611 INFO [main] (s3.meters_poller.meters.Acrel3000eMeter) - Destroing the master and the connection
And here is the code that calls the destroy function:
for(int id:metersID){
Unit currUnit = dbp.getOrCreate(ipv6 + ":C" + id);
acrel3000eMeterLogger.info("############################## ID " + id);
this.readEnergy(id, master, currUnit, dbp);
this.readVoltageA(id, master, currUnit, dbp);
this.readVoltageB(id, master, currUnit, dbp);
this.readVoltageC(id, master, currUnit, dbp);
this.readCurrentA(id, master, currUnit, dbp);
this.readCurrentB(id, master, currUnit, dbp);
this.readCurrentC(id, master, currUnit, dbp);
this.readPowerA(id, master, currUnit, dbp);
this.readPowerB(id, master, currUnit, dbp);
this.readPowerC(id, master, currUnit, dbp);
this.readPowerFactorA(id, master, currUnit, dbp);
this.readPowerFactorB(id, master, currUnit, dbp);
this.readPowerFactorC(id, master, currUnit, dbp);
this.readFrequency(id, master, currUnit, dbp);
dbp.saveReadings(currUnit);
acrel3000eMeterLogger.info("####################################");
}
acrel3000eMeterLogger.info("Destroing the master and the connection");
master.destroy();
acrel3000eMeterLogger.info("DONE");
Further investigation of this behavior led me to believe it's a RXTX problem as described [url=http://forums.sun.com/thread.jspa?threadID=5261638]here, [url=http://mailman.qbang.org/pipermail/rxtx/20051229/002014.html]here [url=http://bugzilla.qbang.org/show_bug.cgi?id=46]and here
I've been able to reproduce the problem on windows and not on Linux, but since there are people with the same RXTX problem using Linux and you implementation for both OS should be equal, i'm guessing i've only been lucky. So, can you shed some light on my problem? I really can't afford my program to stop, it has to be allways running.. :roll:
Sorry for the long post,
Miguel.