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

Thread: teensy 4 and wifi

  1. #1
    Senior Member
    Join Date
    Jan 2014
    Posts
    189

    teensy 4 and wifi

    I want to provide wifi to my teensy 4/4.1 system. I have seen older forum entries and was
    wondering if anyone has a current working system?

    I worked with some 8266 parts and teensy 3.2 a few years ago.

    I don't need coprocessing. I just want to dump the files on the sd card to a web site.

    I see blackketter's esp32 sidecar post which is a few years old.
    I also see (and ordered a few) of the adafruit airlift eps32 boards yet read there were some modifications
    necessry for the Teensy 4

    thanks for any guidance,

    Richie
    Last edited by RichardFerraro; 09-17-2021 at 02:09 PM. Reason: added airlift

  2. #2
    Senior Member vjmuzik's Avatar
    Join Date
    Apr 2017
    Posts
    822
    An ESP module is probably the easiest and fastest way to get up and running. Theoretically it can support a SDIO or USB WiFi chip, but I haven’t found one with good documentation publicly available to try and add one.

  3. #3
    Member
    Join Date
    Sep 2021
    Posts
    70
    Usb wlan would be cool.

  4. #4
    Senior Member vjmuzik's Avatar
    Join Date
    Apr 2017
    Posts
    822
    Unfortunately I haven’t been able to find one with proper documentation so the only option would be to reverse engineer an open source Linux driver. Which is currently beyond my level of understanding and the time I have available to dedicate to it is a little short. Before the Teensy 4.1 with built in Ethernet I did have a USB Ethernet adapter working on a 3.6 because luckily I was able to find the documentation for its chipset(plus a little bit of USB sniffing).

  5. #5
    Senior Member
    Join Date
    Feb 2020
    Posts
    101
    What mods are needed for airlift?

  6. #6
    I would (and I hate to say it) but and ESP32 will be the easiest to implement. I have a few applications, one is a home monitoring system that reads sensor data and serves a web page so I can view on a PC or phone.

    1. do you want to update data on the web page or just dump data from an SD card to the web page
    2. do you want to have any controls (buttons, sliders) on the web page so you can send instructions back to the web server?
    3. how many clients do you expect (the ESP can handle up to 4 clients)?

  7. #7
    Senior Member
    Join Date
    Jan 2014
    Posts
    189
    Thanks for responding.
    All the Teensy 4's are clients.
    My plan is to have a server (e.g., AWS) which receives files from the clients (Teensy 4s).
    Ideally, the server could also send files to the clients.

    I ordered a couple of the airlifts hoping someone knows how to interface its ESP32 to the Teensy 4.
    Seems like something people would be interested in.

    Are you using ESP32 and Teensy 4/4.1 ?
    Are you using SPI? Serial?
    Would you share some of your work to help me get going, at least to get the
    Teensy 4s to connect to the internet.

    thanks,

    RIchie

  8. #8
    We maybe talking about different applications, for mine

    1. Teensy 3.2 measures data, sends wireless data to ESP32 (using EBYTE transceivers)
    2. ESP32 has and EBYTE and reads incoming data, processes, and builds a web page an acts as an access point
    3. a Smart TV connects to the ESP32 server to display the web page
    4. Teensy 3.2 measures data and sends to the server every second
    5. ESP again reads incoming data, and creates and XML and sends to the web page JAVA using AJAX updates data on the page

    I'm not exactly sure what you are trying to do, at any rate, hang on to your hat, AJAX, HTML coding is very challenging.

  9. #9
    Senior Member
    Join Date
    Jan 2014
    Posts
    189
    Nicely done. I am using a Teensy 4.1 to control a palette generator instrument I designed.
    People playing the instrument create color palettes that are stored on sd-card.
    I want to connect 8266 or esp32 to Teensy 4.1 to allow Teensy 4.1 to send the palettes to a server.

    So, it is a bit different from your application.

    thanks and good luck.

  10. #10
    Hi Richie, nice to see our paths are crossing again! I've spent the last two months working on a way to serve files from a Teensy over WiFi using a ESP* chip. My project is close to working but I've been stuck on ESP32 mutitasking/multicore issues for the last couple weeks. As of now I can:

    - Connect my Teensy 4.1 with microSD card to an ESP32 using a serial port (two wires only)
    - Run a slightly modified ESP_AsyncFSBrowser sketch on the ESP32, which can interact with a remote filesystem connected over serial (the Teensy 4.1's SD filesystem), and serve files from the remote filesystem
    - Download files over WiFi using the browser or curl with >50% success rate, but occasional missing bytes (because of the multitasking/multicore issue I've been stuck on)

    An underwhelming image, but this shows two filesystems being served to a webpage, "SD" is the local SD on the ESP32, "myfs" is the Teensy's SD. When a file is loaded there's a preview/editor usable on the right side.
    Click image for larger version. 

Name:	unknown.jpg 
Views:	15 
Size:	26.0 KB 
ID:	25990

    I've given up on fixing the occasional missing bytes, and I'm now focusing on making the serial link reliable with error checking and retransmits if needed, which should hopefully compensate for the missing bytes issue. I need to add support for uploading/editing files too which should be relatively easy.

    I'm working with an ESP32 dev board right now, but believe this should work just as well only slower on an ESP8266, e.g. a $2 ESP-01 module. I haven't tried using an Airlift yet, but I have an Airlift dev board and since it only needs two pins to connect it should work just fine with Airlift, and I'll verify at some point.

    This isn't exactly what you asked for, but I think will solve the problem of retrieving files from your Teensy over WiFi. If you want to upload files to a remote server, I suggest getting that functionality working with an ESP32, uploading files from a local file system (e.g. LittleFS stored in flash), and then you can switch to the remote teensy filesystem once my library is more stable. What I'm working on won't directly help you run code on the Teensy that pushes files to a remote server though I found an (out of date) project that does that: https://github.com/jeelabs/esp-link

  11. #11
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    15,105
    Quote Originally Posted by embedded-creations View Post
    ...
    - Connect my Teensy 4.1 with microSD card to an ESP32 using a serial port (two wires only)
    ...
    Does "(two wires only)" include a needed common Ground line between the two devices?

  12. #12
    Of course. I meant two data wires, two GPIO pins on the micros

  13. #13
    Senior Member
    Join Date
    Jan 2014
    Posts
    189
    I have successfully connected the AirLift (ESP32) to a Teensy 4.1 and run several of the examples allowing scanning, WPA , SSL , JSON.
    It was effortless.
    The examples for non circuit python are at https://learn.adafruit.com/adafruit-...eakout/arduino

    Pins connected:
    BUSY to 4.1 pin 9 (any pin)
    CS to 4.1 pin 10 (any pin)
    MOSI to 4.1 pin 11
    MISO to 4.1 pin 12
    SPI_CLK to 4.1 pin 13
    RESET to 4.1 pin 41 (any pin)
    GP0 to 4.1 pin 40 (any pin)

  14. #14
    Junior Member
    Join Date
    Sep 2019
    Posts
    9
    It's normally forgotten about, but you can use a Raspberry Pi Zero W or Raspberry Pi 3A for less than the cost of some implementations of WiFi. There can be a bit of a learning curve writing a server daemon to handle the data, but the hardware is pretty rock solid at this point. There are currently a few 5gHz WiFi modules, but almost everything embedded is 2.4gHz due to price and power budget.

  15. #15
    Junior Member
    Join Date
    Oct 2021
    Location
    Chicago
    Posts
    1
    Such an informative post.Thank you for sharing the great knowledge.

Posting Permissions

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