Giter Site home page Giter Site logo

mathislav / internetce Goto Github PK

View Code? Open in Web Editor NEW
58.0 8.0 2.0 334 KB

C library for Ti-84+CE and Ti-83 Premium CE calculators, that allows you to interface with the internet.

License: GNU General Public License v3.0

Makefile 0.18% C 98.29% Assembly 1.53%
calculator c library internet-connection rndis ti-calculators ez80 ti-84-plus-ce ti-83-premium-ce internet

internetce's Introduction

Internet on your Ti-84+CE and Ti-83 Premium CE

This is a high-level library for interfacing with the internet on Ti-84+CE and Ti-83 Premium CE.

The scope of the library

What InternetCE can do:

  • Acquire an IP address with DHCP.
  • Make HTTP Get and Post requests.
  • Send DNS requests.
  • Send UDP/TCP/IPv4/Ethernet. In particular, you can handle any web protocol that the lib don't, such as IRC, SSH, etc.
  • Send an ICMP echo reply when receiving an echo request (ping).

What InternetCE canNOT do:

  • Make HTTPS requests as TLS is not supported yet.
  • Display the content of the accessed URL (it only provides you the data).
  • Handle IPv6.
  • Download resources bigger than 65535 bytes.

Getting started

  • Plug the calculator to any RNDIS device (basically your phone). To this end, you may need to buy an adapter. The "final cable" you need is something that has a male mini USB Type A at one end (for the calculator) and a male micro USB or USB Type C at the other end (for your phone). You can use for example :
    • The charger of your phone (USB <-> Micro USB or USB Type C) (you should already have this).
    • A Mini USB Type A Male <-> USB Female cable - For example : https://aliexpress.com/item/32780744354.html
      Warning : Make sure you choose the Mini A cable (in the color section)!
  • Transfer a program that has been compiled with the library.
  • Run it, and enable the USB internet connection sharing. On Android, it should be near the Wi-Fi Tethering menu.

Example of use

git clone this project and put the include/internet.h file into the include folder of your toolchain. Then modify the file src/minimal.c as you wish. You can find other examples of what you can do with the lib in the examples folder. For information, the minimal program using this library would be:

#include <internet.h>

int main(void) {
	web_Init();
	while(!web_Connected()) {
		web_WaitForEvents();
	}
	// Do whatever you want
	web_Cleanup();
	return 0;
}

Help & Bug report

As mentioned, some examples of use are available in the examples folder. You can draw inspiration from those programs. If you can't find what you want, feel free to ask your questions on forums such as Ti-Planet or Cemetech. This library may contain bugs. If you encounter one, please contact me on www.tiplanet.org or www.cemetech.net (Epharius).

internetce's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

internetce's Issues

Calculator crash, phone didn't detect it

Hello,
I had a problem with InternetCE: when I open the internet program on my calculator, either (with my program, it's only the minimal.c example) the screen is white, and I need to press a key to exit (the first time it reset my calculator), either (with the program sent in another issue by @MathisLav ), the screen display "Web connecting ...", and I couldn't do something as long I reset.
I twice case, my phone didn't detect the USB (to use USB Modem sharing) (I have a samsung on android 11), and my computer neither (I didn't know how to do usb tethering on windows.
Can you help me?
Thanks You

InternetCE does not work with recent smartphones

No less! The USB communication cannot establish between the calculator and any recent smartphone.
Indeed, InternetCE worked with my old phone and some others that, apparently, were old enough. But with newer phones, the latter briefly detects the calc, but do not start any USB exchange.

This may be due to a too low voltage, maybe the power that the calculator can provide is too low to start an exchange with a phone. Or maybe this is due to a software update between android 5 and at least android 8 that has changed the way a phone starts a USB communication.

A last possibility would be that USB C behaves differently from the old micro USB ports. But this doesn't make much sense as the USB C specifications are fully backward compatible with the old USB cables.

Anyway, if anyone has any clue about this, his help would be very appreciated.

USB-Tethering disabled with newer phones

I saw that an issue like this has already been created and fixed with a commit a few weeks back, but it still won't work for me...

I've tried it with a Pixel 7a with Android 14 and a Galaxy A71 with Android 13 (and both with USB-C) and I can't enable USB-Tethering for either of them. The phones are not the problem, when connected to a PC, the tethering works just fine.

Thanks for any help!

USB communication!

Awesome project man!

How did you do USB communication? I want to send some data to a rasp pi and basically couldn't.
Do you have tips or solutions?

Many thanks
Sven

Make InternetCE a real library

For now, InternetCE is directly compiled and linked into the user binary. However, InternetCE is getting bigger and bigger (~30Kio), and prevents the user from making big programs.

I understand that LibLoad can't be used with C code libraries, so I'm thinking of a way to use the intermediate .src code generated by the toolchain with LibLoad.

error with make

When trying to compile the program i get the a couple of errors:

C:\CEdev\examples\internettest\src\httpget.c
C:\CEDEV\INCLUDE\INTERNET.H     (149,17) :      ERROR (186) First dimension of "data" may not be omitted
C:\CEDEV\INCLUDE\INTERNET.H     (183,17) :      ERROR (186) First dimension of "data" may not be omitted
C:\CEDEV\INCLUDE\INTERNET.H     (192,20) :      ERROR (186) First dimension of "payload" may not be omitted
C:\CEDEV\INCLUDE\INTERNET.H     (217,20) :      ERROR (186) First dimension of "options" may not be omitted
C:\CEDEV\INCLUDE\INTERNET.H     (242,20) :      ERROR (186) First dimension of "options" may not be omitted
C:\CEDEV\EXAMPLES\INTERNETTEST\SRC\HTTPGET.C    (33,9) :        ERROR (108) Identifier "var_t" is not a variable or enumeration constant name
C:\CEDEV\EXAMPLES\INTERNETTEST\SRC\HTTPGET.C    (33,15) :       ERROR (128) Identifier "data" not defined within current scope
C:\CEDEV\EXAMPLES\INTERNETTEST\SRC\HTTPGET.C    (33,15) :       ERROR (100) Syntax error
C:\CEDEV\EXAMPLES\INTERNETTEST\SRC\HTTPGET.C    (33,13) :       WARNING (222) Statement has no effect
make: *** [obj/httpget.src] Error -1

any idea on how to fix this?
i followed your installation guide (with the help of google translate) from here

Complete DHCP support

  • Support DHCP lease duration
  • Request relevant information to the DHCP server
  • Release the allocated IP in web_Cleanup()
  • ?

Pulling the USB cable makes InternetCE crash

The program crashes when the USB connection is closed unexpectedly (cable pulled...).

It only happens after the calculator called usb_SetConfiguration(). From that moment, pulling the cable causes the stack to be corrupted.

It seems that it's more of an USBDRVCE issue but still, it would be nice to find a workaround for this.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.