Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 02:40 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 : PicoMite/PicoMiteVGA/WebMite V5.07.07 release candidates

     Page 3 of 13    
Author Message
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4253
Posted: 06:39am 13 Apr 2023
Copy link to clipboard 
Print this post

Hi Peter,

I'll adapt the program to the RC4 implemented commands.
Already 90% there...

Volhout
PicomiteVGA PETSCII ROBOTS
 
Andrew_G
Guru

Joined: 18/10/2016
Location: Australia
Posts: 847
Posted: 01:47am 15 Apr 2023
Copy link to clipboard 
Print this post

Hi Peter (et al),
WEB SCAN m%() works a treat - thanks.
With a bit of fiddling I can now list just the SSIDs (sometimes 10 in my hotel - all with dodgy strengths and not all available to me).

Two related questions:
- is it easy to ascertain the signal strength of each? (I'd then use the strongest)
- is it possible to, within code, identify which one the WebMite is connected to. I'm thinking either a command in the code or if "OPTION LIST" could be sent to a LONGSTRING, ie
OPTION LIST [m%()] - if there is no m% specified it goes to the console (a la WEB SCAN).

Many thanks,

Andrew
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2140
Posted: 02:09am 15 Apr 2023
Copy link to clipboard 
Print this post

RSSI: seems to be an indicator of strength.

> web scan

Performing wifi scan
ssid: WiFi-****                        rssi:  -46 chan:   6 mac: 7c:8b:ca:a2:**:** sec: 5
ssid: TP-Link_Guest_****               rssi:  -48 chan:   6 mac: 62:8b:ca:a2:**:* *sec: 5
>


Shielding the Pico makes it more negative.

> web scan

Performing wifi scan
ssid: WiFi-****                        rssi:  -65 chan:   6 mac: 7c:8b:ca:a2:**:** sec: 5
ssid: TP-Link_Guest_****               rssi:  -66 chan:   6 mac: 62:8b:ca:a2:**:** sec: 5
>

Edited 2023-04-15 12:14 by phil99
 
Andrew_G
Guru

Joined: 18/10/2016
Location: Australia
Posts: 847
Posted: 03:02am 15 Apr 2023
Copy link to clipboard 
Print this post

Doh,
Received Signal Strength Indicator (RSSI). Mea Culpa.

Thanks Phil, sorry Peter!

Cheers,

Andrew
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4047
Posted: 02:31pm 16 Apr 2023
Copy link to clipboard 
Print this post

Hi Peter,

Three items:

ITEM 1

There is a bug in the MM.CMDLINE$ implementation (actually two bugs, one by me, and one either a transcription error from my original change, or a result of you trying to workaround the first bug):

In Commands.c, line 454 can you review and make these changes:
   // The memory allocated by getCstring() is not preserved across
   // a call to FileLoadProgram() so we need to cache 'filename' and
   // 'cmd_args' on the stack.
   unsigned char buf[MAXSTRLEN + 1];
   if (snprintf(buf, MAXSTRLEN + 1, "\"%s\",%s", filename, cmd_args) > MAXSTRLEN) {
       error("RUN command line too long");
   }
   unsigned char *pcmd_args = buf + strlen(filename) + 3; // *** THW 16/4/23

   if (*filename && !FileLoadProgram(buf)) return;

   ClearRuntime();
   WatchdogSet = false;
   PrepareProgram(true);

   // Create a global constant MM.CMDLINE$ containing 'cmd_args'.
   void *ptr = findvar("MM.CMDLINE$", V_FIND | V_DIM_VAR | T_CONST);
   CtoM(pcmd_args);
   memcpy(ptr, pcmd_args, *pcmd_args + 1); // *** THW 16/4/23

   IgnorePIN = false;
   ...


ITEM 2

I have started to get my firmware-tests running on the PicoMite, if somewhat reluctantly (the PicoMite is reluctant, not me), and am finding some issues ... though the initial ones are in the haunted wing of EOF, LOC, LOF and SEEK:

A:/tmp/tst_file_fns.bas
 test_chdir_mkdir_rmdir:                            A:/tmp
FAIL (1/3)
   1: Assert equals failed, expected "A:/tmp/test_chdir_mkdir_rmdir.tmpdir/" but actually "A:/tmp/test_chdir_mkdir_rmdir.tmpdir"
 test_close_errors:                                 PASS (2/2)
 test_copy:                                         PASS (4/4)
 test_dir:                                          FAIL (1/2)
   1: Assert array equals failed, expected:
     [0] "abc"
     [1] "file1"
     [2] "file3"
     [3] "subdir"
     [4] ""
     ... and 1 more
   but actually:
     [0] "."
     [1] ".."
     [2] "abc"
     [3] "file1"
     [4] "file3"
     ... and 1 more
 test_dir_given_no_matches:                         PASS (1/1)
 test_dir_given_not_found:                          PASS (1/1)
 test_dir_given_invalid_flag:                       PASS (1/1)
 test_eof:                                          FAIL (2/11)
   6: Assert equals failed, expected 1 but actually 0
   8: Assert equals failed, expected 1 but actually 0
 test_eof_errors:                                   PASS (4/4)
 test_inputstr:                                     FAIL (1/4)
   2: Expected Error "", but actually "File number is not open"
 test_kill:                                         PASS (2/2)
 test_loc:                                          FAIL (2/9)
   7: Assert equals failed, expected 29 but actually 1
   9: Assert equals failed, expected 29 but actually 1
 test_loc_errors:                                   FAIL (1/4)
   1: Expected Error "", but actually "File number is not open"
 test_lof:                                          FAIL (3/9)
   1: Assert equals failed, expected 13 but actually 0
   6: Assert equals failed, expected 28 but actually 13
   9: Assert equals failed, expected 46 but actually 28
 test_lof_errors:                                   FAIL (1/4)
   1: Expected Error "", but actually "File number is not open"
 test_rename:                                       PASS (3/3)
 test_seek:                                         PASS (4/4)
 test_seek_errors:                                  FAIL (2/9)
   6: Expected no error, but actually Mm.ErrMsg$ = "0 is invalid (valid is 1 to 2147483647)"
   8: Expected no error, but actually Mm.ErrMsg$ = "-1 is invalid (valid is 1 to 2147483647)"
 test_tilde_expansion:                              NO ASSERTIONS
 test_open_errors:                                  PASS (3/3)
 test_append_eof_bug:                               PASS (1/1)
 Execution time: 1.968921 s
 FAIL (9/21)


I'll try and investigate this and package it up as small examples for you as fast as possible ... but that's not very fast at the moment.

ITEM 3

The PicoMite does not implement MM.INFO$(DIRECTORY) unlike CMM2, MMB4W, MMB4L. It's not a biggie since CWD$ provides the same information give or take a foward-slash, but you might want to include it for compatibility ?

Best wishes,

Tom
Edited 2023-04-17 00:49 by thwill
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4047
Posted: 06:57pm 16 Apr 2023
Copy link to clipboard 
Print this post

BUG: DIR$("subdir/*", ALL) returns "." and ".." on A: drive


> Drive "A:"
> MkDir "subdir"
> ? Dir$("subdir/*", ALL)
.
> ? Dir$()
..
> ? Dir$()

> Drive "B:"
> mkdir "subdir"
> ? Dir$("subdir/*", ALL)

>


The correct behaviour (according to other MMBasic platforms) is that for Drive B:.

Best wishes,

Tom
Edited 2023-04-17 07:11 by thwill
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
thwill

Guru

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

BUG: DIR$ produces inconsistent error message if path does not exist.

> Drive "A:"
> ? Dir$("does-not-exist/*")
Error : Could not find the file
> Drive "B:"
> ? Dir$("does-not-exist/*")
Error : Could not find the path


CMM2 and MMB4W use the error message "Could not find the file".

MMB4L (deliberately) propagates the system error message and instead says "No such file or directory".

Best wishes,

Tom
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
thwill

Guru

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

BUG: LOF() incorrect on Drive A:


> Drive "A:"
> Open "foo" For Output As #1
> Print #1, "Hello World"
> Print Lof(#1)
0
> Close #1
> Drive "B:"
> Open "foo" For Output As #1
> Print #1, "Hello World"
> Print Lof(#1)
13
> Close #1


Other 'mites match Drive B behaviour.

Best wishes,

Tom
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
thwill

Guru

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

BUG: EOF() incorrect on Drive B:


> Drive "A:"
> Open "foo" For Output As #1
> ? Eof(#1)
1
> Close #1
> Drive "B:"
> Open "foo" For Output As #1
> ? Eof(#1)
0
> Close #1


Other 'mites match Drive A behaviour.

Best wishes,

Tom
Edited 2023-04-17 07:57 by thwill
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
thwill

Guru

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

There is also some issue with this test-suite where constants are vanishing from the variable table !!! but it doesn't seem to be reproducible in a simple example, perhaps I'll be able to pin it down once I start looking at the other suites.

That's all for now,

Tom
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4253
Posted: 06:43am 17 Apr 2023
Copy link to clipboard 
Print this post

Hi Peter,

Not sure if below is done on purpose, but VGA_50707RC4 will not execute:

MODE 1:FILES


From the commandline. It does both commands separately, but not on one line.
Found this because I was developing a game in mode 2, and do all editing in mode 1. And I had programmed:

OPTION F1 "mode 1:files"+chr$(13)

This worked in earlier beta versions. And does not anymore...

Regards,

Volhout
PicomiteVGA PETSCII ROBOTS
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9131
Posted: 06:45am 17 Apr 2023
Copy link to clipboard 
Print this post

The Picomite uses two different file systems for SD and flash. One is case sensitive and the other is not. There are other differences as you are finding. I don't intend to try and make them the same other than for core functionality. Lof and EOF for files open for output don't come into that category, not does a wildcard dir. If dir for *.bas came out different then that I would fix.

Volhout, use Edit 1
Edited 2023-04-17 16:47 by matherp
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4047
Posted: 07:09am 17 Apr 2023
Copy link to clipboard 
Print this post

Respectfully Peter, I think you are wrong , but it's your wheel-house.

However returning . and .. from DIR$() is potentially a serious bug. Existing code using DIR$() to walk the directory tree can now end up navigating all the way up to the root!

Best wishes,

Tom
Edited 2023-04-17 17:10 by thwill
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9131
Posted: 07:18am 17 Apr 2023
Copy link to clipboard 
Print this post

Volhout sorry misread your message. Files, autosave, update firmware and something else I've forgotten are no longer interpreted in the normal way to save command slots so you can't include them in compound statements.
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4253
Posted: 07:50am 17 Apr 2023
Copy link to clipboard 
Print this post

I already thought it was something like that. No big issue. Not using "files" that much during development. Edit is the primary function, and EDIT 1 is easy...

Volhout

P.S. I know this is very late in the game, and it has been asked before, but I ask one time more...miracles do sometimes happen...
Is there is way to get the 16 colors (numbers) used in the sprite file, also available in the BOX, LINE, CIRCLE etc.. commands.

Most developers of games start out with an alias table to translate the RGB(YELLOW) format into a variable or numerical, so you can manipulate it. It would be so much easier if we had colors 0...15. I know of OPTION LEGACY ON that does this, but it also converts syntax of graphical commands (BOX.... -> LINE....,BF) so you have to use the CMM1 user manual the find how to use the commands.
Edited 2023-04-17 17:52 by Volhout
PicomiteVGA PETSCII ROBOTS
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4047
Posted: 08:31am 17 Apr 2023
Copy link to clipboard 
Print this post

Minor observation:

The PicoMite allocates an apparently unused 49 byte buffer:

char PromptString[MAXPROMPTLEN];


Probably an archaeological relic.

Best wishes,

Tom
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2140
Posted: 01:01pm 17 Apr 2023
Copy link to clipboard 
Print this post

Might that be used by MM.PROMPT?
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4047
Posted: 01:04pm 17 Apr 2023
Copy link to clipboard 
Print this post

  phil99 said  Might that be used by MM.PROMPT?


That's what I expected, but not according to the code.

TBH I went there looking for a way to programatically (and persistently until power-cycled) change the prompt without relying on a program containing an MM.PROMPT subroutine currently being in flash. Reason being I am driving the PicoMite remotely and scraping its console output and it would be nice if there was something more unique than [CR] [LF] [>] to look for when trying to detect that it had returned to the prompt.

Best wishes,

Tom
Edited 2023-04-17 23:11 by thwill
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9131
Posted: 06:48pm 17 Apr 2023
Copy link to clipboard 
Print this post

  Quote  TBH I went there looking for a way to programatically (and persistently until power-cycled) change the prompt without relying on a program containing an MM.PROMPT subroutine currently being in flash. Reason being I am driving the PicoMite remotely and scraping its console output and it would be nice if there was something more unique than [CR] [LF] [>] to look for when trying to detect that it had returned to the prompt.


put the mm.prompt subroutine in the library with a conditional on a constant?
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4047
Posted: 08:26pm 17 Apr 2023
Copy link to clipboard 
Print this post

  matherp said  Put the mm.prompt subroutine in the library with a conditional on a constant?


Thanks, I had a similar idea after making that post.

Just one bug for this evening.

Load a file from the root of drive A:/


> ? Mm.Info(Path)
A:/
> ? Mm.Info(FileSize "A:/")
-2
> ? Mm.Info(FileSize Mm.Info(Path))
A:/    <---- THIS IS WRONG!!!
>


Best wishes,

Tom
Edited 2023-04-18 07:57 by thwill
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
     Page 3 of 13    
Print this page
© JAQ Software 2024