Longer text in V_TEXT, any workarounds?
-
Hi,
I am building a LED matrix display for displaying some messages from controller. I searched and found some discussion few years ago about its limitation and possible workarounds in sending few messages from gateway and the nodes. Was there any progress on this, or has anyone come with some workaround?
I am using openhab and node-red over mqtt if that helps.
I was considering making small custom logic in node-red that would split the messages and send them with few seconds delay, and then on the node to combine them in a single text, something like:
Message1: |CS| This is some 24 message th
Message2: at is being split over multipl
Message3: e messagesSo if node gets message starting with "|CS|" it will delete message from the screen, if not it will just append the message to it
But what if some message gets lost? Or any better suggestions?
-
@dakipro I whould send a line number for each part of the text and some sort of EOL character to indicate the end.
[CS] this is some 24 message th
[02] at is being split over multipl
[03] e messages [EOL]So if message [03] arrived without [02] you could request a resend.
-
How about using multiple V_TEXT child IDs? Then there would be no need to check the start of the text, and handling lost messages would be much easier.
-
Thanks! Btw, does anyone have a example of resending of missed messages from OpenHab via Mqtt?
Or retrieving any data at all, I just never managed to get any data from openhab from the node. F.eks., asking what is the time and such thing, do I need to have a rule for each "question" and then reply in response, or as a new call or what?
-
If anyone is trying the same, I did it as @mfalkvidd recommended, with several child IDs
Then I basically reset the message if data comes on on first childId, and only append it if data comes on any other sensor, something likeif (message.sensor == messageCHILD1){ strcpy(newMessage, " "); // we put some spaces in front strcat(newMessage, message.getString()); }else{ if(curMessage!=""){ // append existing message to newMessage strcpy(newMessage, curMessage); } //append rest strcat(newMessage, message.getString()); }
Note: the code also works with just two sensors, first for reset, and second that only appends data, but I decided to go with four child IDs, in case there is something I am not seeing at the moment.
Thanks everyone for ideas