teemon
I've opened demo MQTT project, compiled and downloaded st file to the windows Runtime, got an errors:
 
cat: ethercat: No such file or directory
Optimizing ST program...
Generating C files...
./st_files/691186.st:8-21..8-32: error: invalid specification in variable declaration.
./st_files/691186.st:9-18..9-26: error: invalid specification in variable declaration.
./st_files/691186.st:18-3..18-24: error: invalid variable before ':=' in ST assignment statement.
./st_files/691186.st:18-46..18-48: error: ';' missing at the end of statement in ST statement.
./st_files/691186.st:18-48..18-55: error: invalid variable before ':=' in ST assignment statement.
./st_files/691186.st:18-78..18-80: error: ';' missing at the end of statement in ST statement.
./st_files/691186.st:18-80..18-85: error: invalid variable before ':=' in ST assignment statement.
./st_files/691186.st:18-92..18-93: error: ';' missing at the end of statement in ST statement.
./st_files/691186.st:18-93..18-93: error: invalid statement in ST statement.
./st_files/691186.st:20-3..20-18: error: invalid variable before ':=' in ST assignment statement.
./st_files/691186.st:20-49..20-51: error: ';' missing at the end of statement in ST statement.
./st_files/691186.st:20-51..20-57: error: invalid variable before ':=' in ST assignment statement.
./st_files/691186.st:20-80..20-82: error: ';' missing at the end of statement in ST statement.
./st_files/691186.st:20-82..20-90: error: invalid variable before ':=' in ST assignment statement.
./st_files/691186.st:20-114..20-115: error: ';' missing at the end of statement in ST statement.
./st_files/691186.st:20-115..20-115: error: invalid statement in ST statement.
16 error(s) found. Bailing out!
Error generating C files
Compilation finished with errors!
 
But program has started (green status). I added watch for blink_led and mqtt_connected and dont see changes of it, I made a cnclusion so program does not works.
thiagoralves
"Compilation finished with errors" means that the program was not compiled. Whatever you're running is the previously compiled program. MQTT does not work on the Windows / Linux runtime, only on microcontrollers for now.
Reply 0 0
teemon
Do you have plans to add support MQTT to Window runtime?
Reply 0 0
thiagoralves
That will take a while... 
Reply 0 0
gtbeean
I'm curious about this as I'm planning to play with MQTT once I've got some other stuff working. I have a few ESP8266s on the way, so I should be fine without it working on Windows/Linux, but at some point I may want to use it on those too.
If not too complicated to explain, why does it work on microcontrollers but not Windows and Linux runtimes?
Would you use something like MQTT-C for the Windows and Linux runtimes, if you have time to implement this functionality at some point in the future?
Reply 0 0
thiagoralves
Microcontrollers implementation is based on the Arduino framework. Arduino provides a MQTT library that works on pretty much any arduino-compatible board. On Windows and Linux, I would have to find a library that works on both of them. 
Reply 0 0
teemon
Yeah?
Reply 0 0
thiagoralves
Possibly, but I would rather look for something simpler 
Reply 0 0
soura
"Compilation finished with errors" means that the program was not compiled. Whatever you're running is the previously compiled program. MQTT does not work on the Windows / Linux runtime, only on microcontrollers for now.
@ThiagoAlves, Would MQTT work on Raspberry Pi using the OpenPLC runtime?
Reply 0 0
thiagoralves
MQTT does not work on the Windows / Linux runtime, only on microcontrollers for now.
Reply 1 0
LuchoBrown
Would love to see MQTT supported for raspberry pi. Got really stuck with this until I found this thread and realised it was never going to work!

Any suggested work around? I'm trying to run Emoncms on the same device which publishes sensor results to MQTT. My plan was to pick that up in openplc and use it to control pumps and valves on my heating system...
Reply 0 0
thiagoralves
Perhaps your best bet so far is to run a python script that talks to the runtime over Modbus/TCP and with your other application over MQTT
Reply 1 0
LuchoBrown
Perhaps your best bet so far is to run a python script that talks to the runtime over Modbus/TCP and with your other application over MQTT
Many thanks for this Thiago. I got it working as you described with a little help from an AI friend 👍
Reply 1 0
markT
hi there
i have a PI and am needing to use MQTT. any updates on this issue?
Reply 0 0
markT
i am now using the arduino mega 2560 and i get a complile erro
 
from C:\Users\Tyson\OpenPLC_Editor\editor\arduino\examples\Baremetal\Baremetal.ino:22:
C:\Users\Tyson\OpenPLC_Editor\editor\arduino\examples\Baremetal\modules\mqtt.c:31:5: error: 'WiFiClient' does not name a type; did you mean 'DNSClient'?
WiFiClient wifiClient;
^~~~~~~~~~
DNSClient
C:\Users\Tyson\OpenPLC_Editor\editor\arduino\examples\Baremetal\modules\mqtt.c:33:25: error: 'wifiClient' was not declared in this scope
PubSubClient mqttClient(wifiClient);
^~~~~~~~~~
C:\Users\Tyson\OpenPLC_Editor\editor\arduino\examples\Baremetal\modules\mqtt.c:33:25: note: suggested alternative: 'mqttClient'
PubSubClient mqttClient(wifiClient);
^~~~~~~~~~
mqttClient
 
this is loading the tutorial module ,no changes
 
any ideas?
Reply 0 0
Reply