pyjnius and usb to i2c on android

117 views
Skip to first unread message

PhotonHiker

unread,
Nov 28, 2015, 12:29:58 PM11/28/15
to Kivy users support
Has there been any thought put into a pyjnius implementation of the ftdi d2xx android java library for the ft-2232h chips?

I am trying to put together a daq for android to allow data collection in remote places. Android phones are great little devices that have enough computing power to do what I need - provided I can collect the data from analog outputs and i2c or spi enabled devices.

Simple is best for this application for a number of reasons including low power consumption so the ft-2232h combined with spi or i2c adc's and integrated sensors will yield what I need.

A kivy/python app and python development environment for field work is quite appealing. My java knowledge is limited, but growing and I'm willing to learn too so if you've got some place for me to start let me know. I've read through everything on the pyjnius.readthedocs. There isn't quite enough for me there to make sense of a next step...

Mark Melvin

unread,
Nov 29, 2015, 9:48:23 AM11/29/15
to kivy-...@googlegroups.com
Hi Justin,

I will be doing precisely what you describe very shortly. I have used the IOIO-OTG board to do this already, but from pure Java and a traditional Android app.  It wasn't that bad and might be a simpler "first pass" for you.  

I have since spun my own board using an FTDI chip and written the firmware for it. I used a USB-UART with a separate micro to translate the UART to I2C - not sure I would take that approach again.  I would likely just go for the 232H.  For some reason I thought I needed more flexibility on the other end of the protocol conversion.  Anyway, my plan is to use Kivy and write an app for both Windows and Android using this board.  I have not made it past a simple Python script to talk to the board outside of Kivy, but I certainly will share my experience as I go and would love to hear any ideas you have or progress you make.

What I am hoping is that we can take the C-based FTDI .dll and write a wrapper for it in Cython, and access that from Kivy directly.  No Java or pyjnius involved at all.  I have some experience wrapping things with Cython, and I know Kivy uses it. I'm certain I can make that workflow work on Windows - just not sure about the whole cross-compiling part of it to make it work on Android.  Hopefully this can all be done in Buildozer.  

If anyone has experience shoehorning their own Cython wrappers and C libraries into the Kivy workflow - that would certainly be useful to know about.

Mark.

--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages