-
-
Notifications
You must be signed in to change notification settings - Fork 187
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
Use serial port the same way as MQTT #611
Comments
Hmmm, can you specify the use-case? openHASP was conceived as an MQTT client device. I think Serial1 should be reserved for debugging, but can be disabled. Receiving commands can be done using custom code. The status updates will be trickier... |
Did you manage to resolve this issue or is this still pending? |
The specific use case is when I’m using the displays in my RV without WiFi. But rather serial connection to the controller. |
I think this is more of an RV integration issue, than Home Automation... Without knowing anything about these systems it's going to be talking to, you'll have to piece something together that works for you... You can check out the custom code section to maybe add this functionality. |
I'm with @matsekberg here. From the documentation I thought that the use of commands would be the same, no matter which interface you use (MQTT, Serial, Telnet). But I found out that feeding commands to the serial port has to be done really slowly (I have to wait 2ms after each character to be sure to have a stable connection. Command: "p1b1.val" As for the use case: I have developed a modular system with machine automation on my mind. As a HMI I'd like to use a cheap ESP32-8048S070 display, connected through UART. Any help would be appreciated. If needed I could supply free hardware samples :) |
Like I stated above, the serial debug is meant as a debug tool. You can interact with it that way, but no effort was made to use it as an API. Because this is a custom application of the firmware, I would repeat that a separate Serail2 connection should be implemented using the Custom Code interface. |
Yeah, you are right. I'll look into the custom code idea. Is there no command that outputs the state of an object? The same applies to commands like moodlight: But when I send the command "moodlight" via serial or telnet I get no "status" reply. |
Weird... when I issue the
|
What do you get when you issue ''p1b1.val''? |
By the way, I evil-fixed the problem by adding this to hasp_dispatch.cpp:
|
Yes indeed, I have MQTT enabled, since that 's the normal operational mode for openHASP. The not evil code would be to add a hook into the custom code, so a callback can be used to send the data to a Serail port. |
I could add a |
That sounds good! Please do this if it's not too much trouble. |
done! |
Machine automation (PLC, motion control, etc) is a pet interest of mine. Would like to know more about your little project. As GH doesn't allow for PMs, feel free to open a discussion in one of my repositories (saves clogging up this one). |
Thanks for the update, @fvanroie !! |
I've started a new repo with some pictures. I'll post more information once I find the time. Please start a discussion here: |
Have you made any progress in using serial rather than MQTT? |
I think this can be closed now? |
Is your feature request related to a problem? Please describe.
Im using OpenHasp in an environment where wifi is not stable. A better solution would be to use the serial port.
Describe the solution you'd like
First I would like an option to kill all the debug messages on the serial port.
The I would like to be able to send commands and receive status over the serial port, as if it where MQTT.
The same commands/topics/data etc could be used.
Describe alternatives you've considered
Due to the debugging noice the serial port is not a great choice today.
Additional context
These messages is really annoying if using serial as a wired MQTT:
Prompt > [14:18:18.931][34804/46800 25][33404/33976 2] MQTT RCV: = p2b13.text=0
Prompt > [14:18:18.940][34804/46800 25][33404/33976 2] MSGR: p2b13.text=0
Prompt > [14:18:18.959][38900/47152 17][33864/34148 1] MQTT RCV: = p2b12.text=0
Prompt > [14:18:18.968][38900/47152 17][33864/34148 1] MSGR: p2b12.text=0
Prompt > [14:18:18.980][38900/47152 17][33864/34148 1] MQTT RCV: = p2b21.text=0
Prompt > [14:18:18.989][38900/47152 17][33864/34148 1] MSGR: p2b21.text=0
The text was updated successfully, but these errors were encountered: