Author Topic: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)  (Read 57805 times)

0 Members and 1 Guest are viewing this topic.

Offline ExtendeD

  • CoT Emeritus
  • LV8 Addict (Next: 1000)
  • *
  • Posts: 825
  • Rating: +167/-2
    • View Profile
Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
« Reply #135 on: August 17, 2013, 08:13:46 pm »
As I'm working on USB calc-to-calc connectivity with Ndless, I'm actually hooking into NavNet, which is the TI-Nspire specific protocol and TI driver for standard OS services (dir listing, screenshots, file transfers, ...). The new syscalls can be used to call services and expose new ones.
This may be useful for the package manager if the calculator side wants to communicate specifically with the computer side.

http://www.mirari.fr/UcCi (computer side on the left, calculator side on the right, this is a simple echo service).

Writing both the client and host programs requires less than 50 lines of code (Interestingly the host side can be ported to the TI-Nspire with few changes for calc to calc transfers, although this might not make sense for a package manager).
I'm not sure if NavNet requires the computer to initiate the service calls (all the standard services are computer to calc...).

(Lionel, I'm at the moment loading navnet.dll, but switching to libticalcs when running on Linux shouldn't be too difficult I suppose as long as we can match the 2 APIs).
Ndless.me with the finest TI-Nspire programs

Offline Vogtinator

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1193
  • Rating: +108/-5
  • Instruction counter
    • View Profile
Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
« Reply #136 on: August 17, 2013, 08:24:47 pm »
This is just... perfect!
With this we can make our own "exec" and even transfer files without tns or compressed or below /documents or debug easier!

Quote
As I'm working on USB calc-to-calc connectivity with Ndless, I'm actually hooking into NavNet, which is the TI-Nspire specific protocol and TI driver for standard OS services (dir listing, screenshots, file transfers, ...). The new syscalls can be used to call services and expose new ones.
How did you find it out? I mean, the OS is big and the USB protocol and such things are quite complicated in software.
Searching for function addresses and finding out which parameter is what surely took long.

Quote
(Lionel, I'm at the moment loading navnet.dll, but switching to libticalcs when running on Linux shouldn't be too difficult I suppose as long as we can match the 2 APIs).
Oh, the API for TI-8* and nspires is the exact same, so I fear it's not possible without more functions exposed..

Offline Adriweb

  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1708
  • Rating: +229/-17
    • View Profile
    • TI-Planet.org
Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
« Reply #137 on: August 17, 2013, 09:21:23 pm »
Indeed, congratulations, looks very nice :)  (and quite simple !)

Although that would mean for ndless-calcs only (at least for non-standard stuff I suppose?), the main purposes would be to enhance the features by sending commands to the nspire to, like, automatically move files, for example, once transferred, right ?
Or do you have other usecases in mind ? (I guess you opened a door for imagination ^^)
« Last Edit: August 17, 2013, 11:12:31 pm by adriweb »
My calculator programs
TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation

Offline Lionel Debroux

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2135
  • Rating: +290/-45
    • View Profile
    • TI-Chess Team
Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
« Reply #138 on: August 18, 2013, 02:51:13 am »
Quote
I'm not sure if NavNet requires the computer to initiate the service calls (all the standard services are computer to calc...).
TINC(L)S, and therefore libticalcs, does it, so I'd say "probably" :)

Quote
(Lionel, I'm at the moment loading navnet.dll, but switching to libticalcs when running on Linux shouldn't be too difficult I suppose as long as we can match the 2 APIs).
It's alright to use, in the beginning, an API that you already know because you already used it in the fairly distant past for Ndless.
At the time, libticables' special version of the libusb DLLs, required for working around bugginess in the Nspire's linking code, did not have either signature or filter driver support. Romain tried to mainline the changes a long time ago, he didn't receive a reply; I retried, and this time, I got a reply, made a patch, which got improved and integrated into the official version with filter driver support and signature.
Now that the main reason for not working with libti* has disappeared (although the belief that TI's software and libti*/TILP are mutually exclusive is so entrenched that more than two years later, some people still don't know about it), libti* support should be added quickly enough, so that community software such as pacspire doesn't depend (only) on TI's proprietary code ;)

Quote
Oh, the API for TI-8* and nspires is the exact same, so I fear it's not possible without more functions exposed..
Wrong. Remember from above, all implemented Nspire functions are exposed by libticalcs nowadays ;)
Functions which do not fit into the common API are actually, and currently, a thing of the TI-83+ family, far more than a thing of the Nspire family. There's a single Nspire operation which does not fit into the common API: Nspire keypresses, which do not fit in 16 bits, unlike TI-Z80 and TI-68k keypresses. However, the TI-83+ family has a dozen functions which do not exist on other models. A little while ago, I made a low-usefulness patch for adding a number of such functions; it's queued in a local branch, but I have not committed it to master yet because, precisely, the usefulness is low.
If support for quizzes, and various other functionality rarely used outside of special equipment in classrooms, baked into TI's higher-level libraries which use NavNet.dll, were to be added to libticalcs, then the number of functions which do not fit into the common API would rise.


EDIT: looking at the code:
* the group of initialization functions, from TI_NN_Init() to TI_NN_DestroyOperationHandle(), can be replaced by libticables / libticalcs equivalents, see the authoritative test_ticalcs_2 example in the libticalcs source.
* TI_NN_Connect() <-> nsp_session_open() defined in nsp_vpkt.h;
* in this situation, TI_NN_Write() is the exact equivalent (with a different SID) of nsp_cmd_s_echo() defined in nsp_cmd.h, which calls nsp_vtl_pkt_new_ex() + nsp_send_data() + nsp_vtl_pkt_del(), all from nsp_vpkt.h;
* likewise, TI_NN_Read is nsp_cmd_r_echo(), i.e. nsp_vtl_pkt_new() + nsp_recv_data() + nsp_vtl_pkt_del();
* TI_NN_Disconnect() <-> nsp_session_close() defined in nsp_vpkt.h;
The nsp_cmd_s/r_echo() pair is used by is_ready() in calc_nsp.c, used as a function pointer by the common ticalcs_calc_isready() API.

I guess I could add a pair of helper functions to nsp_cmd.c/.h:
* a near-copy of nsp_cmd_s_echo(), taking the last argument of nsp_vtl_pkt_new_ex() as parameter;
* a near-copy of nsp_cmd_r_echo(), taking the argument of ticalcs_info() as parameter.
« Last Edit: August 18, 2013, 03:18:35 am by Lionel Debroux »
Member of the TI-Chess Team.
Co-maintainer of GCC4TI (GCC4TI online documentation), TILP and TIEmu.
Co-admin of TI-Planet.

Offline ExtendeD

  • CoT Emeritus
  • LV8 Addict (Next: 1000)
  • *
  • Posts: 825
  • Rating: +167/-2
    • View Profile
Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
« Reply #139 on: August 18, 2013, 03:40:22 am »
How did you find it out? I mean, the OS is big and the USB protocol and such things are quite complicated in software.
Searching for function addresses and finding out which parameter is what surely took long.

I have been working with the Java bindings of NavNet for Ndless 1.1 and documenting the protocol a few years ago so I know the main concepts quite well. And logging is extensively available both on the computer and calculator side (NavNet is crossed-compiled).

I am giving up researches on the low level USB device API as it appears to be a proprietary Jungo API. Finding the FreeBSD host USBDI API was easier with the FreeBSD source code available.

Although that would mean for ndless-calcs only (at least for non-standard stuff I suppose?), the main purposes would be to enhance the features by sending commands to the nspire to, like, automatically move files, for example, once transferred, right ?

Yes, maybe its use should be limited to special operations indeed.

Quote
Or do you have other usecases in mind ? (I guess you opened a door for imagination ^^)

I'm a also working on this to provide an API for calc to calc transfers for Ndless programs.
« Last Edit: August 18, 2013, 03:44:57 am by ExtendeD »
Ndless.me with the finest TI-Nspire programs

Offline Legimet

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 336
  • Rating: +29/-0
    • View Profile
Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
« Reply #140 on: August 18, 2013, 06:47:59 am »
This looks interesting. I'll see if I can add some features (once I install the latest Ndless SDK)

Offline ExtendeD

  • CoT Emeritus
  • LV8 Addict (Next: 1000)
  • *
  • Posts: 825
  • Rating: +167/-2
    • View Profile
Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
« Reply #141 on: August 18, 2013, 09:56:55 am »
I have been able to confirm that the computer side can also expose NavNet services, and the calculator side can initate requests. NavNet does offer  2 way USB communication with a common API for calc-to-calc and calc/computer transfers.

Here's a a simple Google search demo which doesn't require much code to work (switch to HD if the video is too blurred):



I'll soon commit this to Ndless and share the demos to make it possible to bind pacspire with the Adriweb's API.
Ndless.me with the finest TI-Nspire programs

Offline ElementCoder

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 611
  • Rating: +42/-2
    • View Profile
Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
« Reply #142 on: August 18, 2013, 10:07:48 am »
This project is going like a rocket it seems o.o You guys are doing an awesome job, just wanted to say that; keep it up ;D

Some people need a high five in the face... with a chair.
~EC

Offline Jim Bauwens

  • Lua! Nspire! Linux!
  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1881
  • Rating: +206/-7
  • Linux!
    • View Profile
    • nothing...
Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
« Reply #143 on: August 18, 2013, 10:47:47 am »
Very nice work ExtendeD! I'm looking forward to seeing the stuff in the Ndless API :)

Offline Adriweb

  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1708
  • Rating: +229/-17
    • View Profile
    • TI-Planet.org
Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
« Reply #144 on: August 18, 2013, 11:31:01 am »
Indeed, pretty nice demo :)
My calculator programs
TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation

Offline AlexisVieira

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 100
  • Rating: +1/-1
    • View Profile
Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
« Reply #145 on: August 18, 2013, 11:48:39 am »
nice work extended :)
I'm Portuguese, sorry bad English

Offline Legimet

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 336
  • Rating: +29/-0
    • View Profile
Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
« Reply #146 on: August 22, 2013, 01:21:56 pm »
I just checked the svn, and the TI_NN* syscalls were added in r878. :)
« Last Edit: August 22, 2013, 01:22:19 pm by Legimet »

Offline compu

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 275
  • Rating: +63/-3
    • View Profile
Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
« Reply #147 on: August 22, 2013, 01:53:09 pm »
Nice!
I'm going to the Gamescom this weekend, so I won't be able to try them out before next week :P

Offline ExtendeD

  • CoT Emeritus
  • LV8 Addict (Next: 1000)
  • *
  • Posts: 825
  • Rating: +167/-2
    • View Profile
Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
« Reply #148 on: August 22, 2013, 04:44:36 pm »
I have only commited the addresses, I'm currently working on the functions definitions and tests.
Ndless.me with the finest TI-Nspire programs

Offline Adriweb

  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1708
  • Rating: +229/-17
    • View Profile
    • TI-Planet.org
Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
« Reply #149 on: August 30, 2013, 10:35:35 am »
Ok, I'm back to France, here are some changes :

- Removed the limit in number of results (it was 500 before)
- You can now list all files for a given platform, as requested :   ...&req=search&platform=68k   for example.
- Changed all occurences of "title" by "name" which makes more sense, I believe.
- Rewrote the wtf-esque multiple-fields-to-array things, which simplified other things.
- "Author", "Category", and "Platform" fields are now always arrays of string(s)

HTTP Auth is still in the todo list but it quite heavily depends on getting apache to run correctly, which is not a quickfix... For now, no changes to the the method of getting results : http get/post with the api key parameter.


Commit : https://github.com/TI-Planet/API/commit/3a33e075ec6e8a259dbf4cc14875891ca2dd3dc2
« Last Edit: August 30, 2013, 11:25:27 am by adriweb »
My calculator programs
TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation