Omnimaga

Calculator Community => Other Calc-Related Projects and Ideas => TI-Nspire => Topic started by: compu on March 24, 2012, 05:17:07 pm

Title: IRC on the Nspire
Post by: compu on March 24, 2012, 05:17:07 pm
Hi :)

I have written a tiny IRC client for the Nspire using RS232.
It requires a program on the PC to be running that forwards a TCP connection to the calculator.
The IRC protocol is completely handled by the Nspire.

At the moment it is really limited, it can join one channel and read/write messages, it can view status changes, joins/parts and receive PMs.
It is based on Nspire I/O (http://nspforge.unsads.com/p/nspireio/wiki) (1.0) and I'm currently updating it to work with 2.0 which would make it possible to have multiple channels, IRC color codes and more.
I won't release the source of this version, because it is really messy and buggy, but maybe I'll release a better version of it in the next days :P

(http://0wx.de/b38b86904a87e8027f5082fd01bd3ad3.jpg)

The PC software is written in Python. It waits for IP/Host and port to be sent from the calc and then opens a socket.

(http://0wx.de/18d6be35de320086dec5085f75c045f4.png)


And this is how the next version will probably look like :)

(http://0wx.de/7f0749fdcbfea48407f1c4513d660e57.png)
Title: Re: IRC on the Nspire
Post by: Scipi on March 24, 2012, 05:27:39 pm
O.O

That's impressive!
/me wonders if this will go like gCn and Gossamer and well eventually see an internet browser for the Nspire. :P
Title: Re: IRC on the Nspire
Post by: renatose on March 24, 2012, 05:37:02 pm
Gr8 :D try to connect it to the omnimaga IRC channel once it is more stable ;)
Title: Re: IRC on the Nspire
Post by: compu on March 24, 2012, 05:39:33 pm
That works already. I can get it there if you want ;)
Title: Re: IRC on the Nspire
Post by: Jim Bauwens on March 24, 2012, 05:58:12 pm
Nice! How do you handle the serial connection? Do you use stdin, or talk directly to the hardware?
Title: Re: IRC on the Nspire
Post by: DJ Omnimaga on March 24, 2012, 06:00:37 pm
Did you just create a gCn clone for the TI-Nspire? O.O

This is nice. We already have this for the 83+, as well as an internet browser (without cookie support and in text mode), so it would definitively be nice to see more internet-related stuff happen.

By the way if this wasn't for the extra hardware requirements, this would have big potential for online games on the TI-Nspire too, like some of the Cemetech 83+ games.
Title: Re: IRC on the Nspire
Post by: compu on March 24, 2012, 06:04:23 pm
Nice! How do you handle the serial connection? Do you use stdin, or talk directly to the hardware?
I use direct HW access, because there are no asynchronous functions for reading available. And I don't have that annoying clock.

(Source of my UART functions here (http://nspforge.unsads.com/p/nspireio/browser/trunk/uart.c))
Title: Re: IRC on the Nspire
Post by: Juju on March 24, 2012, 06:07:02 pm
Hey, that's pretty cool :D
Title: Re: IRC on the Nspire
Post by: hellninjas on March 24, 2012, 06:32:24 pm
My mind has been blown!
Very cool job!
Title: Re: IRC on the Nspire
Post by: apcalc on March 24, 2012, 10:31:10 pm
WOW!

Excellent Job!  This is Amazing! ;D
Title: Re: IRC on the Nspire
Post by: Jim Bauwens on March 25, 2012, 08:01:34 am
I use direct HW access, because there are no asynchronous functions for reading available. And I don't have that annoying clock.

(Source of my UART functions here (http://nspforge.unsads.com/p/nspireio/browser/trunk/uart.c))
Thanks  for the code!
I wanted to do something similar, but did not have the knowhow for direct hw access.

Great :)
Title: Re: IRC on the Nspire
Post by: Chockosta on March 25, 2012, 09:48:18 am
Impressive !
This is really nice, great job...
Title: Re: IRC on the Nspire
Post by: Jim Bauwens on March 25, 2012, 11:26:42 am
Alright, relayed on TI-Planet and yAronet (thanks Lionel!):
http://tiplanet.org/forum/viewtopic.php?f=43&t=8941
http://www.yaronet.com/posts.php?s=147508
Title: Re: IRC on the Nspire
Post by: DJ Omnimaga on March 25, 2012, 12:46:10 pm
Nice. I almost think it would be a good idea to make a front page news about it here too when there is a download available. :)
Title: Re: IRC on the Nspire
Post by: compu on March 25, 2012, 01:26:28 pm
I'm currently working on a better version, but I'll have (most likely) no time for programming next week.
So, either I get the update finished today, or I will release the current (buggy and unstable) version later this evening ;)

EDIT:
I ran into some issues with receiving data with my own functions. Probably the FIFO of the internal UART gets filled too fast because I'm not handling any interrupts...
So, I won't get it finished today.

At least, my first version is working.
The server/port/nick/ident/realname/channel are hardcoded, so you'll have to recompile it if you want to change it (to compile it, you'll need this (http://nspforge.unsads.com/p/nspireio/browser/tags/1.0)).
Attached is the source + a binary for the #omnimaga channel and, of course, the Python script ;)

Spoiler For default config:
#define SERVER "irc.prison.net"
#define PORT 6667
#define NICK "nspire"
#define IDENT "compu"
#define REALNAME "TI-Nspire IRC beta test"
#define CHANNEL "#omnimaga"

The python script has to be run first, then click on irc.tns - it should connect automatically.
Oh, and you'll have to change the serial port number in this line (+ you need to have pySerial installed):
Code: [Select]
port = serial.Serial(15,115200)
Title: Re: IRC on the Nspire
Post by: Kjelddy on March 25, 2012, 04:34:49 pm
This is AWSOME :P
great job compu :)
Title: Re: IRC on the Nspire
Post by: AzNg0d1030 on March 27, 2012, 07:25:24 pm
Omg... now I can use a CALCULATOR to go on IRC.  Computer, iPhone, then Nintendo DS, and now a calculator... heck yeah!

Is it possible to post a little video?
Title: Re: IRC on the Nspire
Post by: Jonius7 on March 28, 2012, 12:40:44 am
Omg... now I can use a CALCULATOR to go on IRC.  Computer, iPhone, then Nintendo DS, and now a calculator... heck yeah!

Is it possible to post a little video?
Post a video using the nspire video player!
Wow we can really do a lot of stuff on a calculator these days.
IRC connection seems unreal for just a calculator! Can't wait for it to be available for Omnimaga chat!
Title: Re: IRC on the Nspire
Post by: AzNg0d1030 on April 06, 2012, 07:41:58 pm
Is there any progress on this IRC client?

edit: Is it supported on CX/CX CAS? I think I must've used it wrong, but i transferred the irc.tns over to my CX CAS and ran it and it froze my calc.  Can you give a tutorial on how to use it?
Title: Re: IRC on the Nspire
Post by: DJ Omnimaga on April 06, 2012, 08:50:12 pm
There's a beta? O.O
Title: Re: IRC on the Nspire
Post by: compu on April 07, 2012, 05:00:43 am
There's a beta? O.O
Yes, last post on Page 1, but it is probably not easy to use ( + you need a USB -> TTL adaptor)

I can continue working on it tuesday, to add CX Support to my library.
Title: Re: IRC on the Nspire
Post by: AzNg0d1030 on April 07, 2012, 04:40:33 pm
There's a beta? O.O
Yes, last post on Page 1, but it is probably not easy to use ( + you need a USB -> TTL adaptor)
 
I can continue working on it tuesday, to add CX Support to my library.
Oh so it wasn't supported XD
Title: Re: IRC on the Nspire
Post by: aeTIos on April 08, 2012, 05:25:12 pm
Nice. The stupid part about all calc<>internet stuff is that you still need a pc.
Title: Re: IRC on the Nspire
Post by: DJ Omnimaga on April 08, 2012, 05:40:21 pm
There's a beta? O.O
Yes, last post on Page 1, but it is probably not easy to use ( + you need a USB -> TTL adaptor)

I can continue working on it tuesday, to add CX Support to my library.
Aw I see. I do not have that kind of hardware. Any chance of a direct USB version in the future? I mean something like gCn.
Title: Re: IRC on the Nspire
Post by: ruler501 on April 08, 2012, 06:51:39 pm
Nice. The stupid part about all calc<>internet stuff is that you still need a pc.
Unless they get wireless dongles working with the nspire
Title: Re: IRC on the Nspire
Post by: AzNg0d1030 on April 08, 2012, 07:09:01 pm
/me sighs
TTL adapter... :\
Title: Re: IRC on the Nspire
Post by: renatose on October 26, 2012, 02:16:07 pm
@compu are you still working on this?
Title: Re: IRC on the Nspire
Post by: compu on October 26, 2012, 02:48:10 pm
Nope. I've thought about it, but don't have the motivation to continue it (I think there were some problems with the input buffer overflowing, so the stuff the PC sends to the Nspire is only received partially :/ )
Title: Re: IRC on the Nspire
Post by: renatose on October 26, 2012, 04:29:47 pm
hmm... what if the pc sent the data in small parts such that you would be sure that it would not overflow the buffer and then the calc answered to the pc that it able to recieve more data?
Title: Re: IRC on the Nspire
Post by: compu on October 26, 2012, 04:36:48 pm
Or I could lower the baud rate, use interrupts, etc etc... but like I said, I'm not really motivated to continue this (at the moment - maybe I'll do it sometime ;) )
Title: Re: IRC on the Nspire
Post by: renatose on October 26, 2012, 07:02:34 pm
That's ok, I was in the hope of using it as a way to communicate in a bidirectional mode with arduino.
That way I could play with it without messing aroung with programming to the nspire...
Some function counter-equivalent to the Lua (restored by fixprint) print() to read incoming characters like a read_serial(char c) would be a giant step to make bi-directional communications easier with Lua... Can you imagine a multiplayer Lua with each player on one calc? it could be achieved with that function...
Title: Re: IRC on the Nspire
Post by: compu on October 26, 2012, 07:35:19 pm
What about multiplayer C? We have functions for serial read/write there ;)
Title: Re: IRC on the Nspire
Post by: Jim Bauwens on October 27, 2012, 04:50:47 am
Multiplayer Lua is possible, and has already been done. But the calculator needs to be connected to a computer using usb, sadly enough.
Title: Re: IRC on the Nspire
Post by: renatose on October 27, 2012, 06:18:33 am
Multiplayer Lua is possible, and has already been done. But the calculator needs to be connected to a computer using usb, sadly enough.
I meant Multiplayer Lua without computer only through serial between the calcs directly...
With the means to do that I could do virtually anything I could immagine being controled by the calc. Could you dream about a robot controled by a nspire? i.e. the nspire being the brain of a robot.
I could achieve that if the serial communications in both ways were easier.
What about multiplayer C? We have functions for serial read/write there ;)
If that functions could be implemented to be used from Lua it would be awesome! :D
Title: Re: IRC on the Nspire
Post by: Adriweb on October 27, 2012, 07:17:58 am
Multiplayer Lua is possible, and has already been done. But the calculator needs to be connected to a computer using usb, sadly enough.
I meant Multiplayer Lua without computer only through serial between the calcs directly...
With the means to do that I could do virtually anything I could immagine being controled by the calc. Could you dream about a robot controled by a nspire? i.e. the nspire being the brain of a robot.

Well, with Lua only it's possible and it's been done too, but only in os 3.0.x.
For example :



We'll see if futures OSes restore the print() function back...
Title: Re: IRC on the Nspire
Post by: Lionel Debroux on October 27, 2012, 07:27:02 am
As mentioned above, fixprint would make it possible to do the same thing with OS 3.1 ;)
Title: Re: IRC on the Nspire
Post by: Adriweb on October 27, 2012, 08:23:45 am
yup :)

And also, controlling robots etc. seems very interesting :D
Title: Re: IRC on the Nspire
Post by: Deep Toaster on October 27, 2012, 01:37:12 pm
Internet on Every Calculator. Now that's a nice idea :D Awesome program!
Title: Re: IRC on the Nspire
Post by: renatose on October 28, 2012, 12:06:50 pm
well... with controlling robots sending orders isn't everyting, reading data from sensors is essential also so having the print() function in Lua is only half-way to see it happening...
Title: Re: IRC on the Nspire
Post by: DJ Omnimaga on October 28, 2012, 06:23:46 pm
Multiplayer Lua is possible, and has already been done. But the calculator needs to be connected to a computer using usb, sadly enough.
I meant Multiplayer Lua without computer only through serial between the calcs directly...
With the means to do that I could do virtually anything I could immagine being controled by the calc. Could you dream about a robot controled by a nspire? i.e. the nspire being the brain of a robot.

Well, with Lua only it's possible and it's been done too, but only in os 3.0.x.
For example :



We'll see if futures OSes restore the print() function back...
I thought it was brought back up (or at least partially) in OS 3.2? ???
Title: Re: IRC on the Nspire
Post by: _Nicco_ on October 28, 2012, 09:54:54 pm
Would it be possible to get it to work with the Navigator wireless attachment?  I know they're expensive but that would be pretty cool.  :)
Title: Re: IRC on the Nspire
Post by: TIfanx1999 on October 29, 2012, 02:04:32 am
Actually, a usb wifi adapter would probably be better. ;)
Title: Re: IRC on the Nspire
Post by: aeTIos on October 29, 2012, 05:07:35 am
^yep. Those happen to be quite cheap around here O.O ($10 is quite low I think)

also you might convince TI to put print() back if you tell them about the educational purposes it could have (robotics and so)
Title: Re: IRC on the Nspire
Post by: Lionel Debroux on October 29, 2012, 06:11:39 am
Adriweb and jimbauwens definitely talked to TI about the problem... to no avail, at the time of this writing.
Title: Re: IRC on the Nspire
Post by: aeTIos on October 29, 2012, 06:13:27 am
too bad D: Hope you have better results some time.
Title: Re: IRC on the Nspire
Post by: Adriweb on October 29, 2012, 09:51:40 am
Adriweb and jimbauwens definitely talked to TI about the problem... to no avail, at the time of this writing.

It is "supposed" to be back at some point, as far as I know.


also you might convince TI to put print() back if you tell them about the educational purposes it could have (robotics and so)
Exactly what we did :)
Title: Re: IRC on the Nspire
Post by: Jim Bauwens on October 29, 2012, 02:19:23 pm
Adriweb and jimbauwens definitely talked to TI about the problem... to no avail, at the time of this writing.

Quote from: Some person at TI
...
We redirected the output of the print command to the console log of the integrated script editor. In retrospect, we should have maintained the print connection to stdout until the script editor console was fully implemented. Do you see value in continuing to send print output to stdout in addition to the script editor console?

Of course, I said yes.

Quote from: Person at TI
I submitted a change request to reinstate output to stdout. I cannot guarantee the change control board will approve the change in time for the next software release. I quoted large parts of your email in the request.

Quote
Jim,

The change control board rejected the request. It comes too close to the end of the current development cycle. I'll add the change to the requirements for the next development cycle.

A bit later we asked how it was with the reintegration, and he answered this
Quote
I forwarded the request to turn print() back on in Lua to the product definition manager who defines requirements for Lua scripting. The feature should be a requirement for the next release. I'll check with him on the status of feature.

I wouldn't say "to no avail" ;)

And I hope I don't lose my NDA because of this post.
Title: Re: IRC on the Nspire
Post by: Lionel Debroux on October 29, 2012, 03:16:18 pm
Until it's available in OS 3.3 / 4.0, we can't say that it's not "to no avail" ;)
Title: Re: IRC on the Nspire
Post by: Jim Bauwens on October 29, 2012, 04:23:23 pm
No offense, but think that's just stinkin' thinkin'. Give them at least a chance ^^
Title: Re: IRC on the Nspire
Post by: Lionel Debroux on October 29, 2012, 04:33:55 pm
There have been so many things that we wished, but they did not grant (and sometimes, had to grant ourselves), that we should not get ourselves excited until it's done ;)
Title: Re: IRC on the Nspire
Post by: renatose on October 29, 2012, 08:03:55 pm
There have been so many things that we wished, but they did not grant (and sometimes, had to grant ourselves), that we should not get ourselves excited until it's done ;)
thats right ;)
@Jim Bawens and what if TI included also a "listen()" to receive data from the RX serial?
EDIT: by data I mean text, of course... even char by char would be awesome...
Title: Re: IRC on the Nspire
Post by: Jim Bauwens on October 30, 2012, 08:55:44 am
@Jim Bawens and what if TI included also a "listen()" to receive data from the RX serial?
EDIT: by data I mean text, of course... even char by char would be awesome...

I've asked that before, but 'Routing stdin to Lua is not in the cards for the near term'.
Title: Re: IRC on the Nspire
Post by: renatose on October 30, 2012, 10:20:58 am
Okay...
Do you think that it would be too dificult to be done by us, like the fixprint, maybe adding it to the fixprint code...
Title: Re: IRC on the Nspire
Post by: Jim Bauwens on October 30, 2012, 10:22:02 am
It wouldn't be too difficult, but someone needs to take the time to do it.
Title: Re: IRC on the Nspire
Post by: renatose on October 30, 2012, 10:33:16 am
maybe I'll give it a shot in the christmas break ;)
Title: Re: IRC on the Nspire
Post by: Dapianokid on April 19, 2013, 07:45:49 pm
Necropost...
DO WANT for CX CAS