Win a copy of Java Persistence with Spring Data and Hibernate this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Jeanne Boyarsky
Saloon Keepers:
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Piet Souris
Bartenders:

I2C Library

 
Ranch Hand
Posts: 105
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am trying to read a chip register of the EM7028 sensor that has the I2C interface and am wondering if anybody knows a java library compatible with it (and android api 19)?

I have tried using:
I2C-tools
I2C Android Things
suapapa/i2c-tools
android-i2c-tool

But so far can not get it working.

Any ideas would be great,
Thanks!!
 
Bartender
Posts: 7488
171
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't know anything about this, but I do know that Android Things is dead - so don't spend any time evaluating it.
 
Marshal
Posts: 77532
372
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moving to our Android forum.
 
Saloon Keeper
Posts: 26733
190
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm afraid I would cheat and outsource the I2C work to something like an Arduino Leonardo connected to Android via serial USB myself. Most Android devices don't have much in the way of don't-void-the-warranty external hardware connections.  In fact, I might even go full wireless, which is what I did for the battery/temperature/humidity monitor I made for my solar charger cabinet (via BLE).

It's possible that you might have a way in via Python - I haven't heard much about Python on Android in recent times, but I seem to recall it was once a Thing. And there's a Python I2C library that works quite well on the Raspberry Pi at least.

It also depends on whether you have the I2C in question visible to Android as a full OS-supported /dev device or whether you're planning on doing raw peek-n-poke interfacing.
 
Glenda Karen
Ranch Hand
Posts: 105
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks so much!

I'm wondering how can I do something like

Tim Holloway wrote: go full wireless, which is what I did for the battery/temperature/humidity monitor I made for my solar charger cabinet (via BLE)

are there any libraries/resources you can recommend for doing this wireless?

Tim Holloway wrote:It's possible that you might have a way in via Python - I haven't heard much about Python on Android in recent times, but I seem to recall it was once a Thing. And there's a Python I2C library that works quite well on the Raspberry Pi at least.


Thank you, I started doing some exploration in to using python in android.

Tim Holloway wrote:It also depends on whether you have the I2C in question visible to Android as a full OS-supported /dev device or whether you're planning on doing raw peek-n-poke interfacing.


I'm not sure but seems like it is visible since we can see and access it from /dev
 
Tim Holloway
Saloon Keeper
Posts: 26733
190
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For Arduino, wireless is possible in many ways. The ESP8266 is a very inexpensive chip for WiFi and the HC series chips likewise for basic Bluetooth. Perhaps better, and not much more expensive (less, even counting total circuit cost and complexity) is the ESP-32, which is a very powerful processor on its own and has built-in WiFi and BLE. That's what my solar cabinet uses.

On the other hand, if you really can do the I2C inside your Android device, that's not required, since the wireless was just to get data from the I2C device into the Android device.

But do be careful. Many if not most Linux systems have their own I2C system buses which generally aren't available for third-party peripherals. So you want to be sure that you're talking to the correct /dev/i2c-x device!
 
Glenda Karen
Ranch Hand
Posts: 105
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks so much!
 
You can't have everything. Where would you put it?
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
https://www.kickstarter.com/projects/paulwheaton/low-tech
reply
    Bookmark Topic Watch Topic
  • New Topic