Code Monkey home page Code Monkey logo

Comments (11)

john30 avatar john30 commented on September 18, 2024

you need to have libmosquitto-dev available on the build environment

from ebusd.

schka17 avatar schka17 commented on September 18, 2024

Hi John,

Thanks works fine.

I have just an issue assigning the topic:

I have a lot of devices/systems publishing into my MQTT server, all other publishing with a starting / like /owado/devices/esp-sensor-64/#
but i cannot start ebusd with the option --mqtttopic=/owado/ebusd...... i get the error invalid mqtttopic
Without the lading / it works, but my problem ist that i want to subscribe to /owado/# to see all of this topics.

Without analysing the spurce, is there a chance to change that?

Thanks and regards

from ebusd.

john30 avatar john30 commented on September 18, 2024

just remove the slash. the subscription is of course with a starting slash by design.
or maybe I get you wrong here.
With --mqtttopic=blah/... you should be able to subscribe to /blah/#

from ebusd.

schka17 avatar schka17 commented on September 18, 2024

Sorry, no that doesnt work in that way,

here is a small snippet of mqtt messages:

owado/ebusd/bai/StorageTempDesired 55.00 owado/ebusd/bai/ReturnTemp 65.94;64480;ok owado/ebusd/bai/ModulationTempDesired 16.0 owado/ebusd/bai/PrEnergyCountHc1 266571 owado/ebusd/bai/FlowTempDesired 65.50 owado/ebusd/bai/PrEnergyCountHc2 0 owado/ebusd/scan.52/ Vaillant;VR_70;0109;2903 owado/ebusd/broadcast/vdatetime 16:32:07;31.01.2017 owado/ebusd/broadcast/outsidetemp -1.875 ebusd/global/version ebusd 3.0pre.15d5500 ebusd/global/running false ebusd/global/signal true ebusd/global/uptime 48 ebusd/scan.08/ Vaillant;BAI00;0116;9602 ebusd/scan.08/id 21;16;31;0010015600;3100;006988;N1 ebusd/scan.15/ Vaillant;70000;0419;4603 ebusd/scan.52/ Vaillant;VR_70;0109;2903 ebusd/bai/Mode standby ebusd/bai/Status01 69.5;65.5;-1.875;47.0;48.0;on ebusd/bai/Status02 auto;60;75.0;70;65.0 /owado/devices/esp-sensor-68/Heizung_FBDGKZ_VL 28.6 /Outdoor_Weather/rain 2479.9 /Outdoor_Weather/wind 1.1 /Outdoor_Weather/humidity 70 /Outdoor_Weather/temperature -3.7 /Outdoor_Weather/israining no /Outdoor_Weather/rain_calc_tsecs 1485877534.3002 /Outdoor_Weather/rain_calc_now_value 2479.9 /Outdoor_Weather/rain_calc_now_diff 0 /Outdoor_Weather/rain_calc_all cH: 0.0 lH: 0.0 cD: 0.0 lD: 0.0 IR: no Rnow: 0.0 Rdif: 0 /owado/HAL9000/TF_HelgasZimmer/temperature 22.4 /owado/devices/esp-sensor-68/Heizung_FBDGKZ_RL 28.6

so if a subscribe to owado/# i just can see the ebusd messages but the other messages of /owado/# and viceversa

To get all owado messages i need 2 sbscriptions, with and without leading slash.

and the scond thing, the paramater --mqtttopic seems not not to apply to ebusd/bai, ebusd/global, and ebusd/scan.

Regards,, Karl

from ebusd.

john30 avatar john30 commented on September 18, 2024

from my understanding, having a leading slash would yield in an empty top level in the topic and that seems to be wrong.

and the scond thing, the paramater --mqtttopic seems not not to apply to ebusd/bai, ebusd/global, and ebusd/scan.

what do you mean by that exactly? examples?

from ebusd.

schka17 avatar schka17 commented on September 18, 2024

Hi John,

< from my understanding, having a leading slash would yield in an empty top level in the topic and that seems to be wrong.>

I dont know if its wrong, all my other stuff is using/supporting a starting slash, and so i structured that in this way ie.

/owado/HAL9000/TF_HelgasZimmer/temperature 22.4
/owado/devices/esp-sensor-68/Heizung_FBDGKZ_RL 28.6

so its easy (just for diagnosis) to subscribe to /owado/# or any other topic root and get all the relevant messages. In production its not an issue, because the i subscribed to a dedicated topic, just for diagnosis, i can live with that.

<what do you mean by that exactly? examples?>
what i mean is, when i configure the topic i.e. --mqtttopic=ebusd/%circuit/%name
then this topic is applied to aaahrrgggg -> i see, its just applied circuit and name but not to "global" , "broadcast","scanxx" and so on. ie.

ebusd/global/signal true
ebusd/scan.15/ Vaillant;70000;0419;4603

OK my fault.

from ebusd.

andig avatar andig commented on September 18, 2024

from ebusd.

john30 avatar john30 commented on September 18, 2024

for the time being I won't change the code. you should rather think about correcting your other devices topics

from ebusd.

schka17 avatar schka17 commented on September 18, 2024

Hi John,

no problem, i can do it myself, thanks.

changing the other stuff is for me an impracticable option, because there are not only a lot of sensors and systems but also event based systems involved, depending on that structure, and this is a historical grown over the last three years (from a proof of concept into production :-) ) i will not change a running system, it works, just for diagnosis it would be fine. But that's not essential

Thanks and Regards, Karl

from ebusd.

NemoN avatar NemoN commented on September 18, 2024

Small patch, that allows a leading / in mqtttopic (I using the / in front of my mqtt topics too)

--- a/src/ebusd/mqtthandler.cpp
+++ b/src/ebusd/mqtthandler.cpp
@@ -105,7 +105,8 @@ static error_t mqtt_parse_opt(int key, char *arg, struct argp_state *state) {
     break;

   case 5:  // --mqtttopic=ebusd
-    if (arg == NULL || arg[0] == 0 || arg[0] == '/' || arg[strlen(arg)-1] == '/') {
+    // if (arg == NULL || arg[0] == 0 || arg[0] == '/' || arg[strlen(arg)-1] == '/') {
+    if (arg == NULL || arg[0] == 0 || arg[strlen(arg)-1] == '/') {
       argp_error(state, "invalid mqtttopic");
       return EINVAL;
     }

from ebusd.

john30 avatar john30 commented on September 18, 2024

solved with f7f79bb

from ebusd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.