Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 06:05 29 Nov 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : PicoMiteWeb alphas a14+, now with added Telnet

     Page 3 of 5    
Author Message
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3815
Posted: 10:15am 16 Feb 2023
Copy link to clipboard 
Print this post

  Pluto said  Pico W crash

Can the odd crashes be caused by Wi-Fi Reliability?
  Quote  One reason why programs fail over a long period of time involves Wi-Fi reliability. If your Wi-Fi becomes unreliable, the Pico W's first instinct is to crash.


  Quote  


/Pluto

I can't be sure but I think that's one person's (somewhat workable) ideas but I wonder if the RPi foundation would say otherwise? Preferably with a better work-around!

If lost, you'd hope that the connection could be re-made & the transfers resumed.

John
 
atmega8

Guru

Joined: 19/11/2013
Location: Germany
Posts: 722
Posted: 02:18pm 16 Feb 2023
Copy link to clipboard 
Print this post

print mm.ver
5.070716



Why this?


OPTION WIFI pabu19, mypassword
Error : Expected a string

What is wrong?
Edited 2023-02-17 00:20 by atmega8
 
atmega8

Guru

Joined: 19/11/2013
Location: Germany
Posts: 722
Posted: 02:23pm 16 Feb 2023
Copy link to clipboard 
Print this post

OPTION WIFI "pabu19", "mypw"


PicoMite MMBasic Version 5.07.07a16
OPTION WIFI pabu19, *****************


OK, but how can i connect?
 
twofingers
Guru

Joined: 02/06/2014
Location: Germany
Posts: 1245
Posted: 02:46pm 16 Feb 2023
Copy link to clipboard 
Print this post

@atmega

After OPTION WIFI pabu19, *****************
and a restart you should be connected.
The Pico shows the IP.*

Regards
Michael

EDIT:
* You should see the message "Connected 192.***.***.***". (See the first page of this thread.)
You can then activate the telnet mode (e.g. Option Telnet Console ON) or/(and) install a website (HTML + .bas) on the Pico's flash drive (Xmodem).
Edited 2023-02-17 00:58 by twofingers
causality ≠ correlation ≠ coincidence
 
atmega8

Guru

Joined: 19/11/2013
Location: Germany
Posts: 722
Posted: 03:07pm 16 Feb 2023
Copy link to clipboard 
Print this post

  twofingers said  @atmega

After OPTION WIFI pabu19, *****************
and a restart you should be connected.
The Pico shows the IP.*

Regards
Michael

EDIT:
* You should see the message "Connected 192.***.***.***". (See the first page of this thread.)
You can then activate the telnet mode (e.g. Option Telnet Console ON) or/(and) install a website (HTML + .bas) on the Pico's flash drive (Xmodem).



Got it,


THX
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9139
Posted: 05:25pm 16 Feb 2023
Copy link to clipboard 
Print this post

Jim

Please try the attached - it has lots of diagnostics enabled.


PicoMiteWeb (2).zip


Set to TELNET ONLY but open a USB connection then run your program from Telnet.
You should see lots of diagnostics on the USB console.

You can disconnect and then reconnect the Telnet console - that should now be benign

If/when it hangs up then perhaps we can see what is happening.

Thanks for your help
 
Doktorn

Newbie

Joined: 09/07/2019
Location: Sweden
Posts: 9
Posted: 06:24pm 16 Feb 2023
Copy link to clipboard 
Print this post

I don't know if this have anything to do with the Wi-Fi reliability but I change the setting on my AP to 802.11 N only.
Now my Pico W have been running open weather API ( update every 5 min ) for more than 12 hours.
N/A
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6102
Posted: 07:59pm 16 Feb 2023
Copy link to clipboard 
Print this post

  matherp said  Jim

Please try the attached - it has lots of diagnostics enabled.

Will do but it won't be until later today. About 10 hours from now.
Jim
VK7JH
MMedit   MMBasic Help
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6102
Posted: 07:20am 17 Feb 2023
Copy link to clipboard 
Print this post

Attached is a log file.

log_170223.zip

I have noticed that when my bas program stops during WEB TRANSMIT, the pico heartbeat stops but the logging continues, faithfully logging the Telnet keep alive bytes every 5 minutes.

I also loaded micropython onto one of my picoWs and ran an example program. The python web server is no faster than the MMBasic one. Possibly slower to return a page than the MMBasic so I can't see much improvement likely. Hopefully, I am wrong)

I will leave the system running over night with the web access turned of to see if it locks up on it's own.

I also need to change MMEdit so capturing logs includes the timestamp.
Always something to do...

Jim
VK7JH
MMedit   MMBasic Help
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9139
Posted: 12:07pm 17 Feb 2023
Copy link to clipboard 
Print this post

Eureka

I hope

Analysing the various outputs and tuning the diagnostic prints I think I've established that on occasion browsers will make a connection but not send any data. Up until now the firmware only closes the connection when MMbasic responds to a request. I've now put a timer on each connection. The timer is reset whenever activity takes place on the connection but if there is no activity for 5 seconds I now close the connection.

Currently I have 4 different browsers running a total of 7 copies of Jim's program with the addition of the tiger picture and it has been running for 20 minutes. Previously this sort of load would crash it pretty quickly

Keep you fingers crossed. If I make the 2 hour mark I'll post an update
 
atmega8

Guru

Joined: 19/11/2013
Location: Germany
Posts: 722
Posted: 02:47pm 17 Feb 2023
Copy link to clipboard 
Print this post

  matherp said  Eureka

I hope

Analysing the various outputs and tuning the diagnostic prints I think I've established that on occasion browsers will make a connection but not send any data. Up until now the firmware only closes the connection when MMbasic responds to a request. I've now put a timer on each connection. The timer is reset whenever activity takes place on the connection but if there is no activity for 5 seconds I now close the connection.

Currently I have 4 different browsers running a total of 7 copies of Jim's program with the addition of the tiger picture and it has been running for 20 minutes. Previously this sort of load would crash it pretty quickly

Keep you fingers crossed. If I make the 2 hour mark I'll post an update


Keep my Fingers cross ;-)

THX for all you are doing for this awesome MMBASIC

Dietmar
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9139
Posted: 03:05pm 17 Feb 2023
Copy link to clipboard 
Print this post

V5.07.07a17


PicoMiteWebV5.07.07a17.zip

If TCP server mode  is set on your Pico then after installing this please execute the command

OPTION TCP SERVER 80 [, timeout]

BEFORE DOING ANYTHING ELSE

This is needed to set the timer used to close stuck connections. The time is in milliseconds and defaults to 5000

Otherwise you should not see any differences between this and a17 but there is a major re-write of the TCP server code under the covers

There are three conditions that are now handled
1. a client connects but does not send a request
2. a client connects and makes a request while you are running a program but you don't respond within the timeout period
3. a client connects and makes a request while you are at the command prompt

The server now acts as follows:

1. the connection will timeout based on the timer set in OPTION TCP SERVER and be closed completely transparently
2. This causes an error condition - you will get the Basic error "Error: No response to request from connection no n"
3. the server will automatically send a 404 code (page not found)

I have run this with a number of browsers updating every 10 seconds and it seems stable. You can of course overload the ability of Basic to respond to the incoming requests in which case you will see an error but hopefully this is more robust than before.

Edited 2023-02-18 01:05 by matherp
 
homa

Guru

Joined: 05/11/2021
Location: Germany
Posts: 351
Posted: 03:46pm 17 Feb 2023
Copy link to clipboard 
Print this post


Thanks Peter,
also for the detailed explanation.

I started a long term test with the a16 yesterday. Only USB console, the small web sample program, and only firefox browser from my PC, laptop, and mobile. My network is running streaming, sip telephony, and 3 kids :-)

I once recorded the different access times from the PC.
Test of a string: mystring is 16-02-2023 18:39:29
Test of a string: mystring is 16-02-2023 19:00:23
Test of a string: mystring is 16-02-2023 21:03:06
Test of a string: mystring is 16-02-2023 21:52:46
Test of a string: mystring is 17-02-2023 07:16:04
Test of a string: mystring is 17-02-2023 08:27:52
Test of a string: mystring is 17-02-2023 16:11:26
Test of a string: mystring is 17-02-2023 16:16:03
Test of a string: mystring is 17-02-2023 16:37:06

That's almost 24h of stable running.
Almost funny, just now as I am writing these lines the error message appears in the console:

...
String is POST / HTTP
sending page
Error: Invalid address - resetting
PicoMiteWeb MMBasic Version 5.07.07a16
Copyright 2011-2023 Geoff Graham
Copyright 2016-2023 Peter Mather

Connecting to WiFi...
Connected 192.168.1.109
Starting server at 192.168.1.109 on port 80
> run
> load "server2.bas
> run
ntp address 172.104.134.72
got ntp response: 17/02/2023 16:42:55
...

By the way, I run the Picomite at its default frequency.
Now I will repeat the whole thing with the a17!



I deactivated and reactivated the tcp server option as a precaution.
Above in your example the port is missing, I thought you have a new syntax.
Then when activating the Picomite crashed!
I had to unplug the USB and plug it back in (---X---).



Connecting to WiFi...
Connected 192.168.1.109
Starting server at 192.168.1.109 on port 80
> option list
PicoMite MMBasic Version 5.07.07a17
OPTION COLOURCODE ON
OPTION WIFI xxx, *****************
OPTION TCP SERVER PORT 80
OPTION TELNET CONSOLE ON
> option tcp server port 0
Connecting to WiFi...
Connected 192.168.1.109
> option list
PicoMite MMBasic Version 5.07.07a17
OPTION COLOURCODE ON
OPTION WIFI xxx, *****************
OPTION TELNET CONSOLE ON
> OPTION TCP SERVER 80
Error : Expression syntax
> OPTION TCP SERVER Port 80, 5000
(---X---)
PicoMiteWeb MMBasic Version 5.07.07a17
Copyright 2011-2023 Geoff Graham
Copyright 2016-2023 Peter Mather

Connecting to WiFi...
Connected 192.168.1.109
Starting server at 192.168.1.109 on port 80
>

Edited 2023-02-18 01:58 by homa
 
Hans

Senior Member

Joined: 18/10/2022
Location: Canada
Posts: 116
Posted: 05:02pm 17 Feb 2023
Copy link to clipboard 
Print this post

  matherp said  V5.07.07a17


PicoMiteWebV5.07.07a17.zip

If TCP server mode  is set on your Pico then after installing this please execute the command

OPTION TCP SERVER 80 [, timeout]

BEFORE DOING ANYTHING ELSE

This is needed to set the timer used to close stuck connections. The time is in milliseconds and defaults to 5000



Just tried and ....

1) You get a syntax error without the word "PORT"
2) The timeout does not show with the OPTION List

Thanks,
Hans ....
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9139
Posted: 05:13pm 17 Feb 2023
Copy link to clipboard 
Print this post

  Quote  You get a syntax error without the word "PORT"


Typo in my post - sorry

  Quote  The timeout does not show with the OPTION List


Will fix but like all options it will only show if not default (5000)

PS I'm probably going to change this anyway to allow 3 ports to be used

Telnet, HTTP, and other
Edited 2023-02-18 03:15 by matherp
 
bigfix
Senior Member

Joined: 20/02/2014
Location: Austria
Posts: 128
Posted: 05:18pm 17 Feb 2023
Copy link to clipboard 
Print this post

  Quote  PS I'm probably going to change this anyway to allow 3 ports to be used

Telnet, HTTP, and other


MQTT would  be great for IOT devices
Became a de facto standard in home automation/control

Tasmota and many proprietary actors/sensors support it
They could then act as I/O to the WEBmite
 
Hans

Senior Member

Joined: 18/10/2022
Location: Canada
Posts: 116
Posted: 05:19pm 17 Feb 2023
Copy link to clipboard 
Print this post

  matherp said  
  Quote  The timeout does not show with the OPTION List


Will fix but like all options it will only show if not default (5000)

PS I'm probably going to change this anyway to allow 3 ports to be used

Telnet, HTTP, and other


I did test that, it was set to 6000 when it did not show.


Hans ...
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3152
Posted: 06:41pm 17 Feb 2023
Copy link to clipboard 
Print this post

After flashing a17 and running "OPTION TCP SERVER PORT 80, 6000", when I run the program I've been testing, after I enter "192.168.1.224" in the browser window, I get:

Error: Invalid address - resetting
PicoMiteWeb MMBasic Version 5.07.07a17
Copyright 2011-2023 Geoff Graham
Copyright 2016-2023 Peter Mather

Connecting to WiFi...
Connected 192.168.1.224
Starting server at 192.168.1.224 on port 80
>

(I'm also not seeing the ", 6000" when I do OPTION LIST.)
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9139
Posted: 07:56pm 17 Feb 2023
Copy link to clipboard 
Print this post

V5.07.07b18


PicoMiteWebV5.07.07a18.zip


Fixes the display of the timeout + big speed improvement in displaying web pages and small images

To ensure you have a clean start this will delete all options but not the flash disk


lizby

Clearly I don't get that. If you see that sort of issue use clean_flash and start from scratch. If that doesn't work I would need much more information on the sequence that created the issue.
 
homa

Guru

Joined: 05/11/2021
Location: Germany
Posts: 351
Posted: 08:59pm 17 Feb 2023
Copy link to clipboard 
Print this post


WOW, incredible the speed increase!

A small glitch, when entering: OPTION TELNET CONSOLE ON
picomite stopped working.
Restart and entered more OPTIONs - running!

> option list
PicoMite MMBasic version 5.07.07a18
OPTION COLORCODE ON
OPTION WIFI xxx, *****************
OPTION TCP SERVER PORT 80
OPTION TELNET CONSOLE ON
>
 
     Page 3 of 5    
Print this page
© JAQ Software 2024