Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 16:55 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 V5.07.07a24+ - Now with TFTP

     Page 3 of 5    
Author Message
twofingers
Guru

Joined: 02/06/2014
Location: Germany
Posts: 1245
Posted: 05:41pm 14 Mar 2023
Copy link to clipboard 
Print this post

  JohnS said  Now that \ starts an escape you need to change the strings.

(Ideally it wouldn't crash, though.)

John

You are right, John!
Now I have to replace all "\" with "\\".
causality ≠ correlation ≠ coincidence
 
lizby
Guru

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

I know the PicoMiteWeb supports MQTT for IoT-type communication, but for many years now I have used TCP or UDP messages--received with nc or netcat on an accumulator device.

Does the PicoMiteWeb support sending these?
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9139
Posted: 05:48pm 14 Mar 2023
Copy link to clipboard 
Print this post

  Quote  Now I have to replace all "\" with "\\"


Or use /
 
twofingers
Guru

Joined: 02/06/2014
Location: Germany
Posts: 1245
Posted: 05:54pm 14 Mar 2023
Copy link to clipboard 
Print this post

  matherp said  
  Quote  Now I have to replace all "\" with "\\"


Or use /

Correct, that's what I thought too. Thank you for that suggestion!
causality ≠ correlation ≠ coincidence
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6103
Posted: 09:05pm 14 Mar 2023
Copy link to clipboard 
Print this post

I sometimes use the old fashioned activity indicator.
I thought I would test it with the new escape sequences.
If I run this without doubling up the \ character, the pico reboots.

'
DO
INC p :PRINT CHR$(8)+MID$("|/-\|/-\",(p MOD 8)+1,1);
PAUSE 500
LOOP



It is the \ as the last character of the string that the pico doesn't like.

even a line like:
fred$ = "fred\"

is enough to lock up and require a reboot.

Jim
Edited 2023-03-15 07:13 by TassyJim
VK7JH
MMedit   MMBasic Help
 
Andrew_G
Guru

Joined: 18/10/2016
Location: Australia
Posts: 847
Posted: 09:02pm 15 Mar 2023
Copy link to clipboard 
Print this post

G'day all,
Pico-W version a25 is working well for me - thanks Peter!
I only want to access NTP and Openweather.
I'm trying to incrementally add to my program and I am at the stage of testing its response to a dodgy WiFi connection (I'm STILL living in a hotel and its WiFi is quite flaky at times).

1) How can I simulate a bad WiFi connection?

I've put the whole shebang into a large, thick stainless steal pot (with a s/s lid) and it doesn't falter (and I can't get at the hotel's WiFi to power it down).

2) My code is below. Should that identify that there was a connection problem but then carry on?

Cheers,

Andrew


Sub Get_NTP
 local string TempDate, TempTime
 local Integer Tmp
 ' NTP Timeout loop by TassyJim
 Tmp = 0
 TempDate = Date$'Preserve values in case NTP fails (old values OK for now)
 'ZZZTempTime = TIME$
 DATE$ = "01-04-2000"
 DO
   ON ERROR SKIP
   WEB NTP TZone+DST,"au.pool.ntp.org" 'DST = 0 or 1 via OW 'Timezone'
   if MM.ERRMSG$ <> "" then
     print MM.ERRMSG$; " skipped"
     Print Date$; " ";Time$
   Else
     Exit Do
   End If
   IF DATE$ = "01-04-2000" THEN
     PRINT "NTP Timed out. Tmp = ";Tmp
     PRINT #1, "NTP Timed out"
   End If
   INC Tmp
 LOOP UNTIL DATE$ <>"01-04-2000" OR Tmp > 4
 
 If Tmp > 4 then
   DAte$ = TempDate
   'ZZZTIME$ = TempTime
   print Date$; "  "; Time$; " retained"
 End if
 
 'WEB CLOSE TCP CLIENT  'ZZZ is this needed?
 
End Sub 'Get_NTP
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6103
Posted: 11:23pm 15 Mar 2023
Copy link to clipboard 
Print this post

Andrew,
I am still experimenting but currently I rely on a WATCHDOG and AUTO RUN
This usually lets the pico come back up within 30 seconds when it falls over.

The (good) problem is, I am not having many reboots now so it is slow work testing the various methods.

Peter is adding features quicker than I can test fully.

Jim
VK7JH
MMedit   MMBasic Help
 
Andrew_G
Guru

Joined: 18/10/2016
Location: Australia
Posts: 847
Posted: 11:51pm 15 Mar 2023
Copy link to clipboard 
Print this post

Thanks Jim.
I am just amazed that it works inside a s/s pot - so much for worrying about the effects of being shielded by an LCD!

Andrew
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2141
Posted: 12:00am 16 Mar 2023
Copy link to clipboard 
Print this post

Could the power cable be picking up the WiFi and carrying it in/out of the pot and reradiating it?

If you are using a battery and have no wires going in then it is surprising that enough can get between the lid and the pot.
 
Andrew_G
Guru

Joined: 18/10/2016
Location: Australia
Posts: 847
Posted: 04:05am 16 Mar 2023
Copy link to clipboard 
Print this post

Jim,
So you wouldn't bother with any of the 'ON ERROR . . ' stuff and just put a short watchdog timer in each of the DO-LOOPs. That is what I've done just now and after 2 hours its restarted once - without any problems (still in the cooking pot).
I have to use the pot in an hour or two for dinner.

Phil,
I'm running it off USB to the PC, with the USB as the console. With the lid fully closed and off a battery I cant see what it is doing? Or do you have a cunning plan?

Cheers,

Andrew
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6103
Posted: 04:35am 16 Mar 2023
Copy link to clipboard 
Print this post

Watchdog in the loop but not too short. This internet stuff can be slow.
Re the pot, to get a good Faraday shield, you really need two pot, one inside the other and no connection between the two.

Jim
VK7JH
MMedit   MMBasic Help
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2141
Posted: 04:41am 16 Mar 2023
Copy link to clipboard 
Print this post

"With the lid fully closed and off a battery I cant see what it is doing?"

Have the program continually update a web page with the time. View the page in a browser. If the displayed time stops ticking over when you put the lid on the signal is blocked.
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6103
Posted: 04:46am 16 Mar 2023
Copy link to clipboard 
Print this post

Running a25 and playing with telnet.

PicoMite MMBasic Version 5.07.07a25
OPTION CPUSPEED (KHz) 250000
OPTION WIFI hoth_e, **********
OPTION TCP SERVER PORT 80, 10000
OPTION TELNET CONSOLE ON


I noticed that when the pico is sending end-of-line, instead of '0d 0a', we get '0d 00 0a'

More important, I can do a list all, option list etc no worries.

FILES on the USB connection is OK but FILES through the Telnet causes an instant system lockup.

It works when there are only a few files but doesn't like a page full.

Edit: I think it is the zero bytes in the '0d 00 0a' that is upsetting my file manager.

Jim
Edited 2023-03-16 16:43 by TassyJim
VK7JH
MMedit   MMBasic Help
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9139
Posted: 08:48am 16 Mar 2023
Copy link to clipboard 
Print this post

  Quote  I noticed that when the pico is sending end-of-line, instead of '0d 0a', we get '0d 00 0a'


This is correct for telnet. The receiver has to strip them. Also look up the "255" character. This is also a special case that needs dealing with
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6103
Posted: 08:51am 16 Mar 2023
Copy link to clipboard 
Print this post

  matherp said  
  Quote  I noticed that when the pico is sending end-of-line, instead of '0d 0a', we get '0d 00 0a'


This is correct for telnet. The receiver has to strip them. Also look up the "255" character. This is also a special case that needs dealing with


OK,
I can filter them out.

Jim
VK7JH
MMedit   MMBasic Help
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9139
Posted: 08:52am 16 Mar 2023
Copy link to clipboard 
Print this post

Jim

See this thread
 
TassyJim

Guru

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

A few years ago I tried to work out what advantages Telnet had over a plain data stream and decided it wasn't worth the effort.

I will have to take another look.

Jim
VK7JH
MMedit   MMBasic Help
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6103
Posted: 08:24pm 18 Mar 2023
Copy link to clipboard 
Print this post

Making progress with Telnet friendly XMODEM. I have a timing issue that makes transfers incredibly slow to get started. Once past the first packet, speed is as it should be.
I need more time to investigate.

Any sane user would install/activate TFTP and use that instead of XMODEM. I have MMEdit's file manager talking to TFTP reliably.

One problem I have found.
When you close a Telnet session, either TeraTerm or MMEdit, one minute later the picoW reboots.


Jim
VK7JH
MMedit   MMBasic Help
 
Hans

Senior Member

Joined: 18/10/2022
Location: Canada
Posts: 116
Posted: 08:34pm 18 Mar 2023
Copy link to clipboard 
Print this post

  TassyJim said  

One problem I have found.
When you close a Telnet session, either TeraTerm or MMEdit, one minute later the picoW reboots.

Jim


I have also found that it will erase whatever is in the editor when it does. I have tried 3 different Telnet clients and they all exibit the same issue, BY TIMES.

No clue what's up with that!?!?

The solution for me was to set OPTION AUTORUN 1 and to exit with CPU RESTART, I am also running a WATCHDOG timer to restart.

Hans ...
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6103
Posted: 08:47pm 18 Mar 2023
Copy link to clipboard 
Print this post

  TassyJim said  One problem I have found.
When you close a Telnet session, either TeraTerm or MMEdit, one minute later the picoW reboots.


I should add, trying to monitor the pico through the USB port stops the pico from rebooting.
Until you disconnect the pico USB link (not the power, just the software link).
Then it reboots immediately if the telnet one minute has been reached.
VK7JH
MMedit   MMBasic Help
 
     Page 3 of 5    
Print this page
© JAQ Software 2024