force EDITOR to temporarily loose connection in V1.70

Here we can discuss about the problem found
Post Reply
User avatar
PeterN
Posts: 805
Joined: Mon Feb 08, 2021 7:56 pm
Location: Krefeld, Germany
Has thanked: 387 times
Been thanked: 447 times
Contact:

force EDITOR to temporarily loose connection in V1.70

Post by PeterN »

I am using 1.70.5 and can force the EDITOR to a "CONNECTION ERROR/OFF/ON" by simply two methods

1. use a program code containing e.g. WLOG CHR$(248)
2. Lookup a variable that contains ASCII 248 with the editor's variable watch

Came to this result when my original code used CHR$(248) to show the Celsius symbol behind a temperature value on a MAX7219-matrix. a I just wanted to look at the variable containing this code by WLOG or with the variable watch.

Here my test code that should simply WLOG the time once per second, but produces a connection error of the IDE.

Code: [Local Link Removed for Guests]

' TEST.BAS
'###########################################
While 1
  T$     = TIME$
  TEXT$  = str$(RND(200))  + chr$(248) + "C"
  WLOG "TIME$=",T$
  WLOG "TEXT$=", TEXT$
  PAUSE 1000
wend
The WLOG output:

Code: [Local Link Removed for Guests]

28/01/2025 15:53:30 -> Program Running
TIME$=    15:53:30
28/01/2025 15:53:30 => Connection Error
28/01/2025 15:53:30 => Connection OFF
28/01/2025 15:53:34 => Connection ON
TIME$=    15:53:34
28/01/2025 15:53:34 => Connection Error
28/01/2025 15:53:34 => Connection OFF
28/01/2025 15:53:44 => Connection ON
TIME$=    15:53:44
28/01/2025 15:53:44 => Connection Error
28/01/2025 15:53:44 => Connection OFF
28/01/2025 15:53:54 => Connection ON
TIME$=    15:53:54
28/01/2025 15:53:54 => Connection Error
28/01/2025 15:53:54 => Connection OFF
28/01/2025 15:54:04 => Connection ON
TIME$=    15:54:04
28/01/2025 15:54:05 => Connection Error
28/01/2025 15:54:05 => Connection OFF
28/01/2025 15:54:14 => Connection ON
TIME$=    15:54:14
28/01/2025 15:54:14 => Connection Error
28/01/2025 15:54:14 => Connection OFF
28/01/2025 15:54:24 => Connection ON
28/01/2025 15:54:24 -> Program Stopped
The serial messages report an invalid UTF-8 in Text frame.

Looks like this on my desktop:
Screenshot.jpg

This behavior might be unwanted as it produces a problem if you look at or use WLOG with variables containing special white characters.
You do not have the required permissions to view the files attached to this post.
User avatar
cicciocb
Site Admin
Posts: 3232
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 645 times
Been thanked: 2276 times
Contact:

Re: force EDITOR to temporarily loose connection in V1.70

Post by cicciocb »

This is a known "problem" as the websocket do not recognize characters that are not UTF-8.

So, use print instead
User avatar
PeterN
Posts: 805
Joined: Mon Feb 08, 2021 7:56 pm
Location: Krefeld, Germany
Has thanked: 387 times
Been thanked: 447 times
Contact:

Re: force EDITOR to temporarily loose connection in V1.70

Post by PeterN »

I have understood.
I can avoid WLOG, but the problem is that a variable containing such a character produces strange effects in the editor's variable monitoring (unknown variable) and disrupts the connection for no "obvious" reason
User avatar
cicciocb
Site Admin
Posts: 3232
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 645 times
Been thanked: 2276 times
Contact:

Re: force EDITOR to temporarily loose connection in V1.70

Post by cicciocb »

[Local Link Removed for Guests] wrote: [Local Link Removed for Guests]Tue Jan 28, 2025 4:06 pm I have understood.
I can avoid WLOG, but the problem is that a variable containing such a character produces strange effects in the editor's variable monitoring (unknown variable) and disrupts the connection for no "obvious" reason
convert in hex and show the value in hex
User avatar
PeterN
Posts: 805
Joined: Mon Feb 08, 2021 7:56 pm
Location: Krefeld, Germany
Has thanked: 387 times
Been thanked: 447 times
Contact:

Re: force EDITOR to temporarily loose connection in V1.70

Post by PeterN »

Please look at my screenshot. The monitoring was set to show the variables each 5 seconds.
How could I avoid the connection crashes and „no show“ of the variable‘ content?
User avatar
PeterN
Posts: 805
Joined: Mon Feb 08, 2021 7:56 pm
Location: Krefeld, Germany
Has thanked: 387 times
Been thanked: 447 times
Contact:

Re: force EDITOR to temporarily loose connection in V1.70

Post by PeterN »

Debugging by watching variables isn’t easy that way :-)
User avatar
cicciocb
Site Admin
Posts: 3232
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 645 times
Been thanked: 2276 times
Contact:

Re: force EDITOR to temporarily loose connection in V1.70

Post by cicciocb »

use replace$ of this character with another one.

There are no solutions actually, only UTF-8 characters can be shown
User avatar
PeterN
Posts: 805
Joined: Mon Feb 08, 2021 7:56 pm
Location: Krefeld, Germany
Has thanked: 387 times
Been thanked: 447 times
Contact:

Re: force EDITOR to temporarily loose connection in V1.70

Post by PeterN »

WLOG is not so critical. But you can not trust in the variable watcher any more
User avatar
cicciocb
Site Admin
Posts: 3232
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 645 times
Been thanked: 2276 times
Contact:

Re: force EDITOR to temporarily loose connection in V1.70

Post by cicciocb »

[Local Link Removed for Guests] wrote: [Local Link Removed for Guests]Tue Jan 28, 2025 4:17 pm WLOG is not so critical. But you can not trust in the variable watcher any more
Don't be so catastrophic ! :-)

Now you know how do it :idea:

The nice side is that you can use special characters like the accented characters éùàç .....

At the same time, what do you expect to have in the variable watcher with this character (248)?
It is not a printable character, after all ...
User avatar
PeterN
Posts: 805
Joined: Mon Feb 08, 2021 7:56 pm
Location: Krefeld, Germany
Has thanked: 387 times
Been thanked: 447 times
Contact:

Re: force EDITOR to temporarily loose connection in V1.70

Post by PeterN »

[Local Link Removed for Guests] wrote: [Local Link Removed for Guests]Tue Jan 28, 2025 4:23 pm
At the same time, what do you expect to have in the variable watcher with this character (248)?
It is not a printable character, after all ...
No, just the other way around
I did not want the Editor to be crashed by an unwanted included white character
Post Reply