Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 19:29 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 a21+  NTP rework

     Page 2 of 2    
Author Message
TassyJim

Guru

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

  Andrew_G said  Given the sensitivities of sharing a USB hub that Jim has observed I'll need to be careful to program the two Picos separately but run them off a common supply.

You can share a hub OK, just don't try and connect (or reboot) while the other one is connected and in use. And it could just be my gear...

Jim
VK7JH
MMedit   MMBasic Help
 
lizby
Guru

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

My notetaking has not been up to par.

Can someone provide a link to the post (or posts) in which commands are shown and explained which can be used at the ">" prompt, e.g., Files, Kill, Save, Run, Rmdir, Rename, Drive, Load, Sort; are there others?

Also, I think I saw recently that Peter implemented Tom's parameter for a command, maybe RUN? Which alpha/release, and can someone provide a link for the explanation of that?

Is there space to provide a list of possibilities for, say, LIST MM.INFO to show what you can query?

~
Edited 2023-03-08 04:41 by lizby
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4047
Posted: 07:29pm 07 Mar 2023
Copy link to clipboard 
Print this post

  lizby said  Also, I think I saw recently that Peter implemented Tom's parameter for a command, maybe RUN? Which alpha/release, and can someone provide a link for the explanation of that?


Actually Tom implemented it ;-) It's apparently in 5.07.07b25 for all PicoMites

Syntax of the RUN command is now:
RUN [filename$] [, cmdline$]


Both filename$ and cmdline$ can be string expressions.

The value of cmdline$ is copied into the MMBasic constant MM.CMDLINE$ of the program RUN.

At the prompt you can also use the * shortcut:
*foo --wom --bat "fubar"


This is equivalent to:
RUN "foo", "--wom --bar " + Chr$(34) + "fubar" + Chr$(34)


Note how the * form does not try to evaluate any string expression in the command line arguments.

MMB4W and MMB4L also support the above (though MM.CMDLINE$ is implemented as an inbuilt function rather than a constant on those platforms). These platforms also contain best-effort support for the original (CMM2) command line format:
' Don't do this it's problematic
RUN "foo", --wom --bat "fubar"


I don't think Peter has updated the CMM2 for consistency, perhaps he will at some future point.

Best wishes,

Tom
Edited 2023-03-08 05:29 by thwill
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
lizby
Guru

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

  thwill said  It's apparently in 5.07.07b25 for all PicoMites


Thanks, Tom. Also in Picomiteweb Version 5.07.07a20. That makes it easier for me to test various web pages.

> run "web.bas","gretx.htm"
sending gretx.htm

  ElseIf Instr(ss$,"HTTP") Then
    if mm.cmdline$<>"" then
      Print "sending "+mm.cmdline$
      WEB transmit page ii%,mm.cmdline$
    else
      Print "sending page"
      WEB transmit page ii%,"clock.htm"
    endif
  EndIf


~
Edited 2023-03-08 06:27 by lizby
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
Andrew_G
Guru

Joined: 18/10/2016
Location: Australia
Posts: 847
Posted: 08:44pm 07 Mar 2023
Copy link to clipboard 
Print this post

Jim,
Thanks for that - it will be easier if I can use the hub for both.
Not a big deal but I suppose its not easy to have two MMEdit and MMCC sessions running at once? (one for each Pico) I 'think' version 4 could?

Cheers,

Andrew
 
nbrok

Regular Member

Joined: 13/02/2023
Location: Netherlands
Posts: 60
Posted: 08:58pm 07 Mar 2023
Copy link to clipboard 
Print this post

Hi,

When I execute:

web ntp 1,"ntp.time.nl"

I get sometimes an Error : NTP timeout:

ntp address 94.198.159.14
Error : NTP timeout

It is not the nameserver because I get the ip address of the server.

web ntp 1

Does work correctly. Perhaps something to have a closer look on?
Edited 2023-03-08 07:00 by nbrok
Greetings,
Nick de pe1goo
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3817
Posted: 09:43pm 07 Mar 2023
Copy link to clipboard 
Print this post

  lizby said  Can someone provide a link to the post (or posts) in which commands are shown and explained which can be used at the ">" prompt, e.g., Files, Kill, Save, Run, Rmdir, Rename, Drive, Load, Sort; are there others?

Like most BASICs you can execute most things at a prompt.

They're in the manual under Commands (and you can use expressions in things like PRINT, as it's a BASIC).

See also the manual under Predefined Read Only Variables.

John
 
lizby
Guru

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

  JohnS said  They're in the manual under Commands (and you can use expressions in things like PRINT, as it's a BASIC).

See also the manual under Predefined Read Only Variables.


Thanks. More of them are in the manual than I realized--but RUN does not yet show the [,cmdline$] parameter which I was specifically looking for, and MM.INFO$() does not, I believe, include all the Predefined Read Only Variables which can now be accessed. I know it's a moving target.
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9144
Posted: 10:44pm 07 Mar 2023
Copy link to clipboard 
Print this post

  Quote  web ntp 1,"ntp.time.nl"

I get sometimes an Error : NTP timeout:

ntp address 94.198.159.14
Error : NTP timeout

It is not the nameserver because I get the ip address of the server.

web ntp 1


That can only mean the NL ntp server isn't very reliable or is very slow to respond. If you omit the server then it uses pool.ntp.org with exactly the same code
Edited 2023-03-08 08:46 by matherp
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2141
Posted: 10:48pm 07 Mar 2023
Copy link to clipboard 
Print this post

The manuals usually only get updated with full release versions of the firmware. Most changes since then are in PicoMite_readme.txt in latest Beta zip.
There is more info in posts here. Search for the items in that file.
 
JanVolk
Senior Member

Joined: 28/01/2023
Location: Netherlands
Posts: 145
Posted: 10:59pm 07 Mar 2023
Copy link to clipboard 
Print this post

Lizby,

You probably mean List Commands of List Functions?
Or
From page 12 manual.
F2 RUN
F3 LIST
F4 EDIT
F10 AUTO SAVE
F11 XMODEM RECEIVED
F12 SEND XMODEM
Function keys F1 and F5 to F9 can be customized with custom text.
See the OPTION FNKey command.

Or more the command you have to fill in at OPTION FNKey?

But you can also copy and paste Tera Term.
Type after: > files
Then you can hover over the name with the left mouse button that you want to load or edit.
Then you enter after > eg load " and then press the right mouse button and you only have to add a " after it.
You can move along the text with the cursor keys to edit it.

For example, I have all lines included in the file list with the file system commands and saved to the disk with empty memory.
Do improvise a bit with the characters so that the file system cannot respond when saving.

0_SD-FLASH:_Load_Run_Save_Files_Kill_Mkdir.bas
1_SD-FLASH:_Chdir_Rmdir_Seek_Rename_Input$.bas
2_SD-FLASH:_Dir$_Cwd$_Eof_Loc_Lof_Copy_Name.bas
3__SERIAL:_XMODEM_Send____'prbas'.bas
4__SERIAL:_XMODEM_Receive_'prbas'.bas
5_FLASH1-4:_SAVE_LOAD_RUN_LIST_ERASE_CHAIN_OVERWRITE.bas
6_DRIVE_AB:_DRIVE_'A:'=FLASH-INTERN.bas
7_DRIVE_AB:_DRIVE_'B:'=___SD-EXTERN.bas
8__SD_Copy:_Copy_'A:xxx'_to_'B:xxx'.bas
9__SD_Kill:_Kill_'A:*'_Kill_'A:xxx'.bas

Jan
 
lizby
Guru

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

  JanVolk said  You probably mean List Commands of List Functions?


No, I meant something like those commands, but for the Predefined Read Only Variables, or more particularly, for mm.info (since those seem to be added to with some regularity).
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
aFox
Regular Member

Joined: 28/02/2023
Location: Germany
Posts: 76
Posted: 12:59am 08 Mar 2023
Copy link to clipboard 
Print this post

Two thoughts

Using "http://icanhazip.com" returns an external or WAN IP
Normally this server returns very fast.

It would be nice if we could start and stop WLAN to reduce the power consumption in view of using batteries.
MicroPython code

To use a hotspot, the MicroPython code has to be network.WLAN(network.AP_IF).

Does PicoMiteWlan support hotspots?

Gregor
Edited 2023-03-08 11:28 by aFox
 
aFox
Regular Member

Joined: 28/02/2023
Location: Germany
Posts: 76
Posted: 11:02pm 10 Mar 2023
Copy link to clipboard 
Print this post

I figured out, that smartphone hotspots are supported by PicoMiteWeb.

Still I am missing

if((tp=checkstring(cmd, "TEXT"))){
or
if((tp=checkstring(cmd, "HTML"))){

within MMtcpserver.c

, so we could type

WEB TRANSMIT TEXT cb%, mText$
or
WEB TRANSMIT HTML cb%, mHtml$

My favorite is TEXT, because often I need for data transfer only
a CSV string without any HTML boilerplate code.

I think WEB TRANSMIT PAGE is a good idea, but to much runtime effort for a simple string.

A support of LONGSTRING would be nice too.

After some testing I can say, that it does not make sense to call
a PicoMiteWeb server without a 500 millisecond pause.

Via an Android hotspot I get a response time in a best case of 745 milliseconds overall. Sometimes it increases to 1280 milliseconds.
Within my home WiFi I get response time increases of up to 8.5 seconds.
The average is in this case 1 to 3 seconds.

Gregor
Edited 2023-03-11 10:23 by aFox
 
pwillard
Senior Member

Joined: 07/06/2022
Location: United States
Posts: 292
Posted: 01:54pm 11 Mar 2023
Copy link to clipboard 
Print this post

Using release 21.

I'm not sure what is going on.  My program (an LED clock) will run for most of the day... and then crash.  After the crash... the loaded program will be *gone* and I have to re-deploy it again since typing "LIST" responds with *nothing*.
 
     Page 2 of 2    
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024