Posted: 07:47am 02 May 2024 Copy link to clipboard
Malibu Senior Member
Ahh, OK... thanks Gents. I presumed it was a timeout, but with no reference I didn't want to take it for granted.
The manuals are top-notch anyway, SOMEthing, sometimes gets missed somewhere. I was just curious, thinking maybe I'd missed a vital clue
Posted: 07:44am 03 May 2024 Copy link to clipboard
OA47 Guru
I am aware that this lockup in the software is different to that being covered by this thread as it didn't show the error code. I am curious to see that the code recovered but the watchdog timer did not restart the program and the program dropped to a prompt after reconnecting.
ntp address 67.219.111.127 got ntp response: 03/05/2024 17:00:00 [133] WEB TCP CLIENT REQUEST Query, buff%() Error : No connection Error: Invalid address - resetting PICOE66178758B3 connecting to WiFi... Connected 192.168.1.115
Would this be the effect of the ON ERROR SKIP?
0A47
Posted: 10:00am 03 May 2024 Copy link to clipboard
TassyJim Guru
Option Autorun ON ?
Posted: 10:02am 03 May 2024 Copy link to clipboard
OA47 Guru
Thanks Jim, Autorun on is back now.
0A47
EDIT But!!!!
> option autorun on > option list WebMite MMBasic Version 5.08.00 OPTION SYSTEM SPI GP18,GP19,GP16 OPTION SYSTEM I2C GP26,GP27 OPTION AUTORUN ON OPTION LCDPANEL ILI9488, RLANDSCAPE,GP15,GP14,GP13,GP17 OPTION WIFI ???????, ?????? , PICOE66178758B3 OPTION TOUCH GP12,GP11 OPTION SDCARD GP22 OPTION AUDIO GP2,GP3', ON PWM CHANNEL 1 > run [133] WEB TCP CLIENT REQUEST Query, buff%() Error : No connection >
Still locks at prompt after run. Will see what happens.
0A47 Edited 2024-05-03 22:14 by OA47
Posted: 11:37am 03 May 2024 Copy link to clipboard
phil99 Guru
I may have this wrong but I believe certain errors cause OPTION AUTORUN to be removed to prevent an infinite loop of crash - reboot - run - crash.
If you don't think that is going to be an issue apply OPTION AUTORUN OFF then add this to the top of the program:-
Sub MM.Startup : Run : End Sub
So far that has worked for me.
Edit.
As far as I know that has always been the case. Not connecting at start-up causes a crash, WiFi needs to be available before booting. Edited 2024-05-04 07:22 by phil99
Posted: 09:33pm 03 May 2024 Copy link to clipboard
OA47 Guru
Thanks Phil, that explains why the Option AUTORUN disappears.
0A47
Posted: 10:02pm 03 May 2024 Copy link to clipboard
Malibu Senior Member
I think this is related - from the manual...
Posted: 02:22am 04 May 2024 Copy link to clipboard
TassyJim Guru
As far as I now, "Error : No connection" refers to the WEB OPEN connection, not WiFi.
WEB OPEN TCP CLIENT "xxxx", 80 WEB TCP CLIENT REQUEST Query, buff%() WEB CLOSE TCP CLIENT
He is getting past his NTP so the WiFi is running OK.
"Error: Invalid address - resetting" indicates that you are heading to a cancelled autorun and a softreset The reason could be anyof these:.
Posted: 08:02pm 05 May 2024 Copy link to clipboard
Malibu Senior Member
So, I've been running tests for a few days (VB to WM on TCP port 1111 and sending regular packets when a timer fires)
MMbasic ver 5.09.00RC4
As yet, I haven't seen the error code in the subject line crop up... Thanks Peter, maybe it's the last we've seen of that one?
Still having a lot of random freezes, so just trying to work through some ideas there.
Posted: 08:34am 09 May 2024 Copy link to clipboard
TassyJim Guru
I have a test device running with no attempts to connect to it. It suffers from the random CYW43 failures. With the watchdog in service this resulted in reboots.
I have disabled the watchdog and have noticed something interesting.
When the device fails it stops for 4310 seconds and then carries on as if nothing had happened. It is always 4310 seconds +/- rounding errors.
I don't know of any significance with 4310 seconds. ~72 minutes.
Jim
Posted: 12:53pm 09 May 2024 Copy link to clipboard
JohnS Guru
Just about possibly: 32-bit unsigned 4294967296 so maybe a counter 1000000 per second (i.e. in uS)
Would be 4294 or 4295, though, which is 15 secs or so different.
John
Posted: 05:25am 10 May 2024 Copy link to clipboard
Malibu Senior Member
An interesting observation Jim. I don't think mine had ever done that, but maybe I never waited long enough to find out. I've had several CYW43 messages in a row as though it was in a loop, but I still had to do a hard reset to clear them.
So far for the last week or so, I've had no CYW43 errors (Maybe Peter's fixed the issue, or it's just not 'the time' for it to happen), but I've had plenty of freeze ups (some fire the W/D, some don't). I haven't made any conclusions on the why's as yet. I even played with the idea of inserting 'wait-states', like in the old 232 comms to maybe slow things down, just in case the client wasn't as quick as the WebMite. It didn't work, but it was just an idea
Still plodding on though
[Edit] Not sure what the 4310 seconds could mean. Maybe JohnS above is correct? Edited 2024-05-10 15:27 by Malibu
Posted: 07:44am 10 May 2024 Copy link to clipboard
Malibu Senior Member
There's one thing I haven't been able to understand during my coding and testing... Consider the following code:
First up, the VB code I'm running that simply 'talks' to the WebMite... (commented, but simple enough to follow)
Option Explicit Private Declare Function GetTickCount Lib "kernel32" () As Long 'here is the high speed timer
Private HitNum As Double 'count how many packets are sent variable Private StartTick As Long 'store the tick count value variable
Private Sub Form_Load() HitNum = 0 'reset the count variable End Sub
Private Sub Form_Unload(Cancel As Integer) Winsock1.Close 'close the winsock connection End Sub
Private Sub Timer1_Timer() 'timer function Winsock1.Close 'close the winsock While Winsock1.State <> 0 'if we haven't closed, loop here until we have DoEvents Wend Winsock1.Connect "192.168.0.114", 1111 'connect to this IP address and port StartTick = GetTickCount 'get the start tick While Winsock1.State <> 7 'loop until we've actually connected Text1.Text = "Connecting..." 'show that it's trying to connect DoEvents Wend End Sub
Private Sub Winsock1_Connect() 'connection is established HitNum = HitNum + 1 'add to the value Winsock1.SendData "VB Hit " & HitNum 'assemble the text and send it Text1.Text = "Waiting for reply No. " & HitNum 'show that we're waiting for a reply End Sub
Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long) 'Something has been received Dim RecStr As String Winsock1.GetData RecStr 'get what came in Text2.Text = "Reply Text - " & RecStr 'show the data received Text4.Text = GetTickCount - StartTick 'show the time taken between sending & receiving End Sub
...and then the WM code I'm running...
Option EXPLICIT Option DEFAULT NONE Option autorun on
WEB TCP INTERRUPT WebInterrupt do Watchdog 20000 loop
sub WebInterrupt local Integer ConnNum local integer ConnData(512) for ConnNum = 1 to mm.info(Max Connections) longstring clear ConnData() web tcp read ConnNum, ConnData() if llen(ConnData()) > 0 then web tcp Send ConnNum, ConnData() end if web tcp close ConnNum next ConnNum end sub
So, the VB code send a TCP request at 1 second intervals, the WM receives it and send out the data that came in then displayed in a text box in VB. Simple enough, and I would think that the 'round trip time' between send and receive would be pretty much the same (within reason...)
But, the round trip time can vary a huge amount. I've seen as low as 12ms and as much as 500ms for the exact same code, running in the same session.
Should the round trip be close to the same, or is there something else going on?
Posted: 08:49pm 10 May 2024 Copy link to clipboard
led-bloon Senior Member
Try: Limit loop 'ConnNum' to one iteration only See if there is any changes. led
Posted: 06:06am 11 May 2024 Copy link to clipboard
Malibu Senior Member
Yep, I like the way you're thinking, led - been down that path a few times already. Naturally, thought I better do it ONE more time, just to be really, really, really sure!
Single iteration results -
FOR/TO loop results -
Showing MAX, MIN & AVG ticks and which data packet did the deed. There's some differences in the two, but no real reason that could be nailed down.
The WM code only responds if the packet has data in it and the VB code only counts the local trip time, so only really counts a single iteration in 'local time' anyway
Posted: 09:25pm 11 May 2024 Copy link to clipboard