R RJB Active Member Licensed User Longtime User Jul 9, 2019 #1 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? Thanks
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? Thanks
Erel B4X founder Staff member Licensed User Longtime User Jul 9, 2019 #2 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: Code: For i = 1 to 10 Log("*****************************") Next Upvote 0
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: Code: For i = 1 to 10 Log("*****************************") Next
R RJB Active Member Licensed User Longtime User Jul 9, 2019 #3 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? Upvote 0
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?
Erel B4X founder Staff member Licensed User Longtime User Jul 9, 2019 #4 The only way that you can filter these characters is by using the external serial connector: https://www.b4x.com/android/forum/threads/tool-external-serial-connector.65724/#content You can program it to discard characters until it finds a specific string. Upvote 0
The only way that you can filter these characters is by using the external serial connector: https://www.b4x.com/android/forum/threads/tool-external-serial-connector.65724/#content You can program it to discard characters until it finds a specific string.
E emexes Expert Licensed User Longtime User Jul 9, 2019 #5 RJB said: 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. Click to expand... 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: Code: Log("Sleeping") Sleep(10) 'allow enough time for this message to get through the UART and USB bridge GoToDeepSleepMode Sleep(2) 'perhaps also try giving the log UART a moment to spin up Log("Waking") Upvote 0
RJB said: 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. Click to expand... 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: Code: Log("Sleeping") Sleep(10) 'allow enough time for this message to get through the UART and USB bridge GoToDeepSleepMode Sleep(2) 'perhaps also try giving the log UART a moment to spin up Log("Waking")
tigrot Well-Known Member Licensed User Longtime User Jul 9, 2019 #6 This happen in most uart also on larger computers. First chars are often corrupted. Upvote 0