GithubHelp home page GithubHelp logo

cornetp / eagle-owl Goto Github PK

View Code? Open in Web Editor NEW
43.0 43.0 32.0 5.48 MB

Data acquisition from an OWL CM160 +USB device on linux platforms

License: GNU General Public License v2.0

Makefile 0.24% C 87.64% C++ 0.02% Shell 3.91% PHP 0.33% CSS 0.01% JavaScript 4.62% Groff 0.12% HTML 3.14%

eagle-owl's People

Contributors

atrent avatar cornetp avatar ediazrod avatar fbourqui avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

eagle-owl's Issues

cm160 kills cp210x module as soon as it's run

Hi.

I'm having a problem getting cm160 to run on my Raspberry Pi.

When I plug in the Owl I see it appear in /var/log/syslog and a device for it appears at /dev/ttyUSB0.

However, when I run ./cm160, I get this output, with the "No error" message on the first pass and the "could not detach kernel driver..." message from then on.

# ./cm160 
Wait for cm160 device to be connected
Found compatible device #0: 0fde:ca05 (002)
Found 1 compatible device
bulk_read returned -110 (No error)
Wait for cm160 device to be connected
Found compatible device #0: 0fde:ca05 (002)
Found 1 compatible device
bulk_read returned -110 (could not detach kernel driver from interface 0: No data available)
Wait for cm160 device to be connected
Found compatible device #0: 0fde:ca05 (002)
Found 1 compatible device

If I tail /var/log/syslog, I get this the second I run ./cm160

May 28 20:49:31 pi-zero-w kernel: [1043641.132661] cp210x ttyUSB0: cp210x converter now disconnected from ttyUSB0
May 28 20:49:31 pi-zero-w kernel: [1043641.132802] cp210x 1-1:1.0: device disconnected

At this point, /dev/ttyUSB0 no longer exists. If I do the following it reappears until I run ./cm160 again:
rmmod cp210x && modprobe cp210x

So, my uneducated guess is that running cm160 is instantly upsetting the cp210x module.

I've tried building cm160 myself and have tried jesjimher/eagle-owl fork, which explicitly mentions running it on a Raspberry Pi. I've tried two different Owl units, and three different Pi's, all with the same result.

Any help would be appreciated. I bought this Owl specifically to monitor via a Pi and I've hit a bit of a dead-end.

Cheers.

Error after application terminated

I am running the cm160 binary in a non demon mode like: ./cm160 just to check the data coming in. If I terminate this, and try to restart it, I get the following:

zoell@srv02:~/eagle-owl/src$ sudo ./cm160
Wait for cm160 device to be connected
Found compatible device #0: 0fde:ca05 (036)
Found 1 compatible device
bulk_read returned -110 (could not detach kernel driver from interface 0: No data available)
Wait for cm160 device to be connected
Found compatible device #0: 0fde:ca05 (036)
Found 1 compatible device

And it does not do anything just retries these. The only solution I could find is to unplug/plug the usb, but this is a bit pain if I am not at home. Is there any idea on this?

Cannot see stats information, Mint 17 (Ubuntu 14.04)

Hi, just a little info in case someone runs across the same problem I did...

I set this up on a Mint 17 (Ubuntu 14.04) based machine, and was able to see the live data via live.php ok but there was no historic/stats data available.

I assumed that this would normally be derived from the stats_db (which appeared to be updated correctly - file size was growing, and mod times were recent), and displayed via index.php. However when I accessed index.php it displayed nothing, and there was no error message.

Further searching in the logs revealed a server error (PHP Fatal error: Class 'SQLite3' not found...). To fix this:

apt-get install php5-sqlite

Then restart apache - the latter is important because the initial restart following installation of sqlite didn't sort it out. After this it worked fine.

Cheers.

Can not ingest any data

Hi guys,
Being trying this incredible project today, on RPi 3B+, and RPi4, with the most recent OS, and an old Jessie just in case, all the time I get the next:

May 2 18:56:56 raspberrypi kernel: [ 62.625263] usb 1-1.4: new full-speed USB device number 4 using dwc_otg
May 2 18:56:56 raspberrypi kernel: [ 62.760036] usb 1-1.4: New USB device found, idVendor=10c4, idProduct=ea60
May 2 18:56:56 raspberrypi kernel: [ 62.760051] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
May 2 18:56:56 raspberrypi kernel: [ 62.760059] usb 1-1.4: Product: CP2104 USB to UART Bridge Controller
May 2 18:56:56 raspberrypi kernel: [ 62.760067] usb 1-1.4: Manufacturer: Silicon Labs
May 2 18:56:56 raspberrypi kernel: [ 62.760075] usb 1-1.4: SerialNumber: 01E948A1
May 2 18:56:56 raspberrypi mtp-probe: checking bus 1, device 4: "/sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4"
May 2 18:56:56 raspberrypi mtp-probe: bus: 1, device: 4 was not an MTP device
May 2 18:56:57 raspberrypi kernel: [ 63.825585] usbcore: registered new interface driver usbserial
May 2 18:56:57 raspberrypi kernel: [ 63.825680] usbcore: registered new interface driver usbserial_generic
May 2 18:56:57 raspberrypi kernel: [ 63.825774] usbserial: USB Serial support registered for generic
May 2 18:56:57 raspberrypi kernel: [ 63.830422] usbcore: registered new interface driver cp210x
May 2 18:56:57 raspberrypi kernel: [ 63.830543] usbserial: USB Serial support registered for cp210x
May 2 18:56:57 raspberrypi kernel: [ 63.830696] cp210x 1-1.4:1.0: cp210x converter detected
May 2 18:56:57 raspberrypi kernel: [ 63.832962] usb 1-1.4: cp210x converter now attached to ttyUSB0
May 2 18:57:02 raspberrypi kernel: [ 68.595902] random: crng init done

And nothing new come to the application, which remains to wait for hours:
./cm160 Wait for cm160 device to be connected

File leakage

You have the fclose on the .live file inside of the check data integrity if statement. This means that you slowly build up a load of open files every time there is a data issue. This continues into the OS file limit is reached and then the program stops being able to write data to the SQL db. Move the fclose outside of the if statement and all should be fixed.

Andy

data error: invalid ID

Hello,

when I launch the daemon I got:

data error: invalid ID 0x29
0x29 - 0x49 - 0x44 - 0x54 - 0x43 - 0x4d - 0x56 - 0x30 - 0x30 - 0x31 - 0x01 -

Any clue about the reason is not working?

Thanks a lot

Reno.

0 month since end of January

Hi,

Since one month and a half the cm160 process display :
LIVE: 08/00/2016 19:47 : 3236.100000 W
LIVE: 08/00/2016 19:52 : 869.400000 W
LIVE: 08/00/2016 19:52 : 853.300000 W
LIVE: 08/00/2016 19:53 : 1400.700000 W
LIVE: 08/00/2016 19:53 : 1368.500000 W
LIVE: 08/00/2016 19:53 : 1416.800000 W

But on the LCD screen the month is well set to March.
Any idea ?

Regards

Application crash

Hello,

I tried the application and encountered a few hickups:
-I got some data at year 2555 ?!? which I thought should not occur has this is an issue that has been flagged and solved.
-The application suddenly crashed.

I wonder Is there a way to have logs when it is daemonized ?
I am not a programmer so I have no real clue. I suppose that it is in daemonize.c where stdout & stderr are redirected to /dev/null but I am not sure.

Br

data error: invalid ID 0xff

Hi there,

Thankyou for writing this software. After running it for a few hours I've started getting the following output:

LIVE: 03/10/2018 16:07 : 273.700000 W

LIVE: 03/10/2018 16:08 : 289.800000 W

LIVE: 03/10/2018 16:08 : 257.600000 W

LIVE: 03/10/2018 16:09 : 257.600000 W

data error: invalid ID 0xff

0xff - 0xff - 0xff - 0xff - 0xff - 0xff - 0xff - 0xff - 0xff - 0x50 - 0x59 -

data error: invalid ID 0xff

0xff - 0xff - 0xff - 0xff - 0xff - 0xff - 0xff - 0xff - 0xff - 0x50 - 0x59 -

data error: invalid ID 0xff

0xff - 0xff - 0xff - 0xff - 0xff - 0xff - 0xff - 0xff - 0xff - 0x50 - 0x59 -

Restarting the cm160 binary fixes it. Any ideas or how I could go about debugging further ?

Thanks,

software no longer working after upgrade to Ubuntu 15.x

After I upgraded the system to Ubuntu 15.x, the data collection from the device is no longer working.
I think that it is not an issue with your software but with the usb link, however my knowledge of Linux is to limited to find the error.
attached some clipping from Syslog, where I disconnected and reconnected the usb cable, and then restarted the cm160 program, and they are no longer talking to each other.
(sorry no attachment, I can't upload a txt file, so... see below)
Worked perfectly under 14.x.

I would appreciate if you could put me on the right track to fix it.

Best regards,

Luc

Oct 23 19:34:44 workstation kernel: [22537.610588] usb 2-3: USB disconnect, device number 4
Oct 23 19:34:44 workstation kernel: [22537.610781] cp210x ttyUSB0: cp210x converter now disconnected from ttyUSB0
Oct 23 19:34:44 workstation kernel: [22537.610807] cp210x 2-3:1.0: device disconnected
Oct 23 19:34:44 workstation ModemManager[656]: (tty/ttyUSB0): released by modem /sys/devices/pci0000:00/0000:00:02.0/usb2/2-3
Oct 23 19:34:48 workstation kernel: [22541.771327] usb 2-3: new full-speed USB device number 5 using ohci-pci
Oct 23 19:34:48 workstation kernel: [22541.996613] usb 2-3: New USB device found, idVendor=0fde, idProduct=ca05
Oct 23 19:34:48 workstation kernel: [22541.996626] usb 2-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Oct 23 19:34:48 workstation kernel: [22541.996634] usb 2-3: Product: OWL Wireless Electricity Monitor USB version is connected
Oct 23 19:34:48 workstation kernel: [22541.996639] usb 2-3: Manufacturer: Silicon Labs
Oct 23 19:34:48 workstation kernel: [22541.996644] usb 2-3: SerialNumber: 001FD7B0
Oct 23 19:34:48 workstation kernel: [22542.003934] cp210x 2-3:1.0: cp210x converter detected
Oct 23 19:34:48 workstation kernel: [22542.183989] usb 2-3: reset full-speed USB device number 5 using ohci-pci
Oct 23 19:34:48 workstation kernel: [22542.391669] usb 2-3: cp210x converter now attached to ttyUSB0
Oct 23 19:34:48 workstation mtp-probe: checking bus 2, device 5: "/sys/devices/pci0000:00/0000:00:02.0/usb2/2-3"
Oct 23 19:34:48 workstation mtp-probe: bus: 2, device: 5 was not an MTP device
Oct 23 19:34:49 workstation colord-sane: io/hpmud/pp.c 627: unable to read device-id ret=-1
Oct 23 19:34:50 workstation gnome-session[1702]: Wait for cm160 device to be connected
Oct 23 19:34:50 workstation gnome-session[1702]: Found compatible device #0: 0fde:ca05 (005)
Oct 23 19:34:50 workstation gnome-session[1702]: Found 1 compatible device
Oct 23 19:34:50 workstation gnome-session[1702]: usb_set_configuration returns -1 (could not set config 1: Operation not permitted)

Feature request : read multiple sensors

OWL CM160 have 3 sensors (for triphased current).
Right now we can read only the main sensor but maybe it is possible to read both 2 ou 3 sensors ?

I've tried to figure out myself how to do that, and I think maybe it's in the rec->addr field ?

255:255 time in 2255 year sometimes appear

Hello!

Sometimes I got these wrong readings from daemon, despite validity check I see in sources.
Killing and restarting daemon helps, just need to cleanup sqlitedb afterwards.

How can I help in troubleshooting this?

data error: invalid checksum

Hi,

I get these messages in between:

LIVE: 19/02/2021 11:42 : 128.800000 W
data error: invalid checksum: expected 0x61, got 0xe1
LIVE: 19/02/2021 11:43 : 128.800000 W
data error: invalid checksum: expected 0x62, got 0xe2
LIVE: 19/02/2021 11:44 : 112.700000 W
data error: invalid checksum: expected 0x62, got 0xe2
LIVE: 19/02/2021 11:45 : 96.600000 W
data error: invalid checksum: expected 0x62, got 0xe2
LIVE: 19/02/2021 11:46 : 112.700000 W
data error: invalid checksum: expected 0x64, got 0xe4
LIVE: 19/02/2021 11:47 : 112.700000 W
data error: invalid checksum: expected 0x65, got 0xe5
LIVE: 19/02/2021 11:48 : 96.600000 W

Any idea?

cm160 is a power hog

Hi,

Firstly it's a great utility, really useful thank you.

However, powertop shows it wakes the CPU 800 times per second when running as a daemon. This adds 3w to the draw of the system, or put another way increases my electricity bill for that server by about 5%.

Can you fix this wake issue?

Thanks,
Niall

Ubuntu 16.04 - MTP and USB problem suddenly appeared

Hi, OWL has worked for two weeks smoothly, but today stopped working suddenly. What I have is dmesg flooded with entries like the following:
Feb 8 16:41:10 ccorvino-ubu-rm kernel: [15185.972383] usb 1-1.2: USB disconnect, device number 123
Feb 8 16:41:12 ccorvino-ubu-rm kernel: [15187.450358] usb 1-1.2: new low-speed USB device number 124 using ehci-pci
Feb 8 16:41:12 ccorvino-ubu-rm kernel: [15187.548287] usb 1-1.2: New USB device found, idVendor=0665, idProduct=5161
Feb 8 16:41:12 ccorvino-ubu-rm kernel: [15187.548293] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
Feb 8 16:41:12 ccorvino-ubu-rm kernel: [15187.548298] usb 1-1.2: Product: USB to Serial
Feb 8 16:41:12 ccorvino-ubu-rm kernel: [15187.548301] usb 1-1.2: Manufacturer: INNO TECH
Feb 8 16:41:12 ccorvino-ubu-rm kernel: [15187.555291] hid-generic 0003:0665:5161.0544: hiddev0,hidraw3: USB HID v1.00 Device [INNO TECH USB to Serial] on usb-0000:00:1a.0-1.2/input0
Feb 8 16:41:12 ccorvino-ubu-rm mtp-probe: checking bus 1, device 124: "/sys/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2"
Feb 8 16:41:12 ccorvino-ubu-rm mtp-probe: bus: 1, device: 124 was not an MTP device

Device seems to work after restart of cm160 process, but I have numerous Nautilus popup on Unity that tell me I can't mount MTP device ... I don't know what I have to do in order to stop these popups appeared today, I think something is changed with the last Ubuntu kernel?

Any help would be appreciated,
thanks!

Feature request: Temperature information

It seems the OWL has a temperature sensor on board, I'm wondering if I could get that from the received data.

I've looked through the code and can spot the bit where a frame is decoded but I can't seem to find any information regarding the size of the frame and therefore any other potential data that might be along side the electricity data.

kw live...

(I still have to look through your code)

Could it be possible that the live info is referred to 230V even if I set 220V in the Owl receiver?
I'm reading (now) 257W on the .live file while the LCD display on the Owl is showing 246W.
The ratio is very similar to 220/230V...

systemd startup file

Here's a systemd startup item for modern distros. Put in /etc/systemd/system/

[Unit]
Description=CM160 server

[Service]
Type=forking
ExecStartPre=/bin/sh -c '. /etc/eagleowl.conf;test -x $install_path/cm160 || { $
ExecStart=/bin/sh -c '. /etc/eagleowl.conf;cd $install_path;$install_path/cm160$
ExecStop=killall cm160

[Install]
WantedBy=multi-user.target

web pages

when selecting one full year, I got "JSChart: Input data in wrong format for selected chart type" and other follwing errors in separate dialog boxes

I'll investigate (if I can, I don't know javascript)

strange values

my .live file sometimes gets filled with data such as:

255/01/2255 255:255 - 724.50 kW

did it happen to you also?

I hope it's the last one, I'm testing and I'm reporting my findings to improve your software ;)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.