1. *** New version of B4J is available ***
    B4J v7.8
    Dismiss Notice

B4R Question Random characters in log

Discussion in 'B4R Questions' started by RJB, Jul 9, 2019.

  1. RJB

    RJB Active Member Licensed User

    I'm sure I've seen something about this before but can't find it now.
    At startup the B4R log shows random characters in the log. This isn't normally a problem but I'm trying to test the deep sleep function of the 8266. This mans that every time it restarts and something is sent to the log these characters are displayed. The 'copy all to clipboard' ability of the log window also doesn't seem to work properly so may be related?
    Is it possible to stop these characters being sent to the log?
  2. Erel

    Erel Administrator Staff Member Licensed User

    You are seeing the data exactly as it is received from the device. There are no filters.

    You can add something like this when the program starts:
    For i = 1 to 10 
  3. RJB

    RJB Active Member Licensed User

    That will make it a bit more readable but when the device is continually re-starting, i.e. from deep sleep, then the log will fill up much quicker.
    Is there any way to tell the device not to send the characters/ to clear it's buffer first?
    If I could copy the whole log then at least I could look at it/ search in Notepad or Word but it only copies a few lines. Presumably something in the random characters stops it?
  4. Erel

    Erel Administrator Staff Member Licensed User

  5. emexes

    emexes Well-Known Member Licensed User

    If this is happening when going in to or (more likely) out of deep sleep mode, then one possibility is that the UART is being put to sleep in the middle of transmitting a byte. When it later wakes up, it merrily sends the remaining part of byte, which will be misinterpreted by the receiving UART of the serial-to-USB bridge.

    You could try forcing the junk to occur by sending a long log just before going into sleep mode.

    Or you could send a short log last thing before sleeping and first thing after waking, with a (say) 1-10 ms delay after the going-to-sleep log, eg:
    10)    'allow enough time for this message to get through the UART and USB bridge


    2)    'perhaps also try giving the log UART a moment to spin up
  6. tigrot

    tigrot Well-Known Member Licensed User

    This happen in most uart also on larger computers. First chars are often corrupted.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice