masoric
Posts: 2
Joined: Mon Aug 27, 2018 7:26 pm

Adafruit Python Sensor Library in Java

Mon Aug 27, 2018 7:31 pm

Good Afternoon,

I was just curious if anyone was using the Adafruit Python Sensor library from within a Java application. If so what was the best mechanism to make it work? I have much more experience with .net programming than with Java or Py so my apologies if this is a basic question.

Specifically I am trying to use the DHT sensory library to pull the Temp and Humidity into the Java app.

dht.read_retry(dht.DHT22, 4)

Any pointers would be appreciated.

Regards

masoric
Posts: 2
Joined: Mon Aug 27, 2018 7:26 pm

Re: Adafruit Python Sensor Library in Java

Wed Aug 29, 2018 1:28 pm

I ended up caving in and used python to read the value and update the DB.

static916
Posts: 2
Joined: Tue Oct 16, 2018 10:37 pm

Re: Adafruit Python Sensor Library in Java

Tue Oct 16, 2018 10:50 pm

I had issues with Pi4J and the DHT11/22 but found code here that made it sometimes work: https://stackoverflow.com/questions/284 ... using-pi4j

Finally I ended up updating to the latest build of Raspian and Pi4J and the comments in stackoverflow and the code ended being 80% reliable. Which made it that I'd take several samples and average them out.

Best of luck!

Return to “Java”

Who is online

Users browsing this forum: No registered users and 2 guests