Serial port access from FreeBSD

Hi,

Good news!

I managed to get it to work with the 1.8.0 sources from yesterday. The trick to recompile, and this should really be documented somewhere, is to always make clean before rebuilding. This seems to be the case both on FreeBSD and Linux. I’m not sure how the openhab developers are not going crazy doing this (takes almost 10 minutes on my system to clean and rebuild everything), so I’m guessing/hoping! that there is some trick to it that I have not yet found.

Be that as it may, applying Jan-Willem Spuij’s patches, rebuilding nrjavaserial with it, copying the library to bundles/io/org.openhab.io.transport.serial/lib/ and then doing mvn clean package does rebuild everything and results in a working distribution.

I’ll now look into making this into a port so we don’t have to muck about with this every time a new release comes out. Or even better, get the nrjavaserial guys to accept the patches and support FreeBSD out of the box.

For now here are more detailed instructions to do this yourself:

  1. Get the openHAB sources → extract them somewhere, say OHSRC
  2. Get the nrjavaserial sources
  3. Apply the patches from the thread Redirecting to Google Groups
  4. Build nrjavaserial (basically do ‘make freebsd’)
  5. Get the resulting library (for version 3.11.0) from build/libs/nrjavaserial-3.11.0.jar and copy it to $(OHSRC)/bundles/io/org.openhab.io.transport.serial/lib/
  6. Change the version number in $(OHSRC)/bundles/io/org.openhab.io.transport.serial/build.properties and $(OHSRC)/bundles/io/org.openhab.io.transport.serial/META-INF/MANIFEST.MF
  7. cd $(OHSRC)
  8. mvn clean
  9. mvn package
  10. wait 10 minutes
  11. The new distribution files are in $(OHSRC)/distribution/target

Cheers,
Marc.