Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't understand how to work #2

Open
everything-everything opened this issue May 29, 2021 · 5 comments
Open

Don't understand how to work #2

everything-everything opened this issue May 29, 2021 · 5 comments

Comments

@everything-everything
Copy link

everything-everything commented May 29, 2021

Hallo, i try to use this on ubuntu 21.04 with an bluetooth dongle but it doesn't work.

15:41:21.139 [main] INFO Sem6000MqttClient - Started

15:41:26.141 [main] INFO Sem6000MqttClient - Loading properties from /home/Schreibtisch/Voltcraft/Java/sem6000.properties

Exception in thread "main" java.lang.NumberFormatException: For input string: "30 "

at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)

at java.base/java.lang.Integer.parseInt(Integer.java:652)

at java.base/java.lang.Integer.valueOf(Integer.java:983)

at org.magcode.sem6000.mqtt.Sem6000MqttClient.readProps(Sem6000MqttClient.java:143)

at org.magcode.sem6000.mqtt.Sem6000MqttClient.main(Sem6000MqttClient.java:43)

i get that on if i type
java -jar sem6000.jar volt1 power
java -jar sem6000.jar /volt1 /power
java -jar sem6000.jar /volt1/power
java -jar sem6000.jar /volt1 power
java -jar sem6000.jar

yes i know its renamed the jar file but it doesn't matter

The log file looks like
021-05-29 15:23:09.096 [main] INFO Sem6000MqttClient - Started

2021-05-29 15:23:14.100 [main] INFO Sem6000MqttClient - Loading properties from /home/power1/Schreibtisch/Voltcraft/Java/sem6000.properties

2021-05-29 15:23:47.092 [main] INFO Sem6000MqttClient - Started

2021-05-29 15:23:52.098 [main] INFO Sem6000MqttClient - Loading properties from /home/Schreibtisch/Voltcraft/Java/sem6000.properties

2021-05-29 15:24:06.728 [main] INFO Sem6000MqttClient - Started

2021-05-29 15:24:11.731 [main] INFO Sem6000MqttClient - Loading properties from /home/Schreibtisch/Voltcraft/Java/sem6000.properties --> there is the propertie file and jar file

rootTopic=/media/sf_Linux/Voltcraft
mqttServer=tcp://10.0.2.15 # Mqtt Service runs under linux have a rule in firewall... should be lokal. Have i add here the device?

sem1.mac=XX:XX:XX:XX:XX:XX # Mac adress is new

sem1.pin=0000 by default

sem1.name=volt1

sem1.refresh=30

Note the expection shell script works fine Heckie works fine.

what make i wrong ? do i need a special mqtt server. Make i something wrong with root directory , ports etc? I see in vm that it comunicate with sem6000 in virtualbox

@magcode
Copy link
Owner

magcode commented Jun 1, 2021

Please build it from the sources and try again. For your convenience I published release 1.0.1

@everything-everything
Copy link
Author

everything-everything commented Jun 2, 2021

Ok what have i to do ?

git clone https://github.com/magcode/sem6000-mqtt/

and than? What do i need to compile this to jar file ? Sorry it is a very new knowledge for me.

i see you have compiled it and uploaded newer Version. Thanks for that . Will try .

so i have anothter Question. You write :

Raspberry PI 3 B, Raspbian 10 Buster, OpenJDK 11.0.7, Bluez 5.50, built-in Bluetooth adapter usb:v1D6Bp0246d0532
Raspberry PI 3 B, Raspbian 10 Buster, OpenJDK 11.0.7, Bluez 5.50, USB Bluetooth adapter 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle
Virtual machine, Ubuntu 20.04, OpenJDK 11.0.7, Bluez 5.54, Intel Bluetooth adapter 8087:0a2b

  • do you mean this is what you can choose what you use of this ?? This configuration or this configuration?

In configuration file you have specify an MQTT Server. If i execute jar file need i an specified MQTT Server, or does the Jar File Create a MQTT Server Session?

And what about this explanation :
//voltage (voltage)
is that mean

java -jar sem6000.jar /volt1 /power or what does that mean`?

@everything-everything
Copy link
Author

everything-everything commented Jun 2, 2021

Note this isn't close :D does it automatical :D by past information

@FibreFoX
Copy link

FibreFoX commented Jan 27, 2022

@everything-everything This is a Java project that uses Maven as its build-system. You could either install maven yourself (https://maven.apache.org/download.cgi) and run mvn package in the cloned folder, or you could use the prebuilt that got provided by the author: https://github.com/magcode/sem6000-mqtt/releases/download/1.0.1/sem6000-mqtt-1.0.1-jar-with-dependencies.jar

So when having your configuration file, which contains the broker and your sensor-details, this tool will send gathered data from the sensor via MQTT packages to the MQTT broker. So <roottopic from properties file>/<name of sem6000 from properties file>/voltage does not mean parameters for running this tool, but the data packages that get posted to the MQTT broker.

All in all this is some kind of a "active sensor data publisher" that actively requests data from the sensor and converts it into MQTT messages. Your configuration rootTopic=/media/sf_Linux/Voltcraft suggest that you think this is some kind of "file storage", but this is one of the MQTT message parts, not a filename where the data gets stored.
And yes, you are required to have your own MQTT server running somewhere where all the data is pushed from this tool.

I hope this helps a bit.

@franq77
Copy link

franq77 commented Feb 19, 2023

I have all installed, compiled, properties file configured and and musquito mqtt server running inside Homeassistant.
The mqtt server is properly working, tested that.
Unfortunately when I run the java tool (inside the home assistant console) I get an "Exception in thread "main" Not authorized to connect".

Any idea how to resolve this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants