WiFi AP & TCP server?

Status
Not open for further replies.

synfinatic

Active member
I'm hoping someone here might be able to give me a hint on a WiFi solution that I can integrate with a Teensy 3.1. Specifically, I'd like a WiFi module which has the following features:

1. Soft/Limited AP mode (just needs to allow 1 client to connect)
2. DHCP Server
3. Ability to simultaneously listen on multiple TCP ports for connections and multiplex between them

So far #3 seems to be the hard part. The Roving Networks RN-171 does the first two, but only supports listening on a single port. I've also been looking at the WizNet WizFi210/220, but the spec sheet is very vague about this and the code examples in their GitHub repo don't indicate there is any way to tell which TCP port/socket you are receiving data from. I looked at the TI CC3000, but it doesn't support AP mode.

For those of you curious, it's for this project here: https://github.com/synfinatic/teensy-dsc/

Any suggestions? Thanks!
 
What about the esp8266? It has ap mode, as standard, which includes a dhcp and a tcp server, single port granted, but as they have openend the sdk to it, it should be easy enough to add multi port cspability.
 
Lately I've been developing using a Teensy 3.1 with a Raspberry Pi for WiFi (You can get a Pi A+, USB WiFi dongle, and 4 GB microSD card for about $30). I'm powering the Pi via its GPIO header and the Teensy's VUSB/VIN, then I use the UART on each board for communication.

Among the many nice things of this solution are

A) it exists today (unlike the TI CC3100/3200, which was supposed to be shipping in volume in September yet still doesn't even have a release date)

and

B) Linux makes things like a SSL, webserver, DHCP server, WiFi access point, multiple TCP connections on multiple ports, etc. easy vs writing all my own code

I suppose this is similar to the Arduino Yun but the T3.1's ARM is much nicer than the ATMega32U4 (RAM, Flash, quantity and quality of IO pins) and Raspbian is much nicer than OpenWRT (available packages, support).
 
The TP-Link 703N is a small (2.24 x 2.24 x 0.71 in) wireless router. You can load OpenWrt and connect to a Teensy with a USB cable. It costs about $25. It supports multiple clients, DHCP, and listening on multiple ports. You might find it convenient that the TP-Link has a case. You could even fit the Teensy inside the TP-Link case. It would be a tight fit and the TP-Link case is a bit challenging to open cleanly, but the hardware is very well documented. If you did opt to put the Teensy inside, you might wire the Teensy to the TP-Link serial pads leaving Teensy USB connector free for reprogramming.
 
It depends one how much software you want to write.
A combination of an embedded Ethernet module such as the WIZ820io with a WiFi pocket router such as the TP-Link TL-WR702n functions out of the box an you can use the mature Ethernet library and use available code as a resource.
This combination of hard and software will get you going very quickly, but it's more bulky than the other suggestions above.

The standard firmware on the TL-WR703n ( not the 702n) has a Chinese only interface, but uses different hardware internally than the 702n. You can load the OpenWRT onto the 703b but not onto the 702n. My suggestion above assumes the standard firmware, which is why I suggested the 702n. I've also worked with the 703n but using Google to translate the UI is not everyone's cup of tea ;-)
 
Wow, thanks for all the feedback so far everyone. I definitely wouldn't of come up with most of these on my own!

I want to read up on the Blugiga WF121 a bit more since that would be the cleanest I think. I was able to download the BGscript examples and docs and it seems really simple to do what I want. It even supports 4 UART's which is awesome and also an embeded HTTP server. Not bad for $30. :)
 
I want to read up on the Blugiga WF121 a bit more since that would be the cleanest I think. I was able to download the BGscript examples and docs and it seems really simple to do what I want. It even supports 4 UART's which is awesome and also an embeded HTTP server. Not bad for $30. :)

Let us know how it goes! I have one of the modules, but I haven't used it yet. Soon hopefully.
 
Wow, thanks for all the feedback so far everyone. I definitely wouldn't of come up with most of these on my own!

I want to read up on the Blugiga WF121 a bit more since that would be the cleanest I think. I was able to download the BGscript examples and docs and it seems really simple to do what I want. It even supports 4 UART's which is awesome and also an embeded HTTP server. Not bad for $30. :)
I tend to agree with potatotron, that at the $30 price point, using a Rasberry Pi with a USB wifi device to be the web server becomes an attractive option. And you can get updates for things like security issues.
 
1. Soft/Limited AP mode (just needs to allow 1 client to connect)
2. DHCP Server
3. Ability to simultaneously listen on multiple TCP ports for connections and multiplex between them

so the single client mentioned under 1) is opening multiple ports described under 3) eg a TCP2UART bridge with multiple TCP ports?

Just out of curiosity - if you only have a single client connected - why the need to multiple TCP ports?
 
Last edited:
I tend to agree with potatotron, that at the $30 price point, using a Rasberry Pi with a USB wifi device to be the web server becomes an attractive option. And you can get updates for things like security issues.

Unless you have space constraints...
 
Yeah basically it's two TCP2UART's, a third port for a different protocol and ideally a fourth port running a HTTP server. Although I could make the 3rd port intelligent and automatically figure out if the client is speaking HTTP or some other protocol I guess. It just would be cleaner to run it on port 80.
 
As for the RasperryPi idea: It could be done and I'm plenty Linux experienced to make it work... it just makes things more complicated then I'd like for how complex this problem really is. For example, now I have two different configurations to manage- networking on the Pi and various other settings in the EEPROM on the Teensy. If I can keep things embeded that just seems easier on the long term.

Although, maybe then I'd use that RaspeberryPi I have sitting around doing nothing. :)
 
Yeah basically it's two TCP2UART's, a third port for a different protocol and ideally a fourth port running a HTTP server. Although I could make the 3rd port intelligent and automatically figure out if the client is speaking HTTP or some other protocol I guess. It just would be cleaner to run it on port 80.

If you have control over (access to modify) the client, it would appear to make it easier to have a single TCP2UART and then use the content to identify the source and destination.
 
Sadly it's not just one client but a variety of clients speaking a variety of protocols and many of the clients are not open source. :(
 
Status
Not open for further replies.
Back
Top