![]() |
Forum Index : Microcontroller and PC projects : Promote for Base 64 Coded Strings and Data Transfer
Page 1 of 2 ![]() ![]() |
|||||
Author | Message | ||||
aFox Senior Member ![]() Joined: 28/02/2023 Location: GermanyPosts: 105 |
I want to promote for four new functions. We have PICO WEB possibilities now. I think Base64 encoded strings are necessary. 1. B64Encode$(str$) returns a Base 64 encoded string 2. B64Decode$(str$) returns string decoded from a Base 64 coded string Gone are the days of CPM drives and phone modems. The probably error-prone XMODEM is no longer state of the art. 3. B64SEND(str$) sends a base 64 encoded string followed by Ctrl-Z and returns the number of characters sent to check for a successful send. B64SEND(str$, filename$) The same as before, but str$ can be a bitmap header or empty. 4. B64RECEIVE$(str$) receives a base 64 encoded string and decoded it automatically. The receiving stops until Ctrl-Z is detected. Like AUTOSAVE B64RECEIVE(filename$) The same as before, but stores the data encoded into a file under filename$. Returns the number of received characters. Maybe a first argument could specifiy a serial port number (USB = 0) like B64SEND(port, str$). The port could also be an ip address with port number. Checking the number of characters are sent is useful in case of temporally broken wirings. For my part, I could then do without XMODEM. What do you think about that? Gregor Edited 2023-03-16 10:53 by aFox |
||||
Mixtel90![]() Guru ![]() Joined: 05/10/2019 Location: United KingdomPosts: 7937 |
All command and function name slots are currently full on the PicoMite (all versions AFAIK). Only matherp can answer this further. Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
CaptainBoing![]() Guru ![]() Joined: 07/09/2016 Location: United KingdomPosts: 2170 |
With Airfix, you can build one thing, with Lego the possibilities are endless http://www.fruitoftheshed.com/MMBasic.Base64-Mime-Encode-and-Decode-Functions.ashx you might also like http://www.fruitoftheshed.com/MMBasic.URL-ENCODE-Function.ashx http://www.fruitoftheshed.com/MMBasic.URL-DECODE-Function.ashx Edited 2023-03-16 20:01 by CaptainBoing |
||||
Mixtel90![]() Guru ![]() Joined: 05/10/2019 Location: United KingdomPosts: 7937 |
Nice one (inc one#,2) Cap'n. :) Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
CaptainBoing![]() Guru ![]() Joined: 07/09/2016 Location: United KingdomPosts: 2170 |
hth |
||||
Volhout Guru ![]() Joined: 05/03/2018 Location: NetherlandsPosts: 5089 |
No, you would loose MMEdit Volhout PicomiteVGA PETSCII ROBOTS |
||||
Geoffg![]() Guru ![]() Joined: 06/06/2011 Location: AustraliaPosts: 3292 |
This is something that comes up often, rather than writing a simple subroutine to do something people want it built into the language. Geoff Geoff Graham - http://geoffg.net |
||||
twofingers![]() Guru ![]() Joined: 02/06/2014 Location: GermanyPosts: 1593 |
@Geoff ![]() I often think we should have a library of subroutines and not burden the language itself. Best regards Michael causality ≠ correlation ≠ coincidence |
||||
JohnS Guru ![]() Joined: 18/11/2011 Location: United KingdomPosts: 4044 |
Like fruitoftheshed? John |
||||
twofingers![]() Guru ![]() Joined: 02/06/2014 Location: GermanyPosts: 1593 |
EDIT: oops, double post. Sorry Edited 2023-03-17 00:10 by twofingers causality ≠ correlation ≠ coincidence |
||||
stanleyella![]() Guru ![]() Joined: 25/06/2022 Location: United KingdomPosts: 2566 |
Why doesn't mmedit make triangle a key word like it does box? triangle works though. |
||||
CaptainBoing![]() Guru ![]() Joined: 07/09/2016 Location: United KingdomPosts: 2170 |
![]() Edited 2023-03-17 00:14 by CaptainBoing |
||||
twofingers![]() Guru ![]() Joined: 02/06/2014 Location: GermanyPosts: 1593 |
No, more officially checked and distributed with the firmware. Just like it used to be with Micromite firmware. Of course, Fruitoftheshed has its place! Edited 2023-03-17 00:46 by twofingers causality ≠ correlation ≠ coincidence |
||||
thwill![]() Guru ![]() Joined: 16/09/2019 Location: United KingdomPosts: 4311 |
Before my time, but I wouldn't be suprised if that was a dreadful burden on the maintainer. Best wishes, Tom MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
twofingers![]() Guru ![]() Joined: 02/06/2014 Location: GermanyPosts: 1593 |
That's true, but I think there definitely needs to be more support for Peter. causality ≠ correlation ≠ coincidence |
||||
thwill![]() Guru ![]() Joined: 16/09/2019 Location: United KingdomPosts: 4311 |
I don't disagree (and try to do my bit), but as I've said before TBS and the 'mites aren't a business and some things, such as this, generally require financial renumeration (not asking) or somebody very enthusiastic with an over-abundance of spare time (looks at the largely, presumably, retired population of the shed). Best wishes, Tom MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
aFox Senior Member ![]() Joined: 28/02/2023 Location: GermanyPosts: 105 |
Mick said: All command and function name slots are currently full on the PicoMite (all versions AFAIK). > OK @ CaptainBoing > Very useful links > Would be nice if these links or the BASIC codes will be added into the next version of the picomite manual, > because I had not find any hints or code by the search of the forum asking for b64 or Base 64. > Is this also a solution for LONGSTRINGs in view of speed? Geoff wrote: This is something that comes up often, rather than writing a simple subroutine to do something people want it built into the language. > Geoff I agree with you but sometimes it needs more speed and also a simplified usage. > The DISTANCE() function is an example for both. A second try: 1. LONGSTRING B64 ENCODE CONCAT dest%(), src%() 2. LONGSTRING B64 DECODE CONCAT dest%(), src%() In view of Pico versions with more memory and SD-cards Sending and receiving Base 64 encoded Strings in parts of max. 64 bytes + LF and Ctrl-Z as EOF 3. B64 SEND filename$ 4. B64 RESEIVE filename$ Or 3. XMODEM B64 SEND filename$ 4. XMODEM B64 RESEIVE filename$ In this case only Base 64 encoded without special XMODEM stuff. Ok, for small files I can write a program to handle this simple protocol. But with larger file sizes? We should see also the other side of the connection. From XModem.c "From It has been tested on Terra Term and is intended for use with that software." The other side is not only a Tera Term terminal. I think it could be easier. I am sure you will find a solution, not today but in the future. Gregor |
||||
twofingers![]() Guru ![]() Joined: 02/06/2014 Location: GermanyPosts: 1593 |
> The DISTANCE() function is an example for both.[...] I don't quite understand why a function like this shouldn't be possible with CSubs. I don't mind if Peter adds additional features. My only concern is that it will come at the expense of available memory ... and Peter's time. ![]() Best regards Michael causality ≠ correlation ≠ coincidence |
||||
Mixtel90![]() Guru ![]() Joined: 05/10/2019 Location: United KingdomPosts: 7937 |
Also, every additional command is something that 90% of users will never use so it's using up valuable hardware. If you *need* speed then CSUBs are the answer, but that's rarely the case. The PicoMite is plenty fast enough *for the sort of programs it's aimed at*. If you have to have huge, complex and fast programs then the RP2040 isn't for you, it's the wrong platform. Note that ease of use doesn't necessarily mean much faster. The interpreter still has to go through the same code that it would if you wrote a CSUB. If you want really fast IO then learn how to use the PIO instead of trying to do it in MMBasic - that's what it's for. Having said that, BITBANG can produce virtually any serial output that you might want, and with great accuracy. Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
JohnS Guru ![]() Joined: 18/11/2011 Location: United KingdomPosts: 4044 |
I like Base64 (somewhat) but what problem is important enough that XMODEM isn't good enough? If you're transferring big files, use the SD card or a Pico W maybe? John |
||||
Page 1 of 2 ![]() ![]() |
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |