Les membres ayant 30 points peuvent parler sur les canaux annonces, projets et hs du chat.
La shoutbox n'est pas chargée par défaut pour des raisons de performances. Cliquez pour charger.

Forum Casio - Projets de programmation


Index du Forum » Projets de programmation » fxIP - TCP/IP stack, IRC client and webserver
Manawyrm Hors ligne Membre Points: 4 Défis: 0 Message

fxIP - TCP/IP stack, IRC client and webserver

Posté le 12/07/2021 21:36

Hello!

Je m'excuse de ne pas parler français. J'espère que ça ne pose pas de problème que j'écrive en anglais ici.

I wrote fxIP, a port of uIP to Casio fx-Calculators, an IRC client and a webserver.
https://github.com/Manawyrm/fxIP

Using the 2.5mm serial port, SLIP-encapsulated IPv4 packets can be sent to the calculator. It could even be connected to a modem directly

I made a short YouTube-clip showing the IRC client (while chatting on libera):
https://www.youtube.com/watch?v=afkrucsMMrc

If you're very quick, http://casio.as203478.net/ is a webpage directly hosted on my casio. It might not be available anymore in a few hours/days...

It uses the fantastic fxsdk by lephenixnoir, and we added rudimentary serial support. fxsdk really is a fantastic pice of software, one of the best libraries I've used. Thank you very much for making it!

Best regards
manawyrm


Lephenixnoir En ligne Administrateur Points: 24509 Défis: 170 Message

Citer : Posté le 12/07/2021 22:05 | # | Fichier joint


Hi! That's quite the bomb you dropped there, nice job. xD

No problem with speaking English, the more technical audience of Planète Casio is comfortable with it, and we can translate later for everyone else.

I'm not very familiar with the network stack at this level, but I get the gist of the configuration involved there. One thing I'm unsure of is what kind of device driver the kernel associates with the calculator? (Also what cable did you use?) /dev/ttyUSB0 sounds like the CDC class from the USB protocol but that wouldn't be a network device AFAICT.

This is too nice to not write a front-page article about. If you're ok with it, I'd like to make one sometime in the next few days.

I'm always happy to see these cool projects porting libraries with awesome results. This is something that the Cemetech community did much more when were active on the fx-CG 10/20, while people here on Planète Casio (myself included) mostly make games from scratch. It also shows that the GCC setup (and to some extent the SDK) is now somewhat solid. I'm glad you liked it! o/
Mon graphe (11 Avril): ((Rogue Life || HH2) ; PythonExtra ; serial gint ; Boson X ; passe gint 3 ; ...) || (shoutbox v5 ; v5)
Dark storm En ligne Labélisateur Points: 11640 Défis: 176 Message

Citer : Posté le 12/07/2021 22:08 | #


Wow, such an awesome project ._.

Technically speaking, if you manage to add UART support to gint, Lephe may be interested with a PR on his project (and so I am, having some projects using UART in my todo-list). If you consider this, we can create you an account on Gitea.
Finir est souvent bien plus difficile que commencer. — Jack Beauregard
Manawyrm Hors ligne Membre Points: 4 Défis: 0 Message

Citer : Posté le 12/07/2021 23:08 | #


Thank you

About the UART:
https://github.com/Manawyrm/fxIP/blob/main/src/scif.c contains the UART driver.

It has 2x 2KiB ringbuffers (one for each TX and RX, big enough to hold one full IP packet).
It has no support for configuring the serial port (yet?), so I'm still calling the Casio OS routines to do that.
The documentation in the Renesas datasheet was quite accurate and it worked pretty much first try.

With these UART routines, the performance was greatly improved. The original UART routines in the system seemed to not be interrupt-based but rather poll the 16-byte hardware FIFO at each OS-call/yield?
In any case, the original routines caused data loss, the new ones don't
I don't have any more Casio calculators, only this modded fx-9750GII (SH4a).

If you wanted to implement UART support in fxsdk, I think only a configure/setup-function and maybe different register offsets for the other CPUs/calculators would be needed.
Everything else (and a bit of code cleanup maybe, I'm not a C master) should work pretty well.

Sorry for not explaining the UART/network stuff more clearly:
I'm using a USB->UART cable (FTDI FT232), which is common on 3.5mm jacks.
It's a bit uncommon for 2.5mm jacks, so I had to cut a cable and solder the ends onto the USB->UART converter. This is also why it appears as a USB-CDC device on the computer.

SLIP is just a very simple protocol (with a start and end byte and an escape byte) to encode IP packets into a serial data stream. It's just as simple as it sounds (https://github.com/Manawyrm/fxIP/blob/main/src/slipdev.c ).

About the front page:
Sure, I'd be honored

@Dark storm:
Cool, I'd love to see some hardware-interfacing/UART projects. Don't be afraid, it was pretty straight-forward and worked right away.

After we had a working UART driver, I also wrote this very simple RS232 terminal application and connected a 56k modem directly to the casio (after removing the +/-15V driver IC):
https://www.youtube.com/watch?v=epFX8K0dhdY

It was quite fun to use a modem on the casio. I originally wanted to use the modem for Internet connectivity as well, but I had some trouble connecting my 2 modems together reliably, so I skipped this step (for now).
Loieducode Hors ligne Membre Points: 191 Défis: 6 Message

Citer : Posté le 13/07/2021 09:49 | #


:o
(edit: this should go in the next RDP)
Trickswriting(sort le 1er avril):
   100%
Lephenixnoir En ligne Administrateur Points: 24509 Défis: 170 Message

Citer : Posté le 22/07/2021 15:38 | #


It's been longer than I hoped, but I have finished the article I promised for the front page.

I think I got most of the points right, but feel free to add details or fix mistakes (in English) in the comments. If you ever take it further (such as by connecting the modem), I would be happy to write a followup.

Thanks again for this extremely cool proof-of-concept.
Mon graphe (11 Avril): ((Rogue Life || HH2) ; PythonExtra ; serial gint ; Boson X ; passe gint 3 ; ...) || (shoutbox v5 ; v5)
Manawyrm Hors ligne Membre Points: 4 Défis: 0 Message

Citer : Posté le 22/07/2021 16:02 | #


That is a very nice article, thank you

Re: http://fxip.as203478.net/ -- it is still online, maybe not reachable from your ISP?
The Casio is really running the full HTTP webserver itself. Just publicly reachable with a public IPv4 address.
You can also reach it via 44.190.23.86 directly.
Lephenixnoir En ligne Administrateur Points: 24509 Défis: 170 Message

Citer : Posté le 22/07/2021 16:23 | #


Thank you! I amended the article to add the new link (I had checked the previous link from the top post), and added the reference to the complete HTTP server.

I was unsure about the HTTP server because I didn't find it in the source code, but I realize now it seems to be in µIP itself.
Mon graphe (11 Avril): ((Rogue Life || HH2) ; PythonExtra ; serial gint ; Boson X ; passe gint 3 ; ...) || (shoutbox v5 ; v5)

LienAjouter une imageAjouter une vidéoAjouter un lien vers un profilAjouter du codeCiterAjouter un spoiler(texte affichable/masquable par un clic)Ajouter une barre de progressionItaliqueGrasSoulignéAfficher du texte barréCentréJustifiéPlus petitPlus grandPlus de smileys !
Cliquez pour épingler Cliquez pour détacher Cliquez pour fermer
Alignement de l'image: Redimensionnement de l'image (en pixel):
Afficher la liste des membres
:bow: :cool: :good: :love: ^^
:omg: :fusil: :aie: :argh: :mdr:
:boulet2: :thx: :champ: :whistle: :bounce:
valider
 :)  ;)  :D  :p
 :lol:  8)  :(  :@
 0_0  :oops:  :grr:  :E
 :O  :sry:  :mmm:  :waza:
 :'(  :here:  ^^  >:)

Σ π θ ± α β γ δ Δ σ λ
Veuillez donner la réponse en chiffre
Vous devez activer le Javascript dans votre navigateur pour pouvoir valider ce formulaire.

Si vous n'avez pas volontairement désactivé cette fonctionnalité de votre navigateur, il s'agit probablement d'un bug : contactez l'équipe de Planète Casio.

Planète Casio v4.3 © créé par Neuronix et Muelsaco 2004 - 2024 | Il y a 67 connectés | Nous contacter | Qui sommes-nous ? | Licences et remerciements

Planète Casio est un site communautaire non affilié à Casio. Toute reproduction de Planète Casio, même partielle, est interdite.
Les programmes et autres publications présentes sur Planète Casio restent la propriété de leurs auteurs et peuvent être soumis à des licences ou copyrights.
CASIO est une marque déposée par CASIO Computer Co., Ltd