Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 03:49 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 11 of 13    
Author Message
phil99

Guru

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

It will be off at the next startup.

> cpu restart
 
homa

Guru

Joined: 05/11/2021
Location: Germany
Posts: 351
Posted: 01:12pm 29 Apr 2023
Copy link to clipboard 
Print this post

What do you mean? The PIN request or the LED?

The PIN request also comes after the ">cpu restart".

But I found the following BUG:

> option autorun on
> cpu restart

works.

> option autorun off
> cpu restart

WEBMITE hangs. Only power on/off helps. reproducibly
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9133
Posted: 01:22pm 29 Apr 2023
Copy link to clipboard 
Print this post

I have no idea what you are doing. I suggest you forget pin altogether if you are using a telnet connection. Who knows what state the connection is in after a CPU restart which your router/telnet console may not see as a proper disconnect
 
homa

Guru

Joined: 05/11/2021
Location: Germany
Posts: 351
Posted: 01:45pm 29 Apr 2023
Copy link to clipboard 
Print this post

Hello Peter,

The previous post referred to Phil.

Everything works so far and I am happy that the PIN protection via telnet also works. So I can use the WEBMITE in the community centre. Thank you!

1.
When I was testing it, I just noticed the following:
If the web server is running (a Program) on the WEBMITE and it is PIN protected. Then use Tera Term/Putty to connet on the WEBMITE, now Ctrl-C. Don't answer the PIN prompt and just waiting or close the connectin and the web server (the running program) will stop working.
Is there any way to cancel the PIN request and keep the program running (other than intentionally 0 to restart)? Or does the programme even continue to run until Ctrl-C is confirmed with the correct PIN?
==> So that an unauthorised person cannot disturb the WEBMITE?

2.
Regarding the LED, I didn't miss it or? Only the heartbeat works, right?

Matthias
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9133
Posted: 01:55pm 29 Apr 2023
Copy link to clipboard 
Print this post

You can disable Ctrl-C with OPTION BREAK 0
Edited 2023-04-29 23:55 by matherp
 
homa

Guru

Joined: 05/11/2021
Location: Germany
Posts: 351
Posted: 03:26pm 29 Apr 2023
Copy link to clipboard 
Print this post

  matherp said  You can disable Ctrl-C with OPTION BREAK 0

good advice, works.

LED ?

Matthias
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9133
Posted: 03:32pm 29 Apr 2023
Copy link to clipboard 
Print this post

The LED is not controllable - I will fix the bug that sometimes leaves it on when you first execute OPTION HEARTBEAT OFF
Edited 2023-04-30 01:32 by matherp
 
homa

Guru

Joined: 05/11/2021
Location: Germany
Posts: 351
Posted: 04:02pm 29 Apr 2023
Copy link to clipboard 
Print this post

oh that's a shame. i was hoping the new sdk/framework would make the led usable. it's a nice thing to be able to signal states directly without an additional led, but then i have to use an external one.
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4253
Posted: 07:02pm 29 Apr 2023
Copy link to clipboard 
Print this post

@phill, martin,

The green levels are actually 0, 1/3, 2/3, and 1 of 660mV.



The blue and red levels are slighly low. A 240 ohm resistor would have been better.
But 270 ohm is a standard value.

Volhout
PicomiteVGA PETSCII ROBOTS
 
Hawk

Senior Member

Joined: 15/07/2021
Location: Australia
Posts: 141
Posted: 01:18am 30 Apr 2023
Copy link to clipboard 
Print this post

This discussion about the signal levels and palette colours is valuable information.  Is an admin able to extract it out of this thread into one of it's own?  It's sort of polluting this thread for @matherp to resolve bugs prior to the lastest release.

@Volhout, are you able to repeat the analysis using the schematic published in Silicon Chip?  The resistor values are slightly different (220ohm) and there are a couple of diodes in there also.  It would be interesting to compare the results.

Mike
 
Hawk

Senior Member

Joined: 15/07/2021
Location: Australia
Posts: 141
Posted: 01:24am 30 Apr 2023
Copy link to clipboard 
Print this post

@matherp, I did come across a bug/feature that I haven't seen mentioned here.  since you have been trying to get the current release out, you may choose to defer it to the next release.

COMMAND WRAP-AROUND BUG

In Mode 2, when a command extends beyond the end of the current line (In my case due to the length of path names in a copy command), and wraps onto the next line, the interpreter only tries to execute the portion on the second line.

The same command typed into Mode 1 where it fits on a single line executes perfectly.

Mike
 
thwill

Guru

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

Hello Peter,

I am "done" without a new build.

Item 1

The issue with the CALL function reported above prevents me from testing properly on the PicoMite VGA as the test framework relies on it.

Note I am not testing the WebMite, I don't have a Pico W and don't propose to acquire one at this time.

Item 2

I believe OPEN FOR RANDOM is broken for PicoMite drive A:/

' Ensure directories "A:/tmp" and "B:/tmp" exist.

Option Explicit On
Option Default None
Option Base 0

Dim counter% = 0

If InStr(Mm.Device$, "PicoMite") Then
 Drive "A:"
 ChDir "A:/"
 run_tests()
 ChDir "A:/tmp"
 run_tests()
 Drive "B:"
 ChDir "B:/"
 run_tests()
 ChDir "B:/tmp"
 run_tests()
Else
 run_tests()
EndIf

Sub run_tests()
 ? "Drive " + Mm.Info$(Drive) + "  Working directory: " + Cwd$

 Const f$ = "tst_file.txt"

 Open f$ For Output As #1
 Print #1, "Hello World"
 Print #1, "Goodbye World"
 Close #1

 Open f$ For Random As #1
 Local s$
 Seek #1, 1
 Line Input #1, s$
 assert_string_equals("Hello World", s$)
 Print #1, "Moses supposes his toeses are roses"
 Line Input #1, s$
 assert_string_equals("", s$)
 Close #1

 Open f$ For Random As #1
 Seek #1, 1
 Line Input #1, s$
 assert_string_equals("Hello World", s$)
 Line Input #1, s$
 assert_string_equals("Moses supposes his toeses are roses", s$)
 Line Input #1, s$
 assert_string_equals("", s$)
 Close #1

 Open f$ For Random As #1
 Seek #1, Len("Hello World") + 3
 Print #1, "But Moses supposes eroneously"
 Line Input #1, s$
 assert_string_equals("oses", s$)
 Line Input #1, s$
 assert_string_equals("", s$)
 Close #1

 Open f$ For Random As #1
 Seek #1, 1
 Line Input #1, s$
 assert_string_equals("Hello World", s$)
 Line Input #1, s$
 assert_string_equals("But Moses supposes eroneously", s$)
 Line Input #1, s$
 assert_string_equals("oses", s$)
 Line Input #1, s$
 assert_string_equals("", s$)
 Close #1
End Sub

Sub assert_string_equals(expected_$, actual_$)
 Inc counter%
 Print str.rpad$("[" + Str$(counter%) + "]", 10);
 If expected_$ <> actual_$ Then
   Local expected$ = str.quote$(expected_$)
   Local actual$ = str.quote$(actual_$)
   Print "Assert equals failed, expected ";
   Print expected$;
   Print " but actually ";
   Print actual$
 Else
   Print "OK"
 EndIf
End Sub

Function str.quote$(s$, begin$, end$)
 Local begin_$ = Choice(begin$ = "", Chr$(34), Left$(begin$, 1))
 Local end_$ = Choice(end$ = "", begin_$, Left$(end$, 1))
 str.quote$ = begin_$ + s$ + end_$
End Function

Function str.rpad$(s$, x%)
 str.rpad$ = s$
 If Len(s$) < x% Then str.rpad$ = s$ + Space$(x% - Len(s$))
End Function


PicoMite output:
Drive A:  Working directory: A:/
[1]       OK
[2]       OK
[3]       OK
[4]       Assert equals failed, expected "Moses supposes his toeses are roses" but actually "Goodbye World"
[5]       Assert equals failed, expected "" but actually "Moses supposes his toeses are roses"
[6]       Assert equals failed, expected "oses" but actually ""
[7]       OK
[8]       OK
[9]       Assert equals failed, expected "But Moses supposes eroneously" but actually "Goodbye World"
[10]      Assert equals failed, expected "oses" but actually "Moses supposes his toeses are roses"
[11]      Assert equals failed, expected "" but actually "But Moses supposes eroneously"
Drive A:  Working directory: A:/tmp
[12]      OK
[13]      OK
[14]      OK
[15]      Assert equals failed, expected "Moses supposes his toeses are roses" but actually "Goodbye World"
[16]      Assert equals failed, expected "" but actually "Moses supposes his toeses are roses"
[17]      Assert equals failed, expected "oses" but actually ""
[18]      OK
[19]      OK
[20]      Assert equals failed, expected "But Moses supposes eroneously" but actually "Goodbye World"
[21]      Assert equals failed, expected "oses" but actually "Moses supposes his toeses are roses"
[22]      Assert equals failed, expected "" but actually "But Moses supposes eroneously"
Drive B:  Working directory: B:/
[23]      OK
[24]      OK
[25]      OK
[26]      OK
[27]      OK
[28]      OK
[29]      OK
[30]      OK
[31]      OK
[32]      OK
[33]      OK
Drive B:  Working directory: B:/tmp
[34]      OK
[35]      OK
[36]      OK
[37]      OK
[38]      OK
[39]      OK
[40]      OK
[41]      OK
[42]      OK
[43]      OK
[44]      OK


Item 3

I apologise but based on what I now believe to be broken behaviour in MMB4L I led you up the garden path with respect to Mm.Info(EXISTS DIR "") and Mm.Info(FILESIZE ""), these should return 0 and -1 respectively.

' Ensure directories "A:/tmp" and "B:/tmp" exist.

Option Explicit On
Option Default None
Option Base 0

Dim counter%

If InStr(Mm.Device$, "PicoMite") Then
 Drive "A:"
 ChDir "A:/"
 run_tests()
 ChDir "A:/tmp"
 run_tests()
 Drive "B:"
 ChDir "B:/"
 run_tests()
 ChDir "B:/tmp"
 run_tests()
Else
 run_tests()
EndIf

Sub run_tests()
 ? "Drive " + Mm.Info$(Drive) + "  Working directory: " + Cwd$
 assert_dir_exists("/")
 assert_dir_exists("\")
 assert_dir_exists("A:")
 assert_dir_exists("A:/")
 assert_dir_exists("A:\")
 assert_dir_exists("A:/tmp")
 assert_dir_exists("A:\tmp")
 assert_dir_does_not_exist("")
 assert_dir_exists(".")
 assert_dir_exists("..")
 assert_dir_exists("B:")
 assert_dir_exists("B:/")
 assert_dir_exists("B:\")
 assert_dir_exists("B:/tmp")
 assert_dir_exists("B:\tmp")
End Sub

Sub assert_dir_exists(f$)
 Inc counter%
 ? "  " str.rpad$("'" + f$ + "'", 15);
 ? Choice(Mm.Info(Exists Dir(f$)), "OK   ", "FAIL ");
 ? Choice(Mm.Info(Exists File(f$)), "FAIL ", "OK   ");
 ? Choice(Mm.Info(FileSize f$) = -2, "OK   ", "FAIL ")
End Sub

Sub assert_dir_does_not_exist(f$)
 Inc counter%
 ? "  " str.rpad$("'" + f$ + "'", 15);
 ? Choice(Mm.Info(Exists Dir(f$)), "FAIL ", "OK   ");
 ? Choice(Mm.Info(Exists File(f$)), "FAIL ", "OK   ");
 ? Choice(Mm.Info(FileSize f$) = -1, "OK   ", "FAIL ")
End Sub

Function str.rpad$(s$, x%)
 str.rpad$ = s$
 If Len(s$) < x% Then str.rpad$ = s$ + Space$(x% - Len(s$))
End Function


PicoMite output:
Drive A:  Working directory: A:/
 '/'            OK   OK   OK
 '\'            OK   OK   OK
 'A:'           OK   OK   OK
 'A:/'          OK   OK   OK
 'A:\'          OK   OK   OK
 'A:/tmp'       OK   OK   OK
 'A:\tmp'       OK   OK   OK
 ''             FAIL OK   FAIL
 '.'            OK   OK   OK
 '..'           OK   OK   OK
 'B:'           OK   OK   OK
 'B:/'          OK   OK   OK
 'B:\'          OK   OK   OK
 'B:/tmp'       OK   OK   OK
 'B:\tmp'       OK   OK   OK
Drive A:  Working directory: A:/tmp
 '/'            OK   OK   OK
 '\'            OK   OK   OK
 'A:'           OK   OK   OK
 'A:/'          OK   OK   OK
 'A:\'          OK   OK   OK
 'A:/tmp'       OK   OK   OK
 'A:\tmp'       OK   OK   OK
 ''             FAIL OK   FAIL
 '.'            OK   OK   OK
 '..'           OK   OK   OK
 'B:'           OK   OK   OK
 'B:/'          OK   OK   OK
 'B:\'          OK   OK   OK
 'B:/tmp'       OK   OK   OK
 'B:\tmp'       OK   OK   OK
Drive B:  Working directory: B:/
 '/'            OK   OK   OK
 '\'            OK   OK   OK
 'A:'           OK   OK   OK
 'A:/'          OK   OK   OK
 'A:\'          OK   OK   OK
 'A:/tmp'       OK   OK   OK
 'A:\tmp'       OK   OK   OK
 ''             FAIL OK   FAIL
 '.'            OK   OK   OK
 '..'           OK   OK   OK
 'B:'           OK   OK   OK
 'B:/'          OK   OK   OK
 'B:\'          OK   OK   OK
 'B:/tmp'       OK   OK   OK
 'B:\tmp'       OK   OK   OK
Drive B:  Working directory: B:/tmp
 '/'            OK   OK   OK
 '\'            OK   OK   OK
 'A:'           OK   OK   OK
 'A:/'          OK   OK   OK
 'A:\'          OK   OK   OK
 'A:/tmp'       OK   OK   OK
 'A:\tmp'       OK   OK   OK
 ''             FAIL OK   FAIL
 '.'            OK   OK   OK
 '..'           OK   OK   OK
 'B:'           OK   OK   OK
 'B:/'          OK   OK   OK
 'B:\'          OK   OK   OK
 'B:/tmp'       OK   OK   OK
 'B:\tmp'       OK   OK   OK


Continued thanks for your almost Sisyphean efforts,

Tom
Edited 2023-05-01 00:47 by thwill
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6808
Posted: 03:07pm 30 Apr 2023
Copy link to clipboard 
Print this post

Thank *you* too, Tom, for firmware testing above & beyond the call of duty. :)
Without you Peter wouldn't have as much to work with - I don't think the rest of us use MMBasic to the extremes that would reveal many of the bugs - or at least we'd just scratch our heads and think we'd made some sort of weird programming error.
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9133
Posted: 03:47pm 30 Apr 2023
Copy link to clipboard 
Print this post

Tom - attached VGA version with the call fix


PicoMiteVGA.zip

I don't agree with your change to "". It just means current directory and so should behave as now. I use exactly that syntax in PLAY WAV and PLAY FLAC
i.e. PLAY FLAC "" plays all flac files in the current directory

I'll look at the second issue
Edited 2023-05-01 01:48 by matherp
 
thwill

Guru

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

Thanks Peter,

Will test VGA later/tomorrow.

  matherp said  I don't agree with your change to "". It just means current directory and so should behave as now. I use exactly that syntax in PLAY WAV and PLAY FLAC
i.e. PLAY FLAC "" plays all flac files in the current directory


Ack, in which case this is a PicoMite bug:

? Mm.Info(Drive)
B:
> ? Cwd$
B:/tmp
> ? Mm.Info(Exists Dir "")
0
> ? Mm.Info(FileSize "")
-1


Best wishes,

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

Joined: 11/12/2012
Location: United Kingdom
Posts: 9133
Posted: 05:30pm 30 Apr 2023
Copy link to clipboard 
Print this post

Tom

I've updated the download and named the files RC8a but the version number hasn't changed

This fixes your issues above but please test anything else to do with random files on drive a: the code change is tiny but...

       else if(mode==(FA_WRITE | FA_OPEN_APPEND | FA_READ))lfsmode =LFS_O_RDWR | LFS_O_CREAT;


rather than

       else if(mode==(FA_WRITE | FA_OPEN_APPEND | FA_READ))lfsmode =LFS_O_RDWR | LFS_O_CREAT | LFS_O_APPEND;


unlike FatFS is appears random files in littleFS don't need the append flag setting otherwise it overrides seek for writes
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4047
Posted: 12:42pm 01 May 2023
Copy link to clipboard 
Print this post

M'eh, I was so close as well when I stumbled upon this one :

PicoMite:
> ? Format$(55, "%-5g")
55.0000


MMB4L & MMB4W:
> ? Format$(55, "%-5g")
55


Everything else looks good.

Best wishes,

Tom
Edited 2023-05-01 22:43 by thwill
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9133
Posted: 12:52pm 01 May 2023
Copy link to clipboard 
Print this post

Appears to be a difference in the implementation of sprintf so we will have to live with that one
 
thwill

Guru

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

  matherp said  Appears to be a difference in the implementation of sprintf so we will have to live with that one


Since I'm probably as ready to call this "done" as you are, fair enough .

That's me finished with my testing on PicoMite and PicoMite VGA, no doubt there are bugs, and no doubt someone will report one < 24 hours after the release is announced, but that's life.

   

Best wishes,

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

Joined: 11/12/2012
Location: United Kingdom
Posts: 9133
Posted: 02:16pm 01 May 2023
Copy link to clipboard 
Print this post

Have posted the bug on the Pico forum but obviously won't get any fix in the near future
 
     Page 11 of 13    
Print this page
© JAQ Software 2024