Bluetooth installation help

I am trying to install the bluetooth binding on my Raspberry Pi 3. The instructions seem quite complicated. I have succeeded in compiling bluecove-gpl-2.1.1-SNAPSHOT.jar and bluecove-2.1.1-SNAPSHOT.jar, but I do not know how to open META-INF/MANIFEST.MF nor can I identify any lib subdirectory of the binding. Could someone please help me with instructions on how to proceed?

Many thanks,

-Mark

I know what I’m doing and I never got it to work. I wrote this script instead which actually gives you more options to fine tuning the sensitivity of the BT presence detection anyway. The new BT binding for OH 2 is supposed to do more and not require rebuilding the jar files.

But to answer your main question, the META-INF/MANIFEST.MF file is located inside the .jar file. You need to extract the jar file using a zip program (e.g. gnuzip), edit it, then recreate the jar file using the jar command from the JDK.

Rich-

Thank you for your note. I tried installing your script and get the following error when I try to run it manually:

pi@MCNraspberrypi3:/opt/sensorReporter $ sudo python sensorReporter.py sensorReporter.ini
GPIO is not supported on this machine
WARNING: No route found for IPv6 destination :: (no default route?)
Loading sensorReporter.ini
Traceback (most recent call last):
File “sensorReporter.py”, line 261, in
main()
File “sensorReporter.py”, line 127, in main
loadConfig(sys.argv[1])
File “sensorReporter.py”, line 175, in loadConfig
configLogger(config.get(“Logging”, “File”),
File “/usr/lib/python2.7/ConfigParser.py”, line 607, in get
raise NoSectionError(section)
ConfigParser.NoSectionError: No section: ‘Logging’

Do you know what I might be doing wrong? I believe I have configured the HOSTNAME.ini file correctly.

Many thanks,

-Mark

Your ini file must have a [Logging] section where you configure logging parameters. Look at default.ini for examples for all of the configuration parameters. Also, make sure sensorReporter.ini exists, is a link to your “real” .ini file or is your “real” .ini file.

Rich-

Thank you for your help. I have the script running and successfully reporting my iPhone presence via the REST API.

Many thanks,

-Mark

@rlkoshak

Rich, I’m having a similar issue but I for the life of me cannot figure out how to make this work!

Here is the error I’m seeing:

steve@RPi3:/opt/sensorReporter $ sudo python sensorReporter.py sensorReporter.ini
Loading sensorReporter.ini
Traceback (most recent call last):
  File "sensorReporter.py", line 196, in <module>
    main()
  File "sensorReporter.py", line 69, in main
    loadConfig(sys.argv[1])
  File "sensorReporter.py", line 175, in loadConfig
    configLogger(config.get("Logging", "File"), 
  File "/usr/lib/python2.7/ConfigParser.py", line 607, in get
    raise NoSectionError(section)
ConfigParser.NoSectionError: No section: 'Logging'

Here is my sensorReporter.ini:

[Sensor3]
Class: bluetoothScanner.btSensor
Address: 20:C9:D0:90:A8:12
Destination: StevePhoneBT
Connection: REST
; Needs to be greater than 1 if using the RSSI mode, 25 if using the LOOKUP mode.
Poll: 2
; Uses signal strength to detect presence of devices
Mode: RSSI
; RSSI - Maximum count for near/far readings
Max: 20
; RSSI - How many near counts before declaring device present
Near: 3
; RSSI - How many far counts before declaring device absent
Far: 15

[Logging]
File: /var/log/sensorReporter.log
MaxSize: 67108864
NumFiles: 10

[Connection2]
Class: restConn.restConnection
Name: REST
URL = http://localhost:8080/rest/items/

I made the sensorReporter.py file executable and created a var/log/sensorReporter.log file.

What am I missing??

Hmmm. That looks OK.

One thing that comes to mind is I’m not sure you can start with Sensor3. I think you have to start with Sensor1. The code assumes there will be a Sensor1 (or Actuator1) and counts up from there. If you start at 3 I don’t think it will see any Sensor sections at all.

Of course, this is immaterial for the specific error you are seeing.

I added a a Syslog parameter to the Logging section awhile ago. It might be having a problem because you don’t have it defined. But I think that error is different. Try adding a Syslog=NO (or YES if you want it to log to syslog instead of its own log file) and see if that makes a different.

Here is one of my logging sections for reference.

[Logging]
File: /var/log/sensorReporter.log
MaxSize: 67108864
NumFiles: 10
Syslog: YES

The same thing goes for Connections as Sensors, start with Connection1.

Finally, make sure that what ever user sensorReporter is running as has permission to write to /var/log. That would be a different error, but it is something to watch out for.

Well, it’s always the simple (undocumented) stuff that works! Thank you Rich!

I appreciate all you add to this project!