The empty daily history is causing a JavaScript crash.
Firefox’s JavaScript implementation is different on Mac OS (where I developed it) and Windows (where you’re testing it), enough to cause a crash.
We have locale differences (say, decimal point) which is messing with a locale-dependent function in JavaScript.
My money’s on the first one, but you won’t know till tomorrow when the first daily history populates.
Are you any good at using Firebug to debug JavaScript on your machine? If you can identify the crash on your installation it would help immensely. Otherwise I will have to try to reproduce a virgin device without history at my end.
(You are using the latest version of the plugin, aren’t you? I specifically fixed a couple of bugs related to empty history a few days ago in changesets @9-@11.)
(Edit: You are also pressing the History tab handle twice to get around the JavaScript tab bug in MiOS, yes? I am assuming yes, but let’s just get all the obvious problems out of the way first.)
[tt]J_CurrentCostEnviR1.js[/tt] was missing from [tt]/etc/cmh-ludl[/tt], but there was a [tt]/etc/cmh-ludl/J_CurrentCostEnviR1.json[/tt] … The link for [tt]J_CurrentCostEnviR1.js[/tt] is still wrong ([tt]http://code.mios.com/trac/mios_currentcost-envir/wiki[/tt]).
The history is working now, I just had to put the right [tt]J_CurrentCostEnviR1.js[/tt] into [tt]/etc/cmh-ludl[/tt].
Now fixed, and with another bugfix too: the history doesn’t have an off-by-one error between the top of the odd hour and the end of the history dump several minutes later.
Hey, nice idea. Do you mind if I take your code and run with it? I’m thinking of turning it into a generic device that listens for the state of any other device’s variable, and logs it. Done that way, every energy monitor owner will be able to do what you do, not just us CurrentCost people. It could also be useful for other types of variable (say, motion sensors or temperature sensors).
I don’t mind if you run with my code - but if OpenWRT doesn’t use a wear leveling algorithm, it might be a bad idea to do extensive logging to the file system.
To be on the safe side, I’d use [tt]logger[/tt] and log the data to an external syslog server.
Logger takes some options (-p in particular) that your remote syslog server can use to filter the log stream for energy monitoring into its own file. Maybe it can save you some postprocessing later.
I have the envi connected directly to my verde, and I added all of the plugin files, but I only get one device that shows Power: W. I can’t seem to get it to display any power usage.
Probably a serial port problem. Describe what you’ve done, and how it’s connected. Also tell me if the Luup log has any relevant messages.
Edit: Specifically, have you been into Toolbox > MiOS Developers > Serial Port Configuration, and set (at least) Baud, Data bits, Parity, Stop Bits, and Used By Device?
I have the vera2 and the current cost 128. The currentcost is connected with the supplied usb/serial/rj45 cable directly to the back or the vera.
lsusb shows
Bus 001 Device 003: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port
dmesg shows
usbserial.c: USB Serial support registered for CP210X
usbserial.c: USB Serial support registered for FTDI SIO
usbserial.c: USB Serial support registered for FTDI 8U232AM Compatible
usbserial.c: USB Serial support registered for FTDI FT232BM Compatible
usbserial.c: USB Serial support registered for USB-UIRT Infrared Tranceiver
usbserial.c: USB Serial support registered for Home-Electronics TIRA-1 IR Transceiver
usbserial.c: USB Serial support registered for PL-2303
usbserial.c: PL-2303 converter detected
usbserial.c: PL-2303 converter now attached to ttyUSB0 (or usb/tts/0 for devfs)
I’ve added the 8 plug in files and created a new device called “power” using the device file D_CurrentCostEnviR1.xml
I then when back to miis developers on the serial port tab, I see one serial port called pl2303
I set the path as /dev/usb/tts/0 and set the Baud rate to 57600 and the used by device to power then close the dialog and clicked save.
The only device I see is Power but no usage next to it.