Optimal WiiFi solution for Teensy

Status
Not open for further replies.

Epyon

Well-known member
Hi all

Over the past few years, I've done a number of different projects involving networked microcontrollers, most of them a Teensy combined with various Wiznet W5xxx chips. Important in these projects is the possibility of having DHCP, DNS and the ability of sending and parsing HTTP strings. With the Ethernet library, the Teensy+W5xxx combo has no problems accomplishing this.

For a new project I need to add WiFi as a connectivity option. I've searched this and other forums and blogs for the most optimal WiFi solution, particularly I'm looking for a solution that has an easy to use (wrapper) library. My requirements are:
  • Usable through Arduino IDE
  • Minimal changes needed to existing code (e.g. Arduino WiFi library)
  • DHCP and DNS support
  • Target platform must have support for the Ethernet library (I won't use both connectivity options at the same time however)
  • No AT commands please (I still have nightmares about writing a firmware that had to interface to a GPRS modem that only accepted a proprietary AT command set)

I've narrowed it down to the following options:
  • ESP8266: low price, decent performance. Bought a few modules to tinker with. Annoyingly a lot of modules with different firmware versions floating around. Haven't found a decent library with the features and ease of use of the Ethernet library yet.
  • Particle Photon: decent price, interesting features like cloud updates and monitoring. Bought a few modules. Stability seems to be an issue. My firmware heavily relies on serial, SPI and I2C I/O and the Photon seems to have trouble delivering deterministic performance on this. A lot of Arduino libraries are incompatible, and the price point is too high to just use it as a Wifi gateway.
  • CC3300: higher price point. Bought a few modules but have yet to play around with them. A lot of users are complaining about shaky performance though.

From a hardware point of view, the ESP8266 looks like the best solution. It has a low price, my application doesn't need high throughput and I can afford dedicating one of the Teensy UARTS to the module. Unfortunately library support still seems to be lacking at the moment.
From the software side, the Photon is the best option (on paper), but perfomance and price is less than optimal. Plus I would like to keep all my firmware on a single platform (Teensy).

Any advice or pointers on this?
 
Nice, I wanted to add network compatibility to my Home-Automation :)
I also researched a lot and found the ESP8266-method to be the best solution:
Look here
Sadly it is for the teensy 3 and I only got some teensy 1.0 and one teensy 2.0++.

Cant say anything about performancec etc. because I can't just buy some :(
Im waiting for christmas or birthday to get one of them :)

Wish you the best luck.
Please report any progress back here <3

Cheers
Blade

P.S.: Also check this
 
Last edited:
I have been developing such a library for my project. (works only with teensy 3x).
The library works for the most part, but not all functions are thoroughly tested yet.
I tested the library on some ethernet library examples to work.
I am using the library with Webduino and has been load testing it for a week now and seems stable.
It does require using rts/cts hardware handshake with esp8266 though. Not doing so will not be reliable, unless all that is being done is a blinky light demo.

don't bother with cc3300, I wasted a lot of time on that.
 
Thank you soo much, that is good to know.
I did not fully understand one sentence:
Not doing so will not be reliable, unless all that is being done is a blinky light demo
Does it mean, if I just want a blinky light demo I could go wifi with a teensy 3x without the esp8266?

Off-topic-question: (I delete this on your wish)
Since your are an expert in ethernet-to-teensy I wanted to ask if its possible to connect a LAN cable directly to the teensy's pins,
Or is something like the WIZ812 still needed?

Details:
At this moment i got a self-made low-budget home-automation with a 433,92MHz transmitter on a teensy.
Im running a Webserver on my modded Freetz-Box [with a usb-port for the teensy] and can now send commands via Network.
My next step would have been to go via ethernet and have the webserver on my teensy.
But wifi would be SOOO NICE :D
 
Thank you soo much, that is good to know.
I did not fully understand one sentence:

Does it mean, if I just want a blinky light demo I could go wifi with a teensy 3x without the esp8266?

It does require using rts/cts hardware handshake with esp8266 though. Not doing so will not be reliable, unless all that is being done is a blinky light demo.

No - Not to speak for doughboy - look here for topic on another thread and without hardware control the UART passage of large and FAST data (4,000,000 baud) data streams - or even less caused the ESP8266 to hang IIRC.

I'm interested in seeing this work as well. I started looking at the nRF24 family and never seriously tried as the ESP8266 looked like a much better solution adding an IDE programmable co-processor for the WiFi rather than arbitrary overhead making the Teensy slow down to do it. I used some DigiSpark ATtiny products before coming here and he started an ESP8266 Kickstarter so I bought into that and the wait should soon be over - shipping on or about Nov 1st.

Also @BIade - interesting thing about that is his ESP8266 hardware was doing software similar/forked to "Particle Photon" in some respects - so he signed up with them to be a supported platform - hopefully without hanging or other issues. It is low cost has a standard 64KB MCU and all pins and a 4MB flash- with or without a support power board [OAK or ACORN]. And for what it may be worth OAK is going to have BLYNK support for PHONE UI.
 
I've been working on WiFi and the Teensy for quite some time. My early prototypes used a Teensy 3 + a CC3000 but that module is just god-awful. I don't recommend anyone use it for anything. It's buggy at a level that firmware updates can't fix, and it's missing too many features needed for a serious design unless you do something like Spark/Particle did with the Core and make a cloud server do the heavy lifting.

My next rev used a Raspberry Pi A+ to do the TCP/IP-ish stuff and a Teensy 3.1 to do the real-time stuff, with communication between the two via hardware UART (yes USB would be better but the RPi A only has one USB port and I needed it for the WiFi dongle). The upsides are:
1. It makes things like running a web server and maintaining large amounts of configuration data trivial
2. The application code can be C, PHP, Perl, Python, Java, shell scripts, etc.
3. The RPi CPU is very fast, and has hardware floating point.
The downsides are:
1. It takes a long time to boot (about 15 seconds)
2. It's a fair amount of work to make the filesystem immune-ish to unexpected power loss corruption
3. Cost (RPi + USB dongle + SD card)

I started my latest revision about a month ago. It uses the Teensy 3.1 to do the real-time stuff and a Particle Photon to handle the TCP/IP, like the last version they speak via UART. I've run into zero issues at 1,000,000 baud, which is fast enough for everything I need them to do. The Photon side works pretty well but their IDE takes some getting used to, I frequently run into strange cloud issues, and it's more work porting Arduino code over than I anticipated. If everything works out I will do a custom circuit board with the MKL26Z64 MCU from the Teensy LC and the Particle P1 module; back-of-the-envelope math says I can hit a reasonable price target with that.

I haven't looked at the ESP8266 because I need >64K RAM but I have bought a couple modules to experiment with when I have the time.
 
I am too in the market for a Xively-like iOT connection. I've been looking at the various Wifi and wired connections and settled on the Wiznet 820 for a ethernet connection. On the Wifi side, things are much less certain.

I like the Wizfi 250 EVB because it has a published Xively client and is made by a OEM - i.e. footprints and pin assignments are unlikely to change for the foreseeable future (unlike the Adafruit gear).

On the other hand, the ESP8266-based solutions seem to have a lot more mindshare in the maker community. However, no one as yet seems to have cracked all the issues associated with making it work well with a library. I'm also not convinced that the PCBs that some folk have developed as carriers for the chip (or FCC certified modules) may not detract from it's performance.

Speaking of the Photon, their P1 module looks strikingly like the Wizfi 250. All component placements are the same, the antenna looks identical, etc. Custom firmware? So if the Photon is stable and woks, that may be the solution of me. I am curious how you implemented RTS and CTS, however, as the data sheet for the Photon does not call out dedicated RTS/CTS pins like the Wizfi module does.

Along similar lines, I wonder if anyone hare has an opinion on GSM-based modules. Particle is publishing a 2G and 3G module later this year. Sparqee put out a 3G module last year, etc. Yet no one seems to have cracked the business-critical issue of carrier certification (specifically PTCRB certification).

For example, Sparqee recently confirmed that their module is FCC certified and that the underlying chip (a ZTE) is ATT approved. The forum admin over at Sparqee stated that while the Cell is certified on its own, once the module is installed into a device, the whole enchilada has to be certified again. Makes you wonder why to bother certifying the module?

The folk at Adafruit are also hard at work developing a 3G module (based on the SIMCOM 5320 series), which ironically I chose independently also (my previous attempts were with a SIMCOM900). However, our layout philosophies seem to diverge significantly. I wonder how well the Adafruit module can work in real life when they ignore so many of the hardware manual suggestions that SIMCOM puts out (i.e. re: decoupling caps, trace locations, and so on.). Time will tell.
 
Last edited:
Speaking of the Photon, their P1 module looks strikingly like the Wizfi 250. All component placements are the same, the antenna looks identical, etc. Custom firmware? So if the Photon is stable and woks, that may be the solution of me. I am curious how you implemented RTS and CTS, however, as the data sheet for the Photon does not call out dedicated RTS/CTS pins like the Wizfi module does.
.
Particle.io's Photon board uses a Broadcom WiFi module. I have one... a few quick compiles/runs, seems OK but haven't done heavy lifting. On-line builder and WiFi re-flash. A new/different experience that C/C++ with Arduino.

WizNet - good but English docs are unclear. I've used a lot of their older 812MJ ethernet module. Don't know who's WiFi they used in latest board.
 
Last edited:
he was pulling my leg, that's why I did not dignify it with a response. not worth it. :)

My forum subtlety detector worse than the one I have for in person it seems :) And it could be a real problem losing UART data - or having the ESP# lockup - could render it a tiny doorstop.

I asked OAK/ACORN creator about RTS & CTS pins on his ESP8266 and said there aren't dedicated pins there either - but doughboy found them and working on his software. Hopefully there is a similar setup in the supported "Particle Cloud: https://www.particle.io/" - hardware is noted now as a customized ESP8266-12 with all pins that supplies - but still 64KB RAM 'as they ship it'.

At this point I committed to this thing with money and time waiting for shipment - I hope it works. DEMO was working months back with prototype when KStart was 1st day Goal/Funded in April/May - including output to the ILI9341
 
No - Not to speak for doughboy - look here for topic on another thread and without hardware control the UART passage of large and FAST data (4,000,000 baud) data streams - or even less caused the ESP8266 to hang IIRC.

That's not the whole truth :)
I fact, you need a handshake when you're not able to process the incomming data fast enough and don't want to loose any data.
This has to do only indirectly with the speed of the interface.
It may be, that you need this hardware control with only 1200 bit/s or less.
The same is true for the opposite direction.
 
I have been developing such a library for my project. (works only with teensy 3x).
The library works for the most part, but not all functions are thoroughly tested yet.
I tested the library on some ethernet library examples to work.

Hey doughboy... your library sounds awesome. I hope you can share it!

Which hardware implementation are you using and which are the RTS/CTS pins on it? For example, the AI Thinker implementation for sale on Adafruit seems to have GPIO13 and 15 broken out, which, according to the Expressif manual for the ESP8266, are the RTS/CTS pins. Implementing RTS/CTS on a ESP8266 then requires modification of the (MTDO,MTCK) registers, which presumably requires a programming manual for the ESP8266.
 
Last edited:
Thanks for all the replies. Imo the Oak looks like the most promising product: cheap, Arduino compatible and feature rich. I just hope the 'Arduino compatibility' will live up to the expectation. I would expect it to be programmable through the Arduino IDE with as-full-as-possible library support, combined with their own Arduino library for the Wifi connectivity. Call me spoiled by Paul's work, but i hardly consider stuff like the Photon 'Arduino compatible'.
 
Status
Not open for further replies.
Back
Top