rbghongade Well-Known Member Licensed User Longtime User Jan 19, 2016 #1 Dear friends, I came across this java library at http://hirt.se/blog/?p=493 . It gives access to the sensors connected to Raspberry pi GPIO pins. Devices include DHT11, DS18B20.... The jar file is available with the library. Is it possible to include the same in B4J ( maybe by using wrapper etc...) If so I request someone to create a B4J library. regards,
Dear friends, I came across this java library at http://hirt.se/blog/?p=493 . It gives access to the sensors connected to Raspberry pi GPIO pins. Devices include DHT11, DS18B20.... The jar file is available with the library. Is it possible to include the same in B4J ( maybe by using wrapper etc...) If so I request someone to create a B4J library. regards,
DonManfred Expert Licensed User Longtime User Jan 19, 2016 #2 rbghongade said: by using wrapper Click to expand... Seems to be possible with a small wrapper. But i´m not sure if you can add .so files with a b4j library... With Android you can if they are the right ones I do not have an raspPI, sorry. Just looked shortly above the code and the downloadable archive Last edited: Jan 19, 2016 Upvote 0
rbghongade said: by using wrapper Click to expand... Seems to be possible with a small wrapper. But i´m not sure if you can add .so files with a b4j library... With Android you can if they are the right ones I do not have an raspPI, sorry. Just looked shortly above the code and the downloadable archive
Cableguy Expert Licensed User Longtime User Jan 19, 2016 #3 If this means no more need to read the logged values from a file, +1! Upvote 0
rbghongade Well-Known Member Licensed User Longtime User Jan 20, 2016 #4 @Erel, how to embed this library in B4J? Please suggest. Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Jan 20, 2016 #5 There is no special problem with creating a wrapper for this library. The so file is loaded in DHTSensor: Code: Copy static { System.loadLibrary("dht"); } The simplest way to solve the configuration issues is to copy the so file from the jar file to File.DirTemp or any other folder and then load it with System.load instead of loadLibrary. System.load allows you to explicitly set the file name. Upvote 0
There is no special problem with creating a wrapper for this library. The so file is loaded in DHTSensor: Code: Copy static { System.loadLibrary("dht"); } The simplest way to solve the configuration issues is to copy the so file from the jar file to File.DirTemp or any other folder and then load it with System.load instead of loadLibrary. System.load allows you to explicitly set the file name.
rbghongade Well-Known Member Licensed User Longtime User Jan 20, 2016 #6 Dear Erel, I am still unable to understand the wrapping and usage of the library. Can you please elaborate it? sorry to bother you again, Upvote 0
Dear Erel, I am still unable to understand the wrapping and usage of the library. Can you please elaborate it? sorry to bother you again,
Erel B4X founder Staff member Licensed User Longtime User Jan 20, 2016 #7 @DonManfred was not sure whether it is possible to wrap this library as it loads a native library. I answered that it is possible and explained how it can be done. In order to wrap this library you will need some Java knowledge. Upvote 0
@DonManfred was not sure whether it is possible to wrap this library as it loads a native library. I answered that it is possible and explained how it can be done. In order to wrap this library you will need some Java knowledge.
Cableguy Expert Licensed User Longtime User Jan 21, 2016 #8 Erel said: @DonManfred was not sure whether it is possible to wrap this library as it loads a native library. I answered that it is possible and explained how it can be done. In order to wrap this library you will need some Java knowledge. Click to expand... Will @DonManfred Come to the rescue?? Upvote 0
Erel said: @DonManfred was not sure whether it is possible to wrap this library as it loads a native library. I answered that it is possible and explained how it can be done. In order to wrap this library you will need some Java knowledge. Click to expand... Will @DonManfred Come to the rescue??
DonManfred Expert Licensed User Longtime User Jan 21, 2016 #9 I saw Erels answer and i got the message in it (how it works) and i´m positive it will work. maybe i´ll do a wrap... Just a bit timeless these days (lot of work, other projects i´m working on) Edit: The only problem i have is not to have any RaspPI to test it... Upvote 0
I saw Erels answer and i got the message in it (how it works) and i´m positive it will work. maybe i´ll do a wrap... Just a bit timeless these days (lot of work, other projects i´m working on) Edit: The only problem i have is not to have any RaspPI to test it...
Siam Active Member Licensed User Longtime User Jan 22, 2016 #10 Edit: The only problem i have is not to have any RaspPI to test it... Click to expand... if this is the only problem maybe i can help! Upvote 0
Edit: The only problem i have is not to have any RaspPI to test it... Click to expand... if this is the only problem maybe i can help!