Need wifi for my teensy.

Status
Not open for further replies.

jassing

Active member
I have a teensy project (3.1) and need to have it "report in" occasionally.
There are a lot of arduino-sheilds; but they are expensive and specific.
Is using a wifi/uart adapter possible? (like this
what's the best way to go? Price is factor...

Not a teensy;but it seems a way to go is something like the spark-core board that has it built in.

any advice/thoughts/suggestions?

Thanks
-josh
 
Well if you need to report into a specific computer when you are in range, consider using bluetooth as well. You can get bluetooth serial devices fairly cheaply. I bought this one, and it can connect to my Android phone: http://www.ebay.com/itm/HC-05-Bluet...650?pt=LH_DefaultDomain_0&hash=item4ad044dc32

I imagine those serial port wifi chips will work, as long as your data conforms to the type of data the support. If it just emulates a Uart, it probably is like a modem or bluetooth, in that it only supports a single stream (TCP) to a single host.
 
Thank you paul! I had missed that in my searches.. I was close to going with the spark.io board; but it looks like it requires an internet connection (I know I know, I want wifi; but then don't want internet connectivity -- but there is a world that is closed to others)
That's a bit more spendy than I wanted; but with a recommendation like that; I don't think I can go wrong with it.

thank you!
-josh
 
If you want something a little cheaper but more capable than the CC3000, you might try a small Wifi router such at the TP-Link 703N (Note, get the 703, not the 702.) It's been reverse engineered down to the schematic. It supports OpenWrt Linux. And with some slightly delicate soldering you can wire its serial port or GPIO to the Teensy.
 
Interesting; I'll have a look; the main problem I've had with the wifi router approach is that it (usually) needs to be pre-configured.
While a one off; the thought of cracking the case, soldering, uploading new firmware; etc is not a big deal; but when it might lead to producing 100 or 1000 of them, it gets a little overwhelming, as each router would need to be pre-tested (to ensure they work before voiding warranties) before soldering them up in a more direct approach..
I will look up on it, so thanks.
 
It didn't occur to me before, but you can plug the Teensy straight into the USB port of the 703N and the Teensy will show up as a serial device, so no soldering needed.
 
well that certainly would be easier; but the quick search i've done between now and the previous post, haven't shown me out to connect to a specific ssid and send a passphrase; which I'd need to do via code...
while I found (I assume a clone) on ebay for $6 which is cheap... I'm hesitant if it will really be 100% compatible with openwrt...
but it's probably worth a try...
good to have options; I've marked the openwrt site to read after dinner...
I have just ordered the adafruit one and after reading up on the openwrt, will probably try it...
thanks
-j
 
@jassing
Do you want to use 802.11's ad hoc mode rather than infrastructure mode? With ad hoc, there is no Access Point (AP). This includes the AP within a "wifi router".
In ad hoc mode, WiFi devices communicate directly, peer to peer. Usually, each device is given a unique static IP address like 192.168.1.x. The applications programs using the ad hoc must know the static IP in that subnet that the peer(s) use. Then a device startst transmitting UDP packets, or tries a TCP connection to a known IP address of an ad hoc mode peer.

Some embedded system WiFi devices do NOT support ad hoc mode. The usual mode is "infrastructure" mode via an AP.

If your data rates are modest, like 80Kbps/sec is OK, then you can use IEEE 802.15.4 radios as they are simpler, cheaper, much lower power consumption - important to battery powered devices, and much better range. The latter is because the occupied channel bandwidth is 2MHz whereas 802.11 is typically 20MHz.

Or there are any number of proprietary short range (500 ft. or so) lower data rate radios available such as the ones used with the RF22 library here.

But it sounds like you have a "given" that one end of the link is 802.11 and cannot change to any of the above.
 
Last edited:
In the future, it might be helpful to list all of the requirements in the initial post, with as much detail as possible. For example, if you had mentioned that it needed to be mobile and that you need to support multiple units, it might have cut down on some of the answers that ultimately don't meet your needs (i.e. an openWRT router is probably not feasible for more than a few units, other technologies like bluetooth, ethernet, etc. aren't an option).

As stevech says whether your stuff requires infrastructure mode or not, may be an issue. Which type of wifi (B, G, N, or other flavors I haven't encountered) you need to connect to, what types of security do you have to deal with (no password, WPA, higher forms of security). And as I said, whether you need streams (TCP), packets (UDP), or one off internet protocols in another issue. Do you need to use SSL or similar at a higher level? Are you familiar with debugging IP stacks at the protocol level, or will you need to learn on the fly when something goes wrong (or hope for the best)?
 
Last edited:
The simplest solution, albeit a bit more bulky is to use a WIZ820io and connect it per Ethernet Cable to said TP-Link router.
One of the problems with the CC3000 and really most other WiFi solutions is that they cannot function as an AP, so you need another router that these can connect to.

Also with the WIZ820io in the game the tremendous advantage is that you can use all the functionality of the Ethernet library out of the box.

Also I personally am using Bonjour /ZeroConf networking in my projects and neither DD-WRT or open-WRT support that out of the box. Memory on these small routers I too small to install Avahi. The factory firmware supports this however :)
And then it is better to use a 702 or 3020 as those come with an English factory firmware. The 703 is only available in Chinese although I've reconfigure it a few times it's a hassle every time ;-)

I am waiting to see if Texas Instrument will come out with a successor to the CC3000 where mDNS actually really works!
 
@jassing
Do you want to use 802.11's ad hoc mode rather than infrastructure mode? With ad hoc, there is no Access Point (AP). This includes the AP within a "wifi router".
[/QUOTE]

Hmm. I guess I don't fully understand adhoc mode, but:

In the future, it might be helpful to list all of the requirements in the initial post, with as much detail as possible. For example, if you had

It's not always known what details are important at the front -- I guess I am of a mindset that WiFi is something specific, ruling out bluetooth; but perhaps I'm too specific and narrow in my thinking coming from a network admin POV, not a radio tech background...

But noted that I should throw more details out and hope they are helpful...

Other details left out: SSID may or may not be broadcast, all configuration must be done via reading an SD card so that it is generic and portable w/o any user interface other than "plugin power". Needs to be 802.11b/g compatible using current standard encryption methods...

Do you need to use SSL or similar at a higher level? Are you familiar with debugging IP stacks at the protocol level, or will you need to learn on the fly when something goes wrong (or hope for the best)?

No SSL needed; it will be reporting in, basically, a number (quad) & a hardware identifier using an http post to a windows server on port 80, ultimately recording to a mysql database.

I can work my way around a packet sniffer and understand what I am looking at. but I have not worked on any hardware level firmware or drivers.
 
I admit I've never tried to scale up a network. Both the middle and the wireless router appear workable to me.

I don't understand why adding wired internet to the teensy, rather than using the USB of the teensy and the router would be simpler.

I also don't understand why using a wireless router running a proven OS with much more RAM and flash and potentially a better antenna would be harder to scale than a relatively new module with software support that appears a bit thin and brittle based on other threads on this site.

The module approach probably requires less power, probably fits in a slightly smaller box, and the total lines of code is orders of magnitude less even though the new lines of code is greater.
 
I also don't understand why using a wireless router running a proven OS with much more RAM and flash and potentially a better antenna would be harder to scale than a relatively new module with software support that appears a bit thin and brittle based on other threads on this site.

The module approach probably requires less power, probably fits in a slightly smaller box, and the total lines of code is orders of magnitude less even though the new lines of code is greater.
If I am reading jassing's replies correctly, the issue isn't the number of lines of code, but instead there are multiple Teensy's that need to report it at various times in the day. Thus if you have 100 devices you need to make, you have to buy and mod 100 routers to make your device. You then need to set up the wiring on each of these to either both be run off the same batteries, or have a single plug that plugs into the wall, which adds to the parts list, and the steps you need to go through to make the final device.

While if you go with some off the shelf module, all you need to do is buy the parts, and solder the device into the Teensy, and whatever power solution you are using with the Teensy will power the device as well. It is a lot simpler in the end run to go with that route. The actual coding may be more complex, but it is only done on one device, and each of the 99 other devices get the code when you download to the device.

To Jassing, if you had mentioned you were an experienced network admin, I probably would have replied somewhat differently. I see a lot of these projects where after doing the initial blinky LED project by tweaking somebody else's code and figuring out which end of the soldering iron to hold, the person doing the project then wants to immediately do the large complex project, and ends up floundering. I was just trying to ground the person that it might be a tad more difficult than they think and all of the different variables that go into adding something to a network and debugging a networking project can be a complex affair. You already know this, but I had no idea what your skill level is.
 
Last edited:
If I am reading jassing's replies correctly, the issue isn't the number of lines of code, but instead there are multiple Teensy's that need to

Right -- this 1st one is a proof of concept; then I will have to make 100 of them. As I look at each; I initially leaned towards using the TP-703N as I could (hope?) stuff the teensy in the box -- thus having an enclosure too. However, the requirement to send the configuration to the box "slowly" doesn't make me feel good; and in the past, have had problems with openwpn (and it's predecessor) being finicky. I purchased both the 703N and the addafruit; but now that I've thought about it (slept on it) I will probably go the breakout board route as it feels less "hacky"

To Jassing, if you had mentioned you were an experienced network admin, I probably would have replied somewhat differently. I see a lot of

Yea; another detail I didn't think to post -- for the past 20 years I've been split between network admin, desktop tech, and software developer roles.... I'm relatively new to Arduino's; but have built a number of projects (both for myself & for others) ; just none of them connected up....

these projects where after doing the initial blinky LED project by tweaking somebody else's code and figuring out which end of the soldering iron

HA! That's funny; I hadn't thought about how one might get an initial jolt of confidence; my 1st language was C; so this is very easy...

Cheers
 
Hi guys,
Would the Adafruit CC3000 be good for my project?
- Teensy 3.1
- Connect to a router
- Connect to internet to check a cgi file
- Teensy does stuff depending on what's in the cgi

Thanks!
 
Yes. Cc3000 works ok with the Teensy. The stock libraries for any server type code needs work. But from what you're describing, this is a client setup, so this should be ok with the stock libraries.
 
I was looking at the Wifi250 compared to the CC3000, They have a Arduino library and supports both UART (AT) style command and SPI. Even comes with a built in Antenna which saves on putting that part togther. So that could be a good alternative. One of the down sides is that it's more expensive. And I can't seem to find it sold at the main stream distributers.
 
Status
Not open for further replies.
Back
Top