meatpiHQ / wican-fw

GNU General Public License v3.0
314 stars 67 forks source link

Custom MQTT topics #88

Closed MarcosAPMT closed 7 months ago

MarcosAPMT commented 9 months ago

Hi, I have been testing the WiCAN-OBD2 and I have seen that it is not possible to manually configure the MQTT topic to which the device publishes. My idea of use is for fleets of vehicles managed by third parties and not being able to configure the topics makes this implementation very difficult for several reasons. Would it be possible to add this feature? Thank you.

meatpiHQ commented 9 months ago

@MarcosAPMT yes it can be done. But there are other issues you should consider.

At the moment only non-secure mqtt is supported. Mqtt broker input only supports IP address and not endpoint URI.

MarcosAPMT commented 9 months ago

Yes, I am aware of this limitation. In principle this is not a major constraint for us, at least for some tests. The equipment is located within a closed, secured network.

As I said, being able to configure the topics is very important for us.

I appreciate your help and quick response. Best regards.

meatpiHQ commented 9 months ago

Now there's only one receive and transmit topics, do you want to make those configurable?

MarcosAPMT commented 9 months ago

Yes, and also the status topic. Right now, both CAN and status topics are located in wican/xxxxxxxxxxxx. My request is to at least be able to change the xxxxxxxxxxxxxxx part to an arbitrary value. This would make it easier for us to know from which vehicle we are receiving data.

meatpiHQ commented 9 months ago

xxxxxxxxxxxx is the device ID and it's unique, not a random value.

MarcosAPMT commented 9 months ago

Oh, I know this. But as I mentioned, for our use case, these devices are operated by third-party workers. Having them take note of the ID of the device installed in each vehicle and send it to us is rather unreliable. It is important for us to know exactly which vehicle in the fleet a device is installed in, and as I said, if the topics could be configured, this would be more than enough for us.

meatpiHQ commented 9 months ago

@MarcosAPMT I'll add this feature soon.

meatpiHQ commented 8 months ago

@MarcosAPMT Please try this firmware, all 3 topics are now configurable.

image

wican-fw_v297_hv300.zip

MarcosAPMT commented 8 months ago

@meatpiHQ Thanks a lot. Will try this tomorrow and revert.

MarcosAPMT commented 8 months ago

@meatpiHQ Hello. I've been able to test and it's working well. Looks like the CAN message filtering is different is this version, so the old config didn't work for me.

meatpiHQ commented 8 months ago

@MarcosAPMT set the index in the filter to 2. You'll get the same behaviour as before.

MarcosAPMT commented 8 months ago

This seems to be working well. I think the issue can be closed once this is implemented in a final release. Thanks a lot!