Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 4 of 4

Thread: Web Server on Teensy via USB

  1. #1
    Junior Member
    Join Date
    May 2015
    Posts
    1

    Web Server on Teensy via USB

    Trying to understand how it is possible to run a web server (preferably Node JS) on the Teensy via the USB port (i.e. as a pendrive kind of thing)
    The idea is to build a device that can be first setup via USB connection using the server, while then eventually connect to a WAP WiFi network for example.

    My guess is that in the old days modems would connect to the internet via Serial Port; nowadays we have USB, and there must be a way to connect from serial to a TCP socket to run a HTTP server.

    Any hint at the direction to look would be helpful.
    Browsing the web I see many project aiming at running a server on the computer to talk to the Teensy or Arduino hardware, but not much about running the server on the Teensy itself.

    Thanks for help.

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    21,279
    Well, the answer really depends on the meaning of the word "possible"...

    I mean, it's "possible" to dig deeply into the USB code and write another USB device type for RNDIS or CDC ECM protocol. Then it's also possible to implement low-level protocols on top of that, like ARP, IP, ICMP, DHCP & UDP, so you have basic IP-level packet service.

    In fact, I'm planning to do that later this year, mainly targeted at Artnet/E1.31 lighting and Open Sound Control. Both of those use UDP for lowest latency, and they suffer extra latency and other inconvenient issues when used over serial protocols like SLIP or PPP. Hopefully native USB networking with UDP will allow really awesome USB-only projects that have traditionally not been very feasible over USB serial (latency issues) or HID (bandwidth issues).

    Then it's also "possible" to implement TCP on top of IP & ICMP. If done using the Arduino core library APIs, it might even be possible for that to work with already-developed minimal web server libraries. Maybe? Maybe not? I'm pretty sure all that stuff has only ever been tested with the Ethernet library, so whether it can work with different underlying networking or if it somehow depends on quirks of the Ethernet library is a good question.

    Of course, it's also "possible" to write your own web server on top of the networking protocols. A minimal one without support for much of anything can be found in the Ethernet examples.

    So yes, it is "possible", for some theoretical sense of the word, where you have incredible amounts of time to write a lot of quite difficult code.

    But if "possible" includes some realistic limits, then I'd recommend looking at the BeagleBone Black board. I'm pretty sure the Linux USB Gadget API gives you these features and makes such a project "possible" within a realistic amount of time.

  3. #3
    Junior Member
    Join Date
    Mar 2018
    Posts
    3
    Is there any news on this? This would open up such great possibilities of creating browser based interfaces for the teensy (:

  4. #4
    Senior Member xxxajk's Avatar
    Join Date
    Nov 2013
    Location
    Buffalo, NY USA
    Posts
    532
    My IP implementation
    https://github.com/xxxajk/ajkstack
    has a web server. HTH :-)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •