Connecting Current cost meter to PC problem
I have connected the Currentcost meter to my PC with a cable purchased from Currentcost themselves, and your program fails to connect to it on COM1. Is there something I am doing wrong?
3
people have this question
I have this question, too!
Tell me when someone answers.
The more people who ask this question, the more it gets noticed.
The more people who ask this question, the more it gets noticed.
The company marked this question as answered.
Create a customer community for your own organization
Plans starting at $19/month
-
Inappropriate?Sorry to hear that you're having difficulty with it. I'll try and help if I can, but to do so I'm afraid I have a ton of questions. (Apologies if some or all of these sound obvious, but I figure it's best to at least ask rather than assume).
1) Is this a "second generation" CurrentCost meter? My app only cannot be used with "first generation" meters (for fairly dull reasons which I can go into if you're interested).
2) What type of cable are you using? An all-in-one RJ45-to-USB cable? An RJ45-to-serial cable? Or an RJ45-to-serial with a serial-to-USB cable attached?
3) What platform are you using? You say "COM1", so I'm assuming Windows XP, right?
4) Have you installed the drivers for the cable you are using to connect the meter to your PC? I use Prolific drivers that I downloaded from http://www.prolific.com.tw/eng/downlo... .
5) Have you configured the drivers correctly? The main thing needed is to set the baud rate to 9600. For the drivers that I use, this can be seen in the driver properties dialog as shown here.

6) Why are you using "COM1" as a setting? I'm assuming it's because this is what you specified in the driver settings? I use COM19, which you can see is specified in the Device Manager.

7) Have you been able to connect other software to the CurrentCost meter successfully? It's entirely possible that you have come across a bug in my code, so a good way to prove/disprove this is to try and connect to the meter from something else. Hyperterminal comes with Windows XP, so is probably the quickest thing to try.
If you can get data out of your CurrentCost meter using Hyperterminal (or any other serial port monitor), please do show me what you get, and I can see why my app might have a problem with it.
Hope this helps us track down the problem!
Kind regards
D -
2 people say
this answers the question
-
Inappropriate?Ok...2 things that have sorted it out now..
1. I needed to enter COM1 as the port as Colin says, and
2. It seems I have the old version as comms is only at 2400, as tested with hyperterminal, there it seems the software will not work.
Thanks for the replys.. -
Ah, sorry to hear that.
By way of background for others who might come across this, the first generation CurrentCost meters only output the current meter reading - a snapshot in time of your electricity usage at that time.
The second generation CurrentCost meters also output history data - the history of your hourly, daily and monthly electricity usage. My app reads this data and displays it. So if you have a first gen meter, then the app never gets any history data to display. :-(
lawrencez - The older meters do still output the current reading, so your alternative would be to store this. If you store every reading, every 6 seconds, you can build up a history data source of your own. Several of us have done this - I’ve discussed doing this with MySQL myself, using Perl to query the MySQL store. You can do some quite powerful queries this way. (see my blog for details)
The downside is that to build a useful history store, you have to have a computer connected to the CurrentCost meter all the time. Which can potentially negate any benefits of monitoring your electricity usage!
You can use a very low-powered server to deal with this. I've mentioned using a Slug for this purpose, although there are alternatives such as the Viglen MPC.
If you do decide to pursue such an approach, feel free to give me a shout if there is anything I can do to help. -
Inappropriate?Seem to have a similar problem. I've just got a current cost meter, with their cable bought from ebay. I'm running Vista and the in-built drivers didnt seem to work with the cable, so I downloaded a Prolific vista driver which seems to install fine - i then see it in Device Manager as COM10. However when i set the port to COM10 in your GUI and 9600baud it times out or says it failed to connect
(SRC: System
TGT: WinIOError
OS: Microsoft Windows NT 6.0.6001 Service Pack 1
Current directory: C:\Users\ben\Desktop
CLR: 2.0.50727.1434
App version: 0.4
MSG: Access to the port 'COM10' is denied.
Stack:
at System.IO.Ports.InternalResources.WinIOError(Int32 errorCode, String str)
at System.IO.Ports.SerialStream..ctor(String portName, Int32 baudRate, Parity parity, Int32 dataBits, StopBits stopBits, Int32 readTimeout, Int32 writeTimeout, Handshake handshake, Boolean dtrEnable, Boolean rtsEnable, Boolean discardNull, Byte parityReplace)
at System.IO.Ports.SerialPort.Open()
at CurrentCostGUI.SerialPortAccess.GetSingleUpdate()
Inner: )
any ideas? many thanks, Ben
(not sure how to detect if I'm getting an output in Vista, as it doesn't seem to have hyperterminal? -
This error is from a .NET app I tried writing a while back - I'm not still working on this one. For various reasons, I started again in Python rather than C#.
The new app is here -
Inappropriate?Sorry - thought it would be helpful to add some more info to help you reply. It doesn't say access denied, it just sits there waiting for data and nothing happens. It's definately the latest currentcost version, which outputs historical data.
I downloaded a Serial Port Monitor (v4.0) from Eltima Software and got the following output with the monitor connected to COM9:
Dump View
[13/12/2008 18:30:36] - Read data
00 80 78 f8 78 80 78 80 78 80 00 80 00 80 78 00 .€xøx€x€x€.€.€x.
00 f8 78 78 78 80 00 80 00 80 78 80 78 00 78 80 .øxxx€.€.€x€x.x€
00 80 00 80 00 80 00 80 f8 80 80 00 80 f8 78 00 .€.€.€.€ø€€.€øx.
80 78 80 78 00 78 80 00 80 00 f8 78 80 78 80 00 €x€x.x€.€.øx€x€.
80 00 80 00 80 f8 78 00 f8 78 80 78 80 00 80 78 €.€.€øx.øx€x€.€x
f8 78 80 f8 78 f8 78 80 80 80 80 f8 80 80 00 80 øx€øxøx€€€€ø€€.€
f8 78 78 f8 78 80 f8 78 f8 78 80 00 80 f8 80 78 øxxøx€øxøx€.€ø€x
78 78 00 78 80 78 f8 80 80 80 80 00 80 f8 78 f8 xx.x€xø€€€€.€øxø
80 78 78 78 00
Table View
0 13/12/2008 18:30:36 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_COMMSTATUS) DOWN STATUS_SUCCESS
1 13/12/2008 18:30:36 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_COMMSTATUS) UP STATUS_SUCCESS 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
2 13/12/2008 18:30:36 IRP_MJ_READ DOWN STATUS_SUCCESS
3 13/12/2008 18:30:36 IRP_MJ_READ UP STATUS_SUCCESS 00
4 13/12/2008 18:30:36 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_COMMSTATUS) DOWN STATUS_SUCCESS
5 13/12/2008 18:30:36 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_COMMSTATUS) UP STATUS_SUCCESS 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
6 13/12/2008 18:30:36 IRP_MJ_READ DOWN STATUS_SUCCESS
7 13/12/2008 18:30:36 IRP_MJ_READ UP STATUS_SUCCESS 80
8 13/12/2008 18:30:36 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_COMMSTATUS) DOWN STATUS_SUCCESS
9 13/12/2008 18:30:36 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_COMMSTATUS) UP STATUS_SUCCESS 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
10 13/12/2008 18:30:36 IRP_MJ_READ DOWN STATUS_SUCCESS
11 13/12/2008 18:30:36 IRP_MJ_READ UP STATUS_SUCCESS 78
12 13/12/2008 18:30:36 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_COMMSTATUS) DOWN STATUS_SUCCESS
13 13/12/2008 18:30:36 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_COMMSTATUS) UP STATUS_SUCCESS 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
14 13/12/2008 18:30:36 IRP_MJ_READ DOWN STATUS_SUCCESS
15 13/12/2008 18:30:36 IRP_MJ_READ UP STATUS_SUCCESS f8
16 13/12/2008 18:30:36 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_COMMSTATUS) DOWN STATUS_SUCCESS
17 13/12/2008 18:30:36 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_COMMSTATUS) UP STATUS_SUCCESS 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Afraid that all doesn't mean owt to me, any help appreciated!
Thanks Ben -
Thanks for this... it's interesting. I'm afraid, however, that this doesn't look anything like CurrentCost data.
There is a blog post with sample data here: http://cumbers.wordpress.com/2008/05/07/breakdown-of-currentcost-xml-output/
This post shows what a single update from a CurrentCost meter looks like, and you should see a line of text like this every six seconds.
This should be true whatever utility you use to read the serial port - I've tried several and it always looks much the same.
I'm not sure what you're accessing here... assuming that you've connected to the right COM port, I guess you must be viewing serial port connection diagnostics at a lower level than just the data being received. Are there settings in your utility for just seeing the data? Or could you try a simpler program? -
Inappropriate?Thanks for the swift response Dale. I just tried with a more basic terminal program AND crucially tried at 2400 baud and voila...
<msg><date><dsb>00004</dsb><hr />19<min>02</min><sec>22</sec></date><src><name>CC02</name><id>00077</id><type>1</type></src><ch1><watts>00136</watts></ch1><ch2><watts>00000</watts></ch2><ch3><watts>00000</watts></ch3><tmpr>14.3</tmpr></msg>
<msg><date><dsb>00004</dsb><hr />19<min>02</min><sec>28</sec></date><src><name>CC02</name><id>00077</id><type>1</type></src><ch1><watts>00138</watts></ch1><ch2><watts>00000</watts></ch2><ch3><watts>00000</watts></ch3><tmpr>14.3</tmpr></msg>
<msg><date><dsb>00004</dsb><hr />19<min>02</min><sec>40</sec></date><src><name>CC02</name><id>00077</id><type>1</type></src><ch1><watts>00088</watts></ch1><ch2><watts>00000</watts></ch2><ch3><watts>00000</watts></ch3><tmpr>14.3</tmpr></msg>
So I'm not sure if I have an old meter (i just bought it off ebay and it said it woudl be 9600 version with historical data), it has the newer RJ45 connector rather than USB. I've emailled currentcost, but have you come across this? -
It does sound like you have one of the earlier models which only output current values and not history. Both the data you're seeing and the fact it connects at 2400 baud rate are consistent with that. You can get this older version with RJ45-style socket so that doesn't contradict it. Sorry. -
Inappropriate?Hi Dale,
Many thanks for the info before; you were right it was the 2400 version. They've now sent me the 9600 version and I get the following out of a serial port monitor so it seems to be working now...
<msg><date><dsb>00001</dsb><hr />12<min>29</min><sec>16</sec></date><src><name>CC02</name><id>00077</id><type>1</type><sver>1.06</sver></src><ch1><watts>00164</watts></ch1><ch2><watts>00000</watts></ch2><ch3><watts>00000</watts></ch3><tmpr>13.7</tmpr><hist><hrs><h02>000.0</h02><h04>000.0</h04><h06>000.0</h06><h08>000.0</h08><h10>000.0</h10><h12>000.0</h12><h14>000.0</h14><h16>000.0</h16><h18>000.0</h18><h20>000.0</h20><h22>000.0</h22><h24>000.0</h24><h26>000.0</h26></hrs><days><d01>0000</d01><d02>0000</d02><d03>0000</d03><d04>0000</d04><d05>0000</d05><d06>0000</d06><d07>0000</d07><d08>0000</d08><d09>0000</d09><d10>0000</d10><d11>0000</d11><d12>0000</d12><d13>0000</d13></d13></days></hist></msg> -
Inappropriate?sorry ignore earlier post- it seems to be working now - thanks ben!
-
Inappropriate?closing.
Loading Profile...



EMPLOYEE