Coder Social home page Coder Social logo

libomron's Introduction

libomron

by Kyle Machulis <[email protected]>

Nonpolynomial Labs - http://www.nonpolynomial.com

with contributions from

  • Brett Viren - SWIG Implementaiton, Python utils

  • And others

If you find libomron useful, please donate to the project at http://www.pledgie.com/campaigns/14372

Description

libomron is a mainly C-based implementation of the data retreival protocol for the USB enabled line of omron home medical equipment.

Supported Hardware

Blood Pressure Monitors * HEM-790-IT * BP-791-IT * M10-IT

Pedometers * HJ-720-IT

While basic communication functions in the library should work for any Omron product, there may be differences in packet layout and measure units between US/European/Japanese/etc products…​ We will try to cover these as requested, but the library itself is produced in the US, so that’s what I have easiest access to.

A Tale of Two Libraries

libomron comes in two flavors: Win32 and libusb-1.0. The Win32 version uses direct Win32 DDK calls to access the windows HID system, and reads raw reports from there (which means we aren’t required to install any specific drivers.). libusb-1.0 works for all platforms currently supporting the library.

Library Requirements (For Compilation)

To build on Ubuntu, you can pull the following packages to build the project from source.

  • libusb-1.0-0-dev

  • cmake

  • cmake-data

For OS X, there are build files available for homebrew and macports.

Build Notes

To build libomron, make a subdirectory in the source dir (called whatever you want), then go into that directory and run "cmake ..". This will generate the project files for your platform (makefiles for OS X and linux, visual studio for windows). For more information on project generators, look at the cmake documentation.

Notes on Compilation and Usage

Mac OS X

You will need to install the "Omron OS X Extension" in order to use omron software on OS X. The file and installation instructions are available on the libomron sourceforge site, or in the mac binary package if one is available. The kext should work on 10.5 or later.

Linux

The VID/PID pair of the omron will need to be blacklisted on linux in order to use libomron there without requiring root access. This can be done either in the kernel or through udev.

License

Copyright (c) 2009-2010, Kyle Machulis/Nonpolynomial Labs
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in the
      documentation and/or other materials provided with the distribution.
    * Neither the name of the Kyle Machulis/Nonpolynomial Labs nor the
      names of its contributors may be used to endorse or promote products
      derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY Kyle Machulis/Nonpolynomial Labs ''AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL Kyle Machulis/Nonpolynomial Labs BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE

Brett Viren’s README

(I’m including Brett’s README here because I’m too lazy to integrate it and just want to get 0.9.0 out. :) )

This is a fork of http://github.com/qdot/libomron I use to play around with my 790-IT. Much thanks to qDot for the original heavy lifting! The intention here is to scratch my own itch and feed any useful improvements back to qDot.

  • Overview

This fork adds:

  • Python bindings via SWIG

  • Python utilities including plotting, device autodetection

  • Random bug fixes/improvements on the C side

  • A simple Python/TK GUI app.

  • Installation

    • Pre-requirements

  • CMake

  • SWIG

    • Steps for installation, testing and running

Things are not as polished as they could be, but here is how to go from nothing to something.

It assumes these locations:

  • git clone to ~/git/libomron

  • build area in ~/opt/omron-build

  • install area in ~/opt/omron

0) Clone github repo by going to http://github.com/brettviren/libomron and selecting a method

cd ~/git
git clone ...

1) Go to resulting libomron/ directory and install needed qDot submodule (git://github.com/qdot/compily_buildd.git)

cd ~/git/libomron
git submodule update --init

2) Create and enter installation directory

mkdir -p ~/opt/omron-build
cd ~/opt/omron-build/

3) Run "cmake ~/git/libomron"

4) Run "make" and optionally "make DESTDIR=~/opt/omron install"

5) Plug in USB and find out device

lsusb | grep Omron
Bus 005 Device 006: ID 0590:0028 Omron Corp. HJ-720IT Pedometer

(note, my 790-IT blood pressure monitor is identified incorectly, but that is okay)

6) From the numbers above, set this env. var.:

export OMRON_DEV=/dev/bus/usb/005/006

7) Check that it is readable and writable by you:

ls -l $OMRON_DEV
groups

8) Finally, run the example to readout stored values

~/opt/omron/usr/local/bin/omron_790IT_test

9) Try out the python bindings do:

export PYTHONPATH=~/opt/omron/usr/local/python
python ~/opt/omron/usr/local/python/omron/omron_790IT_test.py
# (this will make a omron.sqlite3 in current directory
python ~/opt/omron/usr/local/python/omron/store.py
# (this will dump omron.sqlite3)
python ~/opt/omron/usr/local/python/omron/plot.py
# (this wlil plot all readouts)

10) Try the GUI app

# Set PYTHONPATH as above, and print help screen
python ~/opt/omron/usr/local/python/omron/gui -h
# Run it, point it to a data file, can be same one produced above
python ~/opt/omron/usr/local/python/omron/gui -f omron.sqlite3

libomron's People

Contributors

brettviren avatar qdot avatar synrg 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

libomron's Issues

Delete command for pedometer

The windows UI does a delete after downloading all the data (to stop the blinking B). I don't see the command for that in the docs or the omron.h.

M10-IT - two people

After a bit of a struggle, being something of a linux newbie, I managed to get the data downloaded for my M10-IT, into sqlite and hence into LibreOffice calc, with correct UK text date/times. All great! Thanks to all for their work.

However, I have two people on my M10, and I can't find a way to get at the second data set. Not understanding the protocol it's not been possible for me to figure out how to change the python scripts to get at this data. I've never written any python before, but I'm hoping I can manage it provided I know what message I am meant to be sending. Any ideas?

Also, is there any way to automate the finding of the USB device numbers rather than having to create OMRON_DEV by hand each time? (I'm not sure but have some idea that one of the python scripts does this - is that correct?)

For your information only (no complaint!) the problems I had (not doubt due to being new to linux, and rather slow) are as follows. I'm on ubuntu 12.04 64 bit.

  • it took me a while to figure out what the git clone command was meant to be, having never heard of git before - I hadn't understood from the instructions I just had to add the http address of the repository
  • I had to download several additional libraries - no problem (pythyon_numpy, python_tk, python-matplotlib)
  • 'ls -l $OMRON_DEV groups' failed - I'm not sure what the 'groups' was intended to do but had to omit it
  • when I first ran the test it couldn't find the library libomron.so.0.9.0 - eventually I created a sh script that exported a LD_LIBRARY_PATH (I don't really understand this stuff but I cribbed it from elsewhere and it worked)

Anyhow, thanks again.

OMRON BP791IT serial number reading is invalid

When I use the omron_get_device_serial() call I always get hex return value 0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x06
( I am using usbfs.c)
Has anybody succesfully read the serial number from this device, and if yes how is it done ?

Thanks,
Robert

Missing omron.lib

Hi,
Whenever i try to build the example projects i get the error message:
"cannot open file 'omron.lib'". I can understand that. I don't have a file named that.
Is it something that is supposed to be created when you run Cmake? Or am i missing something obvious?
(I'm on Windows using Visual Studio btw)

Fix for problem in store.py, Please examine

When using python I've got the following problem

/opt/omron/usr/local/python/omron/store.py", line 7, in ymdhms2seconds
t = time.strptime("%d %d %d %d %d %d"%(YY,MM,DD,hh,mm,ss),format)
File "/usr/lib/python2.6/_strptime.py", line 454, in _strptime_time
return _strptime(data_string, format)[0]
File "/usr/lib/python2.6/_strptime.py", line 325, in _strptime
(data_string, format))
ValueError: time data '9 1 14 11 21 59' does not match format '%y %m %d %H %M %S'

line 6 and 7 in store.py are
6 format = "%y %m %d %H %M %S"

I fixed it by adding 02 for each %d so line 7 became

7 t = time.strptime("%02d %02d %02d %02d %02d %02d"%(YY,MM,DD,hh,mm,ss),format)

so instead year 9 its 09 and month 1 its 01, looks like %y and %m specs always requres 2 digits and not one

BP Monitor Reading Freezes on Windows

I've been trying all day with Swing and CMake to create a DLL that can be can be called via any .Net code (i.e. C#)

Can anyone possibly point me in the right direction, or if your "really" nice ;) compile a DLL for me?

regards

Gavin

Please, help : Unknown CMake command "BUILDSYS_BUILD_LIB"

I am trying to build it under Ubuntu 10.10 but have the following error

Unknown CMake command "BUILDSYS_BUILD_LIB"

What should I do to solve it ?

Attached is full output

~/omron/qdot-libomron-9dfeab5/src/my> cmake ..
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
CMake Error at CMakeLists.txt:17 (BUILDSYS_BUILD_LIB):
Unknown CMake command "BUILDSYS_BUILD_LIB"

Download link

The download link do not work. "Page does not exist! Read the Full Documentation"

omron_protocol_notes.asciidoc update (Omron 790IT Protocol Documentation)

During reverse engineering of latest version of Omron software I discovered some not-documented-yet details of Get Individual Reading (GME) return value format.

  • Byte 6 (claimed UNKNOWN now) is 'Unit Number'. Value of such byte is not used by software.

  • Byte 7 (claimed UNKNOWN now) is part of SYS value which is big-endian two byte value, not just single byte 8. Remember - 790IT can measure SYS up to 300mmHg

  • Byte B (claimed UNKNOWN now) is part of big-endian two byte value together with byte C. The resulting word is bitfield, where
    --- &0x0001 (FPULFLAG) is one bit flag 'Irregular heartbeat detected during measurement'
    --- &0x0002 (MOVEFLAG) is one bit flag 'Movement detected during measurement'
    --- &0x0030 (CNT) is two bit number related to TrueRead function (it's correctly documented in current version of document).
    ==========================================
    Note that this format of GME response apply not only to HEM-790IT (M7080IT, M7080) but also to BP791IT (M7222IT), Elite 7300IT (M7300IT), HEM-670IT (M6040IT, M637IT) and 1500PRO (M1040).

Model HEM-637 (M637IT) lacks flags (word B+C), the PUL (byte A) is immediately followed by checksum instead.

Windows communication doesn't work

Since the move from DDK to WDK, some of the HID functions and headers have moved or no longer exist. This means the windows version of the library currently doesn't work.

Dutch Omrom M10-IT can't be red

I've got an issue reading my omron in VirtualBox (debian) under OSX.
Usb device is connected and shows up in LSusb so I assume my virtual machine is setup correctly.

My build process:

sudo apt-get install swig python-dev cmake build-essential cmake-data libusb-dev swig libusb-1.0-0 libusb-1.0-0-dev

mkdir ~/git
cd ~/git
git clone http://github.com/brettviren/libomron
cd ~/git/libomron
git submodule update --init
mkdir -p ~/opt/omron-build
cd ~/opt/omron-build/
cmake ~/git/libomron
#change CMakeCache.txt:57 to CMAKE_C_FLAGS:STRING=-I/usr/include/libusb-1.0 
make
make DESTDIR=~/opt/omron install
lsusb | grep Omron
#Bus 001 Device 003: ID 0590:0028 Omron Corp. HJ-720IT Pedometer / Blood Pressure Monitor HEM-7080IT-E

cd ~/opt/omron-build/bin$
sudo omron_790IT_test

Continuing as root the result is:

# export OMRON_DEV=/dev/bus/usb/001/003
root@:~# lsusb
Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 002: ID 80ee:0021 VirtualBox USB Tablet
Bus 001 Device 003: ID 0590:0028 Omron Corp. HJ-720IT Pedometer / Blood Pressure Monitor HEM-7080IT-E
root@:~# ls
root@:~# cd /home/USERUSER/
git/     opt/     .python/ src/     .vim/    
root@whm:~# cd /home/USERUSER/opt/omron
omron/       omron-build/ 
root@whm:~# cd /home/USERUSER/opt/omron-build/bin/
root@whm:/home/USERUSER/opt/omron-build/bin# ls
omron_720IT_test  omron_790IT_test
root@whm:/home/USERUSER/opt/omron-build/bin# ./omron_790IT_test 
Found 1 omron 790ITs
Opened omron 790IT
xomron_get_command_return: read_result_result -7 < zero
Device serial: ??sq?
omron_get_command_return: read_result_result -7 < zero
Device version: 

omron_get_command_return: read_result_result -7 < zero
AJR data count: 117
omron_get_command_return: read_result_result -7 < zero
omron_get_command_return: read_result_result -7 < zero

what can I do do deliver more diagnostics?

Compile issue on fedora 19

Hi,

I followed the instructions in README.asciidoc supplied with version 0.90.

Unfortunately the make process breaks;

$ make
[ 22%] Built target omron_SHARED
[ 44%] Built target omron_STATIC
[ 44%] Built target omron_DEPEND
Linking C executable ../bin/omron_720IT_test
/home/justin/opt/omron-build/lib/libomron.so: undefined reference to libusb_open' /home/justin/opt/omron-build/lib/libomron.so: undefined reference tolibusb_release_interface'
/home/justin/opt/omron-build/lib/libomron.so: undefined reference to libusb_detach_kernel_driver' /home/justin/opt/omron-build/lib/libomron.so: undefined reference tolibusb_close'
/home/justin/opt/omron-build/lib/libomron.so: undefined reference to libusb_get_device_list' /home/justin/opt/omron-build/lib/libomron.so: undefined reference tolibusb_kernel_driver_active'
/home/justin/opt/omron-build/lib/libomron.so: undefined reference to libusb_bulk_transfer' /home/justin/opt/omron-build/lib/libomron.so: undefined reference tolibusb_init'
/home/justin/opt/omron-build/lib/libomron.so: undefined reference to libusb_get_device_descriptor' /home/justin/opt/omron-build/lib/libomron.so: undefined reference tolibusb_free_device_list'
/home/justin/opt/omron-build/lib/libomron.so: undefined reference to libusb_claim_interface' /home/justin/opt/omron-build/lib/libomron.so: undefined reference tolibusb_control_transfer'
collect2: error: ld returned 1 exit status
make[2]: *** [bin/omron_720IT_test] Error 1
make[1]: *** [examples/CMakeFiles/omron_720IT_test.dir/all] Error 2
make: *** [all] Error 2

Maybe something to do with the libusb version used which is supplied in Fedora 19.

$ rpm -qa |grep libusb
libusb-0.1.5-2.fc19.x86_64
libusbx-1.0.16-3.fc19.x86_64
libusbx-devel-1.0.16-3.fc19.x86_64
libusb-devel-0.1.5-2.fc19.x86_64

Hope anyone can help me to get this compiled.

Thanks,

Gr, Justin

C# DLLImports for omron.h

Hey there,

A while back I tried getting this to port to C# so I can access my 790/M10-IT?

I managed to get my own code working but I'm now looking to improve on it and make it more stable. Your code works great using C/C++, but I need to use it in C#.

Using the omron.dll that's created when building the project that cmake creates, I have created my own DLLImports but it's not working as expected and unfortunately, my PInvoke generator is moaning on about missing header files.

Apparently in cmake you can create the correct output but that fails for me as well.

Could you take a look at my class and see where I'm going wrong?

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;

namespace OmronLibTest
{
    class DLLWrapper
    {
    public struct omron_device_impl
    {
        public IntPtr _dev;
        public int _is_open;
        public int _is_inited;
    }

    public const int OMRON_VID = 0x0590;
    public const int OMRON_PID = 0x0028;

    public const int OMRON_OUT_ENDPT = 0x02;
    public const int OMRON_IN_ENDPT = 0x81;

    public enum omron_mode
    {
        NULL_MODE = 0x0000,
        DEVICE_INFO_MODE = 0x1111,
        DAILY_INFO_MODE = 0x74bc,
        WEEKLY_INFO_MODE = 0x1074,
        PEDOMETER_MODE = 0x0102
    }

    public struct omron_device
    {
        public omron_device_impl device;
        public omron_mode device_mode;
    }

    public struct omron_device_info
    {
        public byte[] version;
        public byte[] prf;
        public byte[] srl;
    }

    public struct omron_bp_day_info
    {
        public string day;
        public string month;
        public string year;
        public string hour;
        public string minute;
        public string second;
        public byte[] unknown_1;
        public string sys;
        public string dia;
        public string pulse;
        public byte[] unknown_2;
        public byte present;
    }

    public struct omron_bp_week_info
    {
        public byte unknown_1;
        public byte unknown_2;
        public string year;
        public string month;
        public string day;
        public byte unknown_3;
        public int sys;
        public int dia;
        public int pulse;
        public byte present;
    }

    public struct omron_pd_profile_info
    {
        public byte[] unknown_1;
        public string weight;
        public string stride;
        public byte[] unknown_2;
    }

    public struct omron_pd_count_info
    {
        public int daily_count;
        public int hourly_count;
        public byte unknown_1;
    }

    public struct omron_pd_daily_data
    {
        public int total_steps;
        public int total_aerobic_steps;
        public int total_walking_time;
        public int total_calories;
        public float total_distance;
        public float total_fat_burn;
        public int day_serial;
        public byte unknown_1;
    }

    public struct omron_pd_hourly_data
    {
        public int day_serial;
        public int hour_serial;
        public byte is_attached;
        public int regular_steps;
        public int aerobic_steps;
    }


    [DllImport("omron.dll")]
    public static extern omron_device omron_create();

    [DllImport("omron.dll")]
    public static extern void omron_delete(omron_device dev);

    [DllImport("omron.dll")]
    public static extern int omron_get_count(omron_device dev, int VID, int PID);

    [DllImport("omron.dll")]
    public static extern int omron_open(omron_device dev, int VID, int PID, UInt32 device_index);

    [DllImport("omron.dll")]
    public static extern int omron_close(omron_device dev);

    [DllImport("omron.dll")]
    public static extern int omron_set_mode(omron_device dev, omron_mode mode);

    [DllImport("omron.dll")]
    public static extern int omron_read_data(omron_device dev, ref byte[] input_report);

    [DllImport("omron.dll")]
    public static extern int omron_write_data(omron_device dev, ref byte[] output_report);

    [DllImport("omron.dll")]
    public static extern int omron_get_device_serial(omron_device dev, ref byte[] data);

    [DllImport("omron.dll")]
    public static extern int omron_get_device_version(omron_device dev, ref byte[] data);

    [DllImport("omron.dll")]
    public static extern int omron_get_bp_profile(omron_device dev, ref byte[] data);

    [DllImport("omron.dll")]
    public static extern omron_bp_day_info omron_get_daily_bp_data(omron_device dev, int bank, int index);

    [DllImport("omron.dll")]
    public static extern omron_bp_week_info omron_get_weekly_bp_data(omron_device dev, int bank, int index, int evening);

    [DllImport("omron.dll")]
    public static extern omron_pd_profile_info omron_get_pd_profile(omron_device dev);

    [DllImport("omron.dll")]
    public static extern omron_pd_count_info omron_get_pd_data_count(omron_device dev);

    [DllImport("omron.dll")]
    public static extern int omron_get_daily_data_count(omron_device dev, int bank);

    [DllImport("omron.dll")]
    public static extern omron_pd_daily_data omron_get_pd_daily_data(omron_device dev, int day);

    [DllImport("omron.dll")]
    public static extern omron_pd_hourly_data omron_get_pd_hourly_data(omron_device dev, int day);
    }
}

Below is the code i'm using to call the above class/code.

DLLWrapper.omron_device dev = DLLWrapper.omron_create();
int ret;
byte[] version = new byte[30];
byte[] prf = new byte[30];

ret = DLLWrapper.omron_get_count(dev, DLLWrapper.OMRON_VID, DLLWrapper.OMRON_PID);
if (ret == 0)
{
    MessageBox.Show("Please ensure you have the device connected!");
    return;
}
ret = DLLWrapper.omron_open(dev, DLLWrapper.OMRON_VID, DLLWrapper.OMRON_PID, 0);
if (ret < 0)
{
    MessageBox.Show("Failed to connect to the device!");
    return;
}
ret = DLLWrapper.omron_get_device_version(dev, ref version);
if (ret < 0)
{
    MessageBox.Show("Failed to get the device version!");
    return;
}
ret = DLLWrapper.omron_get_bp_profile(dev, ref prf);
if (ret < 0)
{
    MessageBox.Show("Failed to get the device profile!");
    return;
}
ret = DLLWrapper.omron_get_daily_data_count(dev, (radioButton1.Checked ? 0 : 1));
if (ret < 0)
{
    MessageBox.Show("There was an issue getting the data from the device!");
    return;
}
for (int i = ret - 1; i >= 0; i--)
{
    DLLWrapper.omron_bp_day_info data = DLLWrapper.omron_get_daily_bp_data(dev, (radioButton1.Checked ? 0 : 1), i);
    if (data.present == null)
    {
        i = i + 1;
        continue;
    }
    listBox1.Items.Add(string.Format("{0}/{1}/20{2} {3}:{4}:{5} SYS: {6} DIA: {7} PULSE: {8}", data.day, data.month, data.year, data.hour, data.minute, data.second, data.sys, data.dia, data.pulse));
}
ret = DLLWrapper.omron_close(dev);

omron_get_count seems to already return 0, even though it works fine using your 790 test app.

Any ideas?

Cheers

Gavin

Couldn't get it to work

Hi.

I have followed the instructions for building with brettviren fork. I am running into a few issues. I have copied the steps and results in the following. Any help is greatly appreciated. I am running on Ubuntu 10.4 and it seems both usb-1.0 and usb-0.1 are installed.

Here is the log:

prodea@prodea-laptop:~/opt/omron-build$ cmake /git/libomron
-- Using compily_buildd git submodule /home/prodea/git/libomron/compily_buildd/cmake
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- BUILDSYS_BUILD_PLATFORM variable not set. (Just a warning, you can probably ignore this.)
-- BUILDSYS_BUILD_DIR variable not set. (Just a warning, you can probably ignore this.)
-- No build type specified, using default: Release
-- Force 32 bit NOT AVAILABLE - Already on a 32 bit platform
-- Install Directory Prefix: /usr/local
-- Include Install Directory: /usr/local/include
-- Library Install Directory: /usr/local/lib
-- Runtime Install Directory: /usr/local/bin
-- Building Static Libraries for LIBOMRON
-- Found PythonLibs: /usr/lib/libpython2.6.so
-- Configuring done
-- Generating done
-- Build files have been written to: /home/prodea/opt/omron-build
prodea@prodea-laptop:
/opt/omron-build$

prodea@prodea-laptop:/opt/omron-build$ make
Scanning dependencies of target omron_STATIC
[ 14%] Building C object src/CMakeFiles/omron_STATIC.dir/omron.c.o
/home/prodea/git/libomron/src/omron.c: In function ‘omron_exchange_cmd’:
/home/prodea/git/libomron/src/omron.c:256: warning: incompatible implicit declaration of built-in function ‘exit’
[ 28%] Building C object src/CMakeFiles/omron_STATIC.dir/omron_usbfs.c.o
/home/prodea/git/libomron/src/omron_usbfs.c: In function ‘omron_open’:
/home/prodea/git/libomron/src/omron_usbfs.c:73: warning: assignment makes pointer from integer without a cast
/home/prodea/git/libomron/src/omron_usbfs.c: In function ‘omron_set_mode’:
/home/prodea/git/libomron/src/omron_usbfs.c:132: warning: incompatible implicit declaration of built-in function ‘exit’
/home/prodea/git/libomron/src/omron_usbfs.c: In function ‘omron_read_data’:
/home/prodea/git/libomron/src/omron_usbfs.c:151: warning: incompatible implicit declaration of built-in function ‘exit’
/home/prodea/git/libomron/src/omron_usbfs.c:174:25: warning: null character(s) ignored
/home/prodea/git/libomron/src/omron_usbfs.c: In function ‘omron_write_data’:
/home/prodea/git/libomron/src/omron_usbfs.c:204: warning: incompatible implicit declaration of built-in function ‘exit’
Linking C static library ../lib/libomron.a
[ 28%] Built target omron_STATIC
Scanning dependencies of target omron_790IT_test
[ 42%] Building C object examples/omron_790IT_test/CMakeFiles/omron_790IT_test.dir/omron_790IT_test.c.o
Linking C executable ../../bin/omron_790IT_test
[ 42%] Built target omron_790IT_test
Scanning dependencies of target omron_720IT_test
[ 57%] Building C object examples/omron_720IT_test/CMakeFiles/omron_720IT_test.dir/omron_720IT_test.c.o
Linking C executable ../../bin/omron_720IT_test
[ 57%] Built target omron_720IT_test
[ 71%] Swig source
Scanning dependencies of target _omron
[ 85%] Building CXX object swig/CMakeFiles/_omron.dir/omronPYTHON_wrap.cxx.o
[100%] Building CXX object swig/CMakeFiles/_omron.dir/Omron.cxx.o
Linking CXX shared module ../lib/_omron.so
[100%] Built target _omron
prodea@prodea-laptop:
/opt/omron-build$

prodea@prodea-laptop:/opt/omron-build$ make DESTDIR=/opt/omron install
[ 28%] Built target omron_STATIC
[ 42%] Built target omron_790IT_test
[ 57%] Built target omron_720IT_test
[100%] Built target _omron
Install the project...
-- Install configuration: "Release"
-- Installing: /home/prodea/opt/omron/usr/local/lib/libomron.a
-- Installing: /home/prodea/opt/omron/usr/local/bin/omron_790IT_test
-- Removed runtime path from "/home/prodea/opt/omron/usr/local/bin/omron_790IT_test"
-- Installing: /home/prodea/opt/omron/usr/local/bin/omron_720IT_test
-- Removed runtime path from "/home/prodea/opt/omron/usr/local/bin/omron_720IT_test"
-- Installing: /home/prodea/opt/omron/usr/local/python/omron/omron.py
CMake Error at swig/cmake_install.cmake:36 (FILE):
file INSTALL cannot find "/home/prodea/opt/omron-build/swig/_omron.so".
Call Stack (most recent call first):
cmake_install.cmake:39 (INCLUDE)

make: *** [install] Error 1


At this point, despite the above failure, I tried to run the test program to see what I can get: (switched to root user to avoid read/write permission issues)

root@prodea-laptop:/home/prodea/opt/omron/usr/local/bin# lsusb
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 004: ID 0590:0028 Omron Corp. HJ-720IT Pedometer
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 006: ID 045e:0040 Microsoft Corp. Wheel Mouse Optical
Bus 001 Device 005: ID 413c:2003 Dell Computer Corp. Keyboard
Bus 001 Device 004: ID 413c:0058 Dell Computer Corp. Port Replicator
Bus 001 Device 002: ID 413c:a005 Dell Computer Corp. Internal 2.0 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

root@prodea-laptop:/home/prodea/opt/omron/usr/local/bin# export OMRON_DEV=/dev/bus/usb/003/004
root@prodea-laptop:/home/prodea/opt/omron/usr/local/bin# ./omron_790IT_test
Found 1 omron 790ITs
omron_open USBDEVFS_CLAIMINTERFACE: No such file or directory
omron_set_mode USBDEVFS_CONTROL: No route to host

How to compile for Windows?

Greetings.

I am an old timer compiling applications for Linux but just got started with Windows. I had zero problems compiling libomron under Linux.

I am stuck on figuring out to compile a libomron DLL for Windows. I have download libomron, cmake, and WinDDK. When I ran cmake to create the makefile for Windows, I didn't see an option for WinDDK.

Can someone be so kind and tell me the step-by-step instructions on how to compile a libomron DLL? Am I missing something else I need?

Thank you for your help in my first venture on creating DLL under Windows.

Sincerely,

jdancer
'old timer' under Linux

Frequent data read problem

I have an HEM-670IT that I am trying to talk to. While I sometimes can read the data correctly, most of the time I get failures at various steps. Consider these 2 sessions:

[root@localhost build]# ./bin/omron_790IT_test
Found 1 omron 790ITs
Opened omron 790IT
omron_get_command_return: read_result_result -7 < zero
Device serial: M604
omron_get_command_return: read_result_result -7 < zero
Device version: 0010
^C

[root@localhost build]# ./bin/omron_790IT_test
Found 1 omron 790ITs
Opened omron 790IT
omron_get_command_return: read_result_result -7 < zero
Device serial: M604
omron_get_command_return: read_result_result -7 < zero
Device version: 0010
AJR data count: 2
10/08/2011 23:16:38 SYS: 120 DIA: 69 PULSE: 59
omron_get_command_return: read_result_result -7 < zero
11/08/2011 09:16:00 SYS: 0 DIA: 0 PULSE: 0
Weekly info:
Morning[0 07/08/2011] = sys:138 dia:85 pulse:59.
omron_790IT_test: /opt/zope/cipherhealth/packages/cipher.device/libomron-trunk/src/omron.c:190: omron_get_command_return: Assertion `current_read_size <= size - total_read_size' failed.
Aborted

As you can see, I frequently read less data than expected. When connecting the USB cable to Linux, I get the following output:

Aug 11 09:32:54 localhost kernel: usb 2-1.2: new full speed USB device using ehci_hcd and address 24
Aug 11 09:32:54 localhost kernel: usb 2-1.2: New USB device found, idVendor=0590, idProduct=0028
Aug 11 09:32:54 localhost kernel: usb 2-1.2: New USB device strings: Mfr=1, Product=3, SerialNumber=0
Aug 11 09:32:54 localhost kernel: usb 2-1.2: Product: HHX-CABLE-USB1
Aug 11 09:32:54 localhost kernel: usb 2-1.2: Manufacturer: OMRON Corporation
Aug 11 09:32:54 localhost kernel: generic-usb 0003:0590:0028.000E: hiddev0,hidraw0: USB HID v1.10 Device [OMRON Corporation HHX-CABLE-USB1] on usb-0000:00:1d.0-1.2/input0

But the Omron documentation states that it does not follow the standard HID protocol, so I wonder whether the Linux driver is getting in the way.

Has anyone had similar problems?

Implement Wakeup/Sync Command

The windows software can automatically kick off a sync via software. Add this command to the library so we can have automatic sync without manual start.

Unknown CMake Command "BUILDSYS_BUILD_LIB"

I saw others have this issue, but I'm not sure if their solutions would be the same for me.

I'm developing on a Windows XP machine. I downloaded the libomron-0.9.0 package and have that extracted. I also installed all of the required components (WDK, CMake). I follow the instructions provided at http://sourceforge.net/projects/nplabs/files/libomron/0.9.0/ but am getting the above mentioned problem.

Are there further instructions besides those provided at the link?

I don't have git configured on the machine I'm developing on, but would those steps assist me in solving this issue? Or is there something in the ZIP file I didn't catch?

Thanks.

-Josh

Support for M500IT possible?

Hi,

tried to access my new blood pressure device M500IT via libomron under debian but without success so far:

omron_get_command_return: read_result_result -7 < zero
omron_get_command_return: read_result_result -8 < zero

Output from lsusb:

Bus 002 Device 004: ID 0590:0090 Omron Corp.
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x0590 Omron Corp.
idProduct 0x0090
bcdDevice 2.02
iManufacturer 1 OMRON Corporation
iProduct 2 OMRON Blood pressure monitor
iSerial 3 xxxxxxxxxx
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 41
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xc0
Self Powered
MaxPower 100mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 3 Human Interface Device
bInterfaceSubClass 0 No Subclass
bInterfaceProtocol 0 None
iInterface 0
HID Device Descriptor:
bLength 9
bDescriptorType 33
bcdHID 1.01
bCountryCode 0 Not supported
bNumDescriptors 1
bDescriptorType 34 Report
wDescriptorLength 53
Report Descriptor: (length is 53)
Item(Global): Usage Page, data= [ 0x00 0xff ] 65280
(null)
Item(Local ): Usage, data= [ 0x01 ] 1
(null)
Item(Main ): Collection, data= [ 0x01 ] 1
Application
Item(Global): Report ID, data= [ 0x01 ] 1
Item(Global): Report Count, data= [ 0x3f ] 63
Item(Global): Report Size, data= [ 0x08 ] 8
Item(Global): Logical Maximum, data= [ 0xff 0x00 ] 255
Item(Global): Logical Minimum, data= [ 0x00 ] 0
Item(Local ): Usage, data= [ 0x01 ] 1
(null)
Item(Main ): Input, data= [ 0x02 ] 2
Data Variable Absolute No_Wrap Linear
Preferred_State No_Null_Position Non_Volatile Bitfield
Item(Global): Report ID, data= [ 0x02 ] 2
Item(Global): Report Count, data= [ 0x3f ] 63
Item(Global): Report Size, data= [ 0x08 ] 8
Item(Global): Logical Maximum, data= [ 0xff 0x00 ] 255
Item(Global): Logical Minimum, data= [ 0x00 ] 0
Item(Local ): Usage, data= [ 0x01 ] 1
(null)
Item(Main ): Output, data= [ 0x02 ] 2
Data Variable Absolute No_Wrap Linear
Preferred_State No_Null_Position Non_Volatile Bitfield
Item(Global): Report ID, data= [ 0x03 ] 3
Item(Global): Report Count, data= [ 0x08 ] 8
Item(Global): Report Size, data= [ 0x08 ] 8
Item(Global): Logical Maximum, data= [ 0xff 0x00 ] 255
Item(Global): Logical Minimum, data= [ 0x00 ] 0
Item(Local ): Usage, data= [ 0x01 ] 1
(null)
Item(Main ): Feature, data= [ 0x02 ] 2
Data Variable Absolute No_Wrap Linear
Preferred_State No_Null_Position Non_Volatile Bitfield
Item(Main ): End Collection, data=none
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 1
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x01 EP 1 OUT
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 1
Device Status: 0x0000
(Bus Powered)

I changed the OMRON_PID from 0x0028 to 0x0090 and the OMRON_OUT_ENDPT from 0x02 to 0x01 according to the infos above.

Can anybody please help me with this?

I would like to code an open source app with Qt5 for WIN/LIN/OSX so users don't need to upload their health data to the cloud via Bi-Link...

Thank you, Thomas

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.