homieiot / convention

🏡 The Homie Convention: a lightweight MQTT convention for the IoT
https://homieiot.github.io/
Other
715 stars 60 forks source link

BREAKING: Homie is about Lightweight topic discovery #120

Closed davidgraeff closed 6 years ago

davidgraeff commented 6 years ago
ThomDietrich commented 6 years ago

remove $fw, $mac and $localip

I get your point regarding firmware update but are those not also good for simple self-announcement?

davidgraeff commented 6 years ago

I don't think so. The Mac is required at the moment, but is not useful in an mqtt network where the broker can be in a different subnetwork. The localip attribute is flawed. Because an interface usually has more than one IP address nowadays. And it is the local IP only which is again not so useful for mqtt. And the $fw node is wrongly named, because a homie Linux client is technically not a firmware.

I'm not really sure what the benefit is for a controller to know those information.

An administrative tool would usually want to know about the firmware to perform ota. That's why I think we should make this an add-on convention that specifies exactly all information for ota to work.

boc-tothefuture commented 6 years ago

Are you proposing that we keep $implementation?

davidgraeff commented 6 years ago

Yes, but optional. There might be quirks in some implementations and knowing the implementation together with the homie version might help a controller to overcome those quirks.

boc-tothefuture commented 6 years ago

Would we want an optional implementation version as well? Using the quirks scenario you would need that if the implementation evolved at a different rate than the homie version.

davidgraeff commented 6 years ago

Might be a good idea, but is not part of this PR

boc-tothefuture commented 6 years ago

I can open a PR on it, after this one is merged.

timpur commented 6 years ago

Im with @ThomDietrich for $fw, $mac and $localip

MAC and IP are already required for the IP stack so why not just send them. Maybe make these optional ?

FW I think has quite alot of value actually. Maybe Implementation type makes more sense idk ?

Maybe these just need shuffling around where they should sit ?

Not sure the pros over come the cons here. But I'll let you guys discus.

davidgraeff commented 6 years ago

My controller and device implementations are both not homie compliant, because I don't publish or subscribe to those attributes and I'm not encouraging other device implementers to do so if they ask for the minimum compliance level. I really thing this should be at least optional yes. Soon.

boc-tothefuture commented 6 years ago

@timpur The problem is, which mac and IP address should be sent and does that have value in all situations? If you have multiple interfaces and ip addresses, one can do some work with UDP sockets and figure out which IP and therefore interface the OS will use to get to the broker. That may have value, but that value reduces in many situations. For example, if your client is running in a docker container and routing out via a NAT and is not addressable on the network.

For firmware, lets say my I am fetching and publishing weather information from weather.com over the homie convention. What would my firmware be? The API version of the weather.com device I am fetching data from? I think there are a lot of use cases where firmware doesn't make sense to be required.

I think all of these values should be optional attributes under implementation because they are implementation specific.

Thalhammer commented 6 years ago

MAC and IP are already required for the IP stack so why not just send them. Maybe make these optional ?

No, they are not. IP does not require a mac to be present and many technologies which have no mac (almost everything which is not BT, WLAN or LAN). The most prominent example being 2G/3G/LTE.

timpur commented 6 years ago

So lets all agree on what and where these things should go.

I think all of these values should be optional attributes under implementation because they are implementation specific.

I really think this should be at least optional yes.

So optional values sitting under implementation ?

Also regarding foks who pointed out it doesnt always have to the mac and ip, why dont we reimagine these to allow for for options? eg address = "IP: 192.168.0.2, MAC: AB:12:CD:34:EF:56" (for standard IP networks) or address = "RF: 42" (for RF networks), also we could show the mqtt identifier "MQTT: esp1234". Basically address is some network identifiers ?? It cold contain the full stack of identifiers that the implementation is using ?

davidgraeff commented 6 years ago

@timpur: yeah that's all doable. But this PR is first about getting rid of Mac and localip and the other stuff that not all implementation need to have. Make a pr proposal for address or similiar

timpur commented 6 years ago

@davidgraeff , yeah i agree with that, i can do so, will think a bit more on the matter first though.

ThomDietrich commented 6 years ago

My thought was to make Mac and IP optional, so that clients can implement them, when meaningful. However this is once again nothing that has to be part of the convention. An implementer/user can always add additional data. I agree to remove IP and Mac.

davidgraeff commented 6 years ago

@timpur Could you re-review and approve?

timpur commented 6 years ago

@davidgraeff , sorry different time zone ....

For anyone interested about the address stuff https://github.com/homieiot/convention/issues/129