Join us on Discord!
You can help CodeWalrus stay online by donating here.

Some attempt at bringing Internet to Casio Prizm

Started by Yuki, June 30, 2016, 06:50:50 AM

Previous topic - Next topic

0 Members and 3 Guests are viewing this topic.

Yuki

I was working on this project before @gbl08ma diagnosed my calculator as having passed away (read, mysteriously bricked) after only 2 days... Figured I'd post what I have right now before marking the project as inactive. (Until I get a new one, DJ lends me his while taking extra care to not brick it and/or someone somehow figures out how to unbrick it, that is. I never really heard of those calcs being bricked this easily, having known... Oh well. That's a real bummer.)

I had this idea the other day, why not porting a TCP/IP stack to the Prizm? With a protocol like SLIP or PPPoS, that would definitely work over the serial port. That would kinda be like CalcNet, on the TI-83+ series, but you won't need an Arduino or something. (Well, I use one, but you don't even need the Atmega chip on it. Only its TTL converter so you'd have a serial device on the computer.) Who knows all the applications you could do with that? That would be quite nice.

Right now, there's some sort of scrolling UI that basically works (should be useful for an IRC client) and the start of a port of the TCP/IP stack.

Anyway, here's the code: https://github.com/juju2143/PrizmIRC
  • Calculators owned: TI-83+ (dead?), Casio Prizm (also dead???)
  • Consoles, mobile devices and vintage computers owned: A lot
Read Zarmina!
YUKI-CHAAAANNNN
In the beginning there was walrii. In the end there will be walrii. All hail our supreme leader :walrii: --Snektron

if you wanna throw money at me and/or CodeWalrus monthly it's here

Dream of Omnimaga

I don't know if it's possible to unbrick the calculators. You would need to ask glb08ma or on Cemetech, where many people had bricked calcs. But I could lend you mine if you make sure it stays in good condition (granted, it could brick itself at any moment since it's old and stuff but I would rather see it bricked through development than a rainstorm or something :P), so you can develop again (I don't do much PRIZM dev right now).


As for a TCP/IP stack for the PRIZM or Internet, my main concern is that I recall hearing a few years ago that unlike the TI-84+ I/O port, the Casio PRIZM link port can only send data in one direction at a time rather than two, or something like that that apparently would have prevented a Calcnet port. I wonder if there would be a way around that, though. Have you gotten any online connectivity success so far in the code above?
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

Yuki

The TX and RX lines are separate, so theorically you'd have a duplex connection, but I don't know how it's handled by the OS syscalls or inside the calc. Anyway, I didn't had time to test the online code yet, but I've been able to have a Linux (and Mac!) shell over the serial port.
  • Calculators owned: TI-83+ (dead?), Casio Prizm (also dead???)
  • Consoles, mobile devices and vintage computers owned: A lot
Read Zarmina!
YUKI-CHAAAANNNN
In the beginning there was walrii. In the end there will be walrii. All hail our supreme leader :walrii: --Snektron

if you wanna throw money at me and/or CodeWalrus monthly it's here

Dream of Omnimaga

Ah I see. And nice! I didn't realize you had such progress done. Hopefully you can showcase a proof of concept in the near future :)
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

gbl08ma

You can't have duplex because of hardware limitations. IIRC, people found out that only one of the lines could communicate in both directions, or perhaps not even that, I can't quite remember.
  • Calculators owned: Prizm CG-20

Yuki

Well, TX and RX means you have 2 lines, one going one way and the other going to the other way? No need of them going both ways. Shouldn't be any problem with that, unless the lines are somehow joined inside the calc.

The library I wanted to use should deal with it.
  • Calculators owned: TI-83+ (dead?), Casio Prizm (also dead???)
  • Consoles, mobile devices and vintage computers owned: A lot
Read Zarmina!
YUKI-CHAAAANNNN
In the beginning there was walrii. In the end there will be walrii. All hail our supreme leader :walrii: --Snektron

if you wanna throw money at me and/or CodeWalrus monthly it's here

Dream of Omnimaga

Can't you just send only, then receive only, back and forth? That would be laggy, but shouldn't it work?
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

gbl08ma

What he means is that the serial port is just, well, a normal serial port, which has a RX line and a TX line and as such both devices can send at the same time. Hence, the connection as a whole is bidirectional, and both devices can send without waiting for the other (more or less). So, it's full-duplex. But you can't e.g. send on both lines at the same time or receive on both lines at the same time - each line by itself is unidirectional. This blocks the use of more sophisticated protocols that could deliver higher speeds or facilitate connections (this last one being, I think, the main reason why CalcNet requires each of the two lines to be bidirectional).
  • Calculators owned: Prizm CG-20

Yuki

Yeah, pretty much. With two unidirectional lines, you still can achieve speeds up to 115200 bauds, which is not bad if you're not downloading big files. For comparaison, it's twice the speed of a 56K modem.
  • Calculators owned: TI-83+ (dead?), Casio Prizm (also dead???)
  • Consoles, mobile devices and vintage computers owned: A lot
Read Zarmina!
YUKI-CHAAAANNNN
In the beginning there was walrii. In the end there will be walrii. All hail our supreme leader :walrii: --Snektron

if you wanna throw money at me and/or CodeWalrus monthly it's here

gbl08ma

#9
Quote from: PrizmIRC README https://github.com/juju2143/PrizmIRC/blob/a4600cf136ae42d2ac9aeb9c18e7fdcb9fc2373a/README.md
With a TCP/IP stack on the Casio Prizm, the sky will be the limit. Many applications could be created using it, maybe even an add-in download manager or even a web browser if possible.

Sorry to ruin your party, but downloading add-ins will not be possible, unless you come up with wacky workarounds (which I wouldn't recommend given all the bricking cases...). The execution of the running add-in tends to break when g3a files are manipulated from it. See http://www.casiopeia.net/forum/viewtopic.php?p=13830#p13830 .

Later I found out the problem occurs with most file manipulations involving g3a, and not just file creation: the OS will perform an add-in re-registration when g3a files are manipulated, and this causes changes to the TLB, breaking the execution of the current add-in (making execution jump to places where it's not meant to be: a great way to damage the OS, or the bootloader). This is the reason why the Add-In Manager in Utilities causes system errors often, and that's why the Add-In Manager only appears when the "show advanced tools" setting is enabled (before removing it altogether, the CPU overclocking tool in Utilities belonged in this category too).

Using Bfile syscalls while timers are installed also causes problems; see http://prizm.cemetech.net/index.php/Incompatibility_between_Bfile_Syscalls_and_Timers

Also note that 2016 is a great year to be developing for the Prizm: a few years ago we didn't know about these quirks and you'd be left scratching your head for days without understanding why your "perfect" code wouldn't work. Now we have a clearer idea of how terrible the Casio OS is.
  • Calculators owned: Prizm CG-20

AmazoNKA

Regarding creation of g3a addins - should creating a file with not g3a extention work without any problems? And subsequently renaming it to g3a would normally work too provided the newly created g3a would not try to be placed on the main menu anywhere before the addin doing that renaming... So theoretically it should be possible to achieve all of the above.

But i may be missing crucial issues i'm not familiar with like will creating a file itself endanger parts of the calculator memory with the bootloader or anything important like that... Will receiving or serial communication going on before or after that endanger anything?

So it's just my thoughts/theories above and I would love to know how if any of those things actually work this way or not please - so please confirm or correct anything you agree or disagree with. Thanks in advance

Yuki

It's pretty much like running a program on your computer. They're usually harmless, except otherwise specified, like those addins that do overclocks and things like that you should take care. Serial communication is definitely harmless, unless there's a yet undiscovered bug in one of the syscalls that makes your calc halt and catch fire.
  • Calculators owned: TI-83+ (dead?), Casio Prizm (also dead???)
  • Consoles, mobile devices and vintage computers owned: A lot
Read Zarmina!
YUKI-CHAAAANNNN
In the beginning there was walrii. In the end there will be walrii. All hail our supreme leader :walrii: --Snektron

if you wanna throw money at me and/or CodeWalrus monthly it's here

AmazoNKA

Do you remember how or what exactly bricked your prizm? Was serial communication or something else running on it?

Dream of Omnimaga

If I remember from IRC conversations, he did some USB transfers prior the bricking, but the calculator was also powered via USB rather than batteries for an extended period of time. I seriously hope that the calculator cannot fail just from USB or I/O transfers alone.
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

Yuki

Yeah, the culprit is not serial communication, but more something akin to USB transfer and overusage. I didn't even began the serial part in my program anyway.
  • Calculators owned: TI-83+ (dead?), Casio Prizm (also dead???)
  • Consoles, mobile devices and vintage computers owned: A lot
Read Zarmina!
YUKI-CHAAAANNNN
In the beginning there was walrii. In the end there will be walrii. All hail our supreme leader :walrii: --Snektron

if you wanna throw money at me and/or CodeWalrus monthly it's here

Powered by EzPortal