Listen to serialport

370 views
Skip to first unread message

Medien Forscher

unread,
Jan 9, 2017, 5:15:44 PM1/9/17
to DroidScript
Hi
Is it possible to read from a serial usb port? I want to read data from a waterrower which can be connected via serial usb.

Thx!
Olivier

Steve Garman

unread,
Jan 9, 2017, 5:21:24 PM1/9/17
to DroidScript
You can read serial data from a USB but only if it supports USB OTG.

I don't think the Waterrower supports OTG

Message has been deleted

Medien Forscher

unread,
Jan 10, 2017, 3:59:53 AM1/10/17
to DroidScript
Thanks Dave! Can you point me to a code sample for reading serial data?

I only can find sample for writing to a device.

Thx!
Olivier

Medien Forscher

unread,
Jan 10, 2017, 2:47:23 PM1/10/17
to DroidScript
Sorry, again, Waterower outputs data via usb serial. Theres even a javascript library for it, but not for android:

https://github.com/jamesnesfield/node-waterrower

Would be cool to be able to get data into droidscript.
Best regards
Olivier

Steve Garman

unread,
Jan 11, 2017, 2:14:59 AM1/11/17
to DroidScript
As I said above,
I don't think the Waterrower supports OTG

That would probably be one reason they have not been able to offer Android support. 

Medien Forscher

unread,
Jan 11, 2017, 4:23:01 AM1/11/17
to DroidScript
Thanks for your response. I obviously didn't understand the technical problem of not supporting OTG by the sending device.

Thanks anyway and keep up the good work on droidscript.

Olivier

Charles Wilt

unread,
Jan 11, 2017, 7:22:24 AM1/11/17
to DroidScript
It would take an extra step but you could use a device like arduino or better yet an espruino. The espruino works as OTG and should be able to communicate with the waterrower. Acting as a relay or sorts.

Steve Garman

unread,
Jan 11, 2017, 7:32:49 AM1/11/17
to androi...@googlegroups.com
Charles,

Are you suggesting
  Waterrower>USB>Espruino>Bluetooth>phone
or some sort of dual USB solution?


I am not sure I understand the suggestion at all.

Medien Forscher

unread,
Jan 11, 2017, 11:57:51 AM1/11/17
to DroidScript
Thats what has been archived here:
https://github.com/olympum/waterrower-ble

I thought it may be possible to sniff the serial usb of the waterrower directly. I still wonder: has the sendig device also to support otg to get the data in?

Charles Wilt

unread,
Jan 11, 2017, 8:54:05 PM1/11/17
to DroidScript
Steve,

What little info I can find on the waterrower S4 says it has a micro USB port and the output is standard serial. Maybe I am missing something? Sure sounds like you should be able to use an OTG adapter on an android device with a standard USB to micro USB cable.

Perhaps use a tessel 2 using the NPM module that is available to create a web page with the waterrower information.

Since I have no way of testing these ideas the they are just speculation.

Medien Forscher

unread,
Jan 12, 2017, 3:33:33 PM1/12/17
to DroidScript
Thanks for your suggestions! Could this driver be integrated in a droidscript script?
https://github.com/mik3y/usb-serial-for-android

Thx again. Waterrower is a great machine but electronic remains in stone age...

Charles Wilt

unread,
Jan 12, 2017, 8:38:05 PM1/12/17
to DroidScript
I am not the developer but I would say no.

Dave Smart

unread,
Jan 14, 2017, 9:23:26 AM1/14/17
to androi...@googlegroups.com
DS already has a USB serial driver (based on that same library actually).  It should just work with an OTG cable (as long as your phone is new enough to support OTG)

Dave Smart

unread,
Jan 14, 2017, 9:30:27 AM1/14/17
to DroidScript
Use the 'USB Arduino' sample to read serial data.

Medien Forscher

unread,
Jan 17, 2017, 9:30:54 AM1/17/17
to DroidScript
Thanks Dave, I've tested it, no luck, no connection. Although waterrower sends cdc and I have a app from playstore which connects (but sees no data).

Is it possible to use a custom VID and PID? Usbterminal app says VID=0x04D8, PID=0x000A

Thx, if we get data in, maybe the result will be a nice app.
Olivier

Dave Smart

unread,
Jan 23, 2017, 6:53:13 PM1/23/17
to DroidScript
Hi Oliver,

I'll add those PID/VID values to the next beta release of DS for you and you can see if that works.

Are you sure those are the PID and VID for the waterrower?

Medien Forscher

unread,
Nov 27, 2018, 10:16:20 AM11/27/18
to DroidScript
Hi Dave, Im coming back to this topic. Yes these are the values.
Serial USB Terminal App connects via CDC and receives data. So it should be possible. I tested it today again and it did not work.

Medien Forscher

unread,
Dec 9, 2018, 9:21:05 AM12/9/18
to DroidScript
Sorry if Im asking again, would it be possible to implement VID=0x04D8, PID=0x000A in the next version?

Or take out the necessity for pid and vid out completely?

Thx!

Dave

unread,
Dec 14, 2018, 7:12:36 AM12/14/18
to DroidScript
Hi Medien,

Those PID and VID values are already in DS... been there for a while I think.

In the latest DS release, I have removed the PID check anyway: http://androidscript.org/alpha/DroidScript_169a3


Reply all
Reply to author
Forward
0 new messages