piff
Posts: 10
Joined: Mon Jun 23, 2014 1:59 pm

Using windows software

Mon Jun 23, 2014 2:06 pm

Hi,

I am new to this, and 0 level linux programmer. I am involved in this project that implies connecting an Omron R7 BPM( Blood Pressure Monitor) to a Rpi , get data from it, and send it through e-mail.

We got the auto e-mail sending sorted almost, but. the biggest problem is that R7 only provides data to the host ( PC) when you click the "Download Data" button in it's software, which is only supported on windows.

Is there a way I can achieve this using an emulator, and without having to go through all USB packets?
If I have to program something (making the pi "asking" for data from the R7) how should it look like?

drgeoff
Posts: 9816
Joined: Wed Jan 25, 2012 6:39 pm

Re: Using windows software

Mon Jun 23, 2014 6:05 pm

No you cannot run Windows software natively on a RPi. The ARM processor in the RPi has a completely different instruction set from an x86 processor in a Wintel PC.

In theory, an emulator could be written but it would probably run horribly slowly (if at all) and the USB handling would need very special attention given that some of the stack that is typically implemented in hardware is done in software on the RPi.

Have you tried approaching Omron for the necessary low level information to interface using Linux?

piff
Posts: 10
Joined: Mon Jun 23, 2014 1:59 pm

Re: Using windows software

Mon Jun 23, 2014 9:31 pm

I did not. Didn't know that was an option. But you're right, i will try contacting them.

Meanwhile I found something named libomron for python, but as I said , I have no idea ( yet, i hope) how to program this...



So, is there a way in which I can make my Rpi ask for the packets on the BPM? and the Rpi actually being able to make readable data/values from them?

Thanks

User avatar
FLYFISH TECHNOLOGIES
Posts: 1750
Joined: Thu Oct 03, 2013 7:48 am
Location: Ljubljana, Slovenia
Contact: Website

Re: Using windows software

Mon Jun 23, 2014 10:19 pm

Hi,
piff wrote:I did not. Didn't know that was an option. But you're right, i will try contacting them.
I see the following possibilities:
a) Omron sends you Linux app code... good, case almost closed. :-)
b) Omron doesn't support Linux, but is willing to give you the product's USB protocol specification... good, you have data for implementation.
c) Omron ignores you, the specification is company confidential... you're in troubles.

According to your 0 level knowledge, options b) could be something you can try to do. Be brave. :-) If you invest some time, you can get results probably in few weeks of learning, investigations and trying this and that.
Option c) is really advanced one, since reverse engineering would be needed (capturing and analyzing USB communication on working Windows system, some dedicated equipment is also needed).

Be aware that options b) and c) are not a minor afternoon task.
If Omron doesn't give you usable data and you'd really (I mean really really) like to have this implemented on RasPi, then hire somebody to do this work.
piff wrote:So, is there a way in which I can make my Rpi ask for the packets on the BPM? and the Rpi actually being able to make readable data/values from them?
As mentioned, you need to get information how to do this (USB protocol specification of this product).


Best wishes, Ivan Zilic.
Running out of GPIO pins and/or need to read analog values?
Solution: http://www.flyfish-tech.com/FF32

ame
Posts: 3172
Joined: Sat Aug 18, 2012 1:21 am
Location: Korea

Re: Using windows software

Mon Jun 23, 2014 11:44 pm

piff wrote:I did not. Didn't know that was an option. But you're right, i will try contacting them.

Meanwhile I found something named libomron for python, but as I said , I have no idea ( yet, i hope) how to program this...



So, is there a way in which I can make my Rpi ask for the packets on the BPM? and the Rpi actually being able to make readable data/values from them?

Thanks
If you're lucky the Omron USB device will simply be a USB->serial converter. Take a look at /var/log/messages and see what appears when you plug in the device.

johndough
Posts: 254
Joined: Sun Jan 13, 2013 2:00 pm

Re: Using windows software

Tue Jun 24, 2014 6:49 am

IBPCapture

piff
Posts: 10
Joined: Mon Jun 23, 2014 1:59 pm

Re: Using windows software

Tue Jun 24, 2014 9:23 am

johndough wrote:IBPCapture

what's this? couldn't find anything linux related about this

ame
Posts: 3172
Joined: Sat Aug 18, 2012 1:21 am
Location: Korea

Re: Using windows software

Tue Jun 24, 2014 9:27 am

piff wrote:
johndough wrote:IBPCapture

what's this? couldn't find anything linux related about this
Maybe he means this, for an iPhone (or iPad, remember them?):
http://appsforgrownups.com/2011/09/10/i ... od-health/

Whatever it is, score -1: Unhelpful

fruitoftheloom
Posts: 20755
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: Using windows software

Tue Jun 24, 2014 9:30 am

piff wrote:
johndough wrote:IBPCapture

what's this? couldn't find anything linux related about this
IBPCapture is an Apple Mac App, therefore pretty useless with Debian

https://itunes.apple.com/gb/app/ibpcapt ... 1876?mt=12
Retired disgracefully.....

User avatar
DougieLawson
Posts: 36163
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Using windows software

Tue Jun 24, 2014 9:32 am

piff wrote:
johndough wrote:IBPCapture

what's this? couldn't find anything linux related about this
Looks like an app for OSX/iPhone/iPad/Mac. It's a complete mystery why John posted that non-sequitur.

If you're a complete masochist you could try capturing USB packets on Windows with http://desowin.org/usbpcap/ then workout what sequence of commands are needed to activate your Omron BP monitor, connect and read the data.

Python has good support with PyUSB (uses libusb) to read and write to any USB device.

The first stage is to plug in your Omron device then use lsusb to see how it appears and what Linux USB driver is selected for it. For example, if it appears as a serial device you may be able to use PySerial to talk to it.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

piff
Posts: 10
Joined: Mon Jun 23, 2014 1:59 pm

Re: Using windows software

Tue Jun 24, 2014 9:37 am

ok i've left the part with data aquisition to the side for the moment.

I have problems even sending an e-mail and i tried in 2 ways it's been 7 hrs of continous debugging and trying to figure out how this thing works.

First way:
using python: i get an error message saying that there is no module named MimeMultipart - i used IDLE3 for compiling
using the Terminal: i only get a paniclog error in exim4 regarding the fact it is unable to create ipv6 socket. Tried to disable it in many ways ( actually 2 :D) still doesn't work....

Is there a noob/stupid/retard proof way to run a script that sends e-mails?

ame
Posts: 3172
Joined: Sat Aug 18, 2012 1:21 am
Location: Korea

Re: Using windows software

Tue Jun 24, 2014 9:54 am

piff wrote:ok i've left the part with data aquisition to the side for the moment.

I have problems even sending an e-mail and i tried in 2 ways it's been 7 hrs of continous debugging and trying to figure out how this thing works.

First way:
using python: i get an error message saying that there is no module named MimeMultipart - i used IDLE3 for compiling
using the Terminal: i only get a paniclog error in exim4 regarding the fact it is unable to create ipv6 socket. Tried to disable it in many ways ( actually 2 :D) still doesn't work....

Is there a noob/stupid/retard proof way to run a script that sends e-mails?
Here's a fairly reasonable guide:
http://www.pythonforbeginners.com/code- ... send-email

I assume you are using gmail, but you could do it with any mail service provider. Your problem may be that you are trying to send email via localhost, and you probably don't have a mail server running locally.

piff
Posts: 10
Joined: Mon Jun 23, 2014 1:59 pm

Re: Using windows software

Tue Jun 24, 2014 12:12 pm

I configured exim 4 using the second option - mail through smtp / fetch mail , not localhost.

Using exim4 raises an error in paniclog - it cannot start ipv6 socket. I don't really want to use it. and it seems it can't be disabled...

User avatar
Richard-TX
Posts: 1549
Joined: Tue May 28, 2013 3:24 pm
Location: North Texas

Re: Using windows software

Tue Jun 24, 2014 12:19 pm

Take out the ipv6 addrs in /etc/hosts.

I use exim all the time. Works good.
Richard
Doing Unix since 1985.
The 9-25-2013 image of Wheezy can be found at:
http://downloads.raspberrypi.org/raspbian/images/raspbian-2013-09-27/2013-09-25-wheezy-raspbian.zip

ame
Posts: 3172
Joined: Sat Aug 18, 2012 1:21 am
Location: Korea

Re: Using windows software

Tue Jun 24, 2014 12:22 pm

piff wrote:I configured exim 4 using the second option - mail through smtp / fetch mail , not localhost.

Using exim4 raises an error in paniclog - it cannot start ipv6 socket. I don't really want to use it. and it seems it can't be disabled...
Why are you using exim? You should be able to use SMTP directly to gmail or your ISP's mail server.

piff
Posts: 10
Joined: Mon Jun 23, 2014 1:59 pm

Re: Using windows software

Tue Jun 24, 2014 12:27 pm

I can find /etc/hosts.deny is this the file? i can't find any file or folder named hosts ...

BMS Doug
Posts: 3824
Joined: Thu Mar 27, 2014 2:42 pm
Location: London, UK

Re: Using windows software

Tue Jun 24, 2014 12:30 pm

The Libomron that you mentioned finding should do most of the work for you.
libomron is an open source, cross platform driver for the USB accessible versions of Omron Medical products, such as the 790-IT Blood Pressure Monitor, 670-IT Blood Pressure Monitor and HJ-720ITC Pedometer (Pedometer support coming soon).

The driver gives data download access to the device, allowing developers to serialized to the format of the their choice.
Doug.
Building Management Systems Engineer.

johndough
Posts: 254
Joined: Sun Jan 13, 2013 2:00 pm

Re: Using windows software

Tue Jun 24, 2014 12:56 pm

piff wrote:
johndough wrote:IBPCapture

what's this? couldn't find anything linux related about this
Hi

I found it as suitable for mac.

If it is, then linux is generally Posix compliant as is some apple stuff, therefore there is a good chance it will work.

##########################
Fully POSIX-compliant

Some versions of the following operating systems conform (i.e., are 100% compliant) to one or more of the various POSIX standards.
LynxOS
OS X Mavericks
QNX
Solaris
Tru64
UnixWare

Mostly POSIX-compliant The following, while not officially certified as POSIX compatible, comply in large part:

BeOS (and subsequently Haiku)
FreeBSD
Contiki
Darwin (core of OS X and iOS)
illumos
Linux (most distributions — see Linux Standard Base)
MINIX (now MINIX3)
NetBSD
Nucleus RTOS
OpenBSD
OpenSolaris

POSIX for Windows Cygwin provides a largely POSIX-compliant development and run-time environment for Microsoft Windows.

ame
Posts: 3172
Joined: Sat Aug 18, 2012 1:21 am
Location: Korea

Re: Using windows software

Tue Jun 24, 2014 1:14 pm

johndough wrote:
piff wrote:
johndough wrote:IBPCapture

what's this? couldn't find anything linux related about this
Hi

I found it as suitable for mac.

If it is, then linux is generally Posix compliant as is some apple stuff, therefore there is a good chance it will work.
That's not how it works...

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 23698
Joined: Sat Jul 30, 2011 7:41 pm

Re: Using windows software

Tue Jun 24, 2014 1:50 pm

BMS Doug wrote:The Libomron that you mentioned finding should do most of the work for you.
libomron is an open source, cross platform driver for the USB accessible versions of Omron Medical products, such as the 790-IT Blood Pressure Monitor, 670-IT Blood Pressure Monitor and HJ-720ITC Pedometer (Pedometer support coming soon).

The driver gives data download access to the device, allowing developers to serialized to the format of the their choice.
libomron appears to have moved to here...

https://github.com/qdot/libomron
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

piff
Posts: 10
Joined: Mon Jun 23, 2014 1:59 pm

Re: Using windows software

Tue Jun 24, 2014 1:57 pm

Thanks, i already started to work on that piece, helped by one of my profs. Well actually he started :D :D

Regarding the other problem (auto mail sending) , I don't have this hosts file. Well i don't have it unless we're talking about hosts.deny , in which i can't seem to find any ipv6 adress bcs hosts.deny has only instructions in it, not really any settings.

What should i do to make the darn mail work already?

User avatar
DougieLawson
Posts: 36163
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Using windows software

Tue Jun 24, 2014 2:01 pm

Try this python script

Code: Select all

#!/usr/bin/python3
import time
from datetime import datetime
import smtplib
from email.mime.image import MIMEImage
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText

f_time = datetime.now().strftime('%a %d %b @ %H:%M')

domain = 'xxxx.myisp.co.uk' # redacted
toaddr = 'example@gmail.com'    # redacted
me = 'pi@' + domain
subject = 'Test email @ ' + f_time

msg = MIMEMultipart()
msg['Subject'] = subject
msg['From'] = me
msg['To'] = toaddr
msg.preamble = "Tester @ " + f_time

textforbody = "This is a test email from my Raspberry Pi"

stuff = MIMEText(textforbody, 'plain')
msg.attach(stuff)

try:
   s = smtplib.SMTP('localhost')
   s.send_message(msg)
   s.quit()
except:
   print ("Error: unable to send email")
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

piff
Posts: 10
Joined: Mon Jun 23, 2014 1:59 pm

Re: Using windows software

Tue Jun 24, 2014 8:13 pm

tried it, i don't have a domain so at the domain name i've put gmail.com. Idk if that's correct.
Well, still , i get the error :unable to send mail response at me running it.

User avatar
DougieLawson
Posts: 36163
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Using windows software

Tue Jun 24, 2014 8:49 pm

Use this code to find your domain

Code: Select all

#!/usr/bin/python3

from urllib.request import urlopen
import json
ip = urlopen('http://httpbin.org/ip').read()
ip = ip.decode('utf-8')
ip = json.loads(ip)

import socket
name, alias, addresslist = socket.gethostbyaddr(ip['origin'])
print (name)
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

piff
Posts: 10
Joined: Mon Jun 23, 2014 1:59 pm

Re: Using windows software

Tue Jun 24, 2014 9:29 pm

alright, found the domain.

replaced it in the code above, still the same error: unable to send mail message....

:(

Return to “Beginners”