PLCnext / MqttClient

Mqtt Client for PLCnext Control
MIT License
13 stars 5 forks source link

Cannot build: mqtt_payload not declared in scope #9

Open jwise-mfg opened 3 years ago

jwise-mfg commented 3 years ago

Running the second build command from the readme: https://github.com/PLCnext/MqttClient#building-from-source results in two errors, the second being fatal:

../../libs/MqttClientService/src/MqttClientManager.cpp:161:11: error: reference to ‘byte’ is ambiguous
const byte * mqtt_payload = payload.GetDataAddress();
../../libs/MqttClientService/src/MqttClientManager.cpp:165:74: error: ‘mqtt_payload’ was not declared in this scope; did you mean ‘setpayload’?
  165 |         this->client->Publish((Client::client_id_t)clientId, mqtt_topic, mqtt_payload, length, qos, retained);
jwise-mfg commented 3 years ago

I resolved this issue by adding a line MqttClientManager.cpp near the top (I added it at line 12): using byte = Arp::byte;

This disambiguates the byte declaration, and the project appears to build, however, the output does not match the Readme. The folder external/ is not created during build.

martinboers commented 3 years ago

The byte problem is a known issue that was introduced in version 2021.6 of the firmware: https://www.plcnext.help/te/Known_issues.htm (in the "Programming" section).

Unfortunately we have not updated this project for some time, so I am afraid that it has fallen behind developments in the PLCnext Control firmware and SDKs.

We have decided not to maintain this project, since (a) the general concepts demonstrated here are now also demonstrated in other repositories, (b) it will not be possible in the forseeable future for users to develop their own RSC services for the PLCnext Runtime, and (c) there are now a number of alternatives for users who require MQTT Client functionality in their PLCnext Control projects.

I have now added a note to the top of the README, which we should have done some time ago (sorry).

If there is a particular reason that you need this specific component for your project, please let know.