-
-
Notifications
You must be signed in to change notification settings - Fork 346
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CommandProcessing with WebSocket #2665
Comments
Thanks a lot @slaff. Just another question, is this text line interface useful also using MQTT? Thanks again, |
Yes. You can take the MqttClient_Hello sample as a starting point and modify the onMessageReceived callback from app/application.cpp to process the messages via CommandHandler. Something like: #include <CommandProcessing/Utils.h>
CommandProcessing::Handler commandHandler;
// Callback for messages, arrived from MQTT server
int onMessageReceived(MqttClient& client, mqtt_message_t* message)
{
String output = commandHandler.processNow(reinterpret_cast<const char*>(message->publish.content.data), message->publish.content.length);
if(output.length() > 0) {
client.publish(MqttBuffer(message->publish.topic_name), output);
}
return 0;
} Make sure also to add the dependency on CommandProcessor. This can be done by adding the following line to the application
|
It is already merged in the |
Hi @slaff I did some test using the provided sample for Telnet but I'm not able to have success. here Telnet session
here Serial output
Any suggestion? |
Yes, commend line 58 in app/application.cpp TelnetServer sample:
And recompile the example. |
And something more. When you connect use the following command:
Notice the port number after the IP. Without it your telnet client will switch to telnet protocol and will send an initial telnet packet which this simple sample does not support. |
Thanks a lot @slaff . thanks again Steafano |
Only on the TelnetServer. For Serial you need to create a new commandHandler. |
Hi @slaff, Some trouble on Websocket because receive a stacktrace on httpServer access for both
any suggestion? Thanks in advance |
@sreggy do me a favour and add more information to this bug report.
And paste the text enclosed in '===='. Exactly as instructed above.
Meanwhile I will run the stock |
Hi @slaff , inline the info
Esp8266
I did it, but unfortunatly I'm not able to well analyze the output, no problem to paste it in this thread, let me to know ...
Yes, i've added it. On Mqtt it's working fine ...
Thanks again |
Yes, please do so. |
Hi @slaff I've tried to remove the WebSocker, leaving only the loading of the following the decode-stacktrace when with the browser i try to connect to in serial log:
then with decode-stacktrace
also attach the HttpServer definition
Probably I'm doing some trivial error ... Thanks a lot for your support |
@sreggy Please put the source code that is segfaulting for you in a separate GitHub repository and paste the URL here. I will compile it for the Host architecture. And run valgrind and other tools if there is an issue. |
Hi @slaff, Available for any further information. thanks in advance |
Since the issue is not related to CommandProcessing( see here: sreggy/ezri#1) I will close this issue. You can create a new one if you are certain that there is a problem with CommandProcessing AND provide a small/simple/sample code that demonstrates it. |
Hi all,
I've tryed CommandProcessing sample for manage command handler using websocket.
It works fine with serial and telnet but I'm not able to use it with websocket. It's like the command handler is not attached to websocket interface.
Can anyone help me?
Thanks in advance
Regards
Stefano
The text was updated successfully, but these errors were encountered: