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

Thread: WiFi AP & TCP server?

  1. #1

    WiFi AP & TCP server?

    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!

  2. #2
    Senior Member johnnyfp's Avatar
    Join Date
    Jan 2014
    Location
    New Zealand
    Posts
    264
    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.

  3. #3
    Senior Member
    Join Date
    Jun 2013
    Location
    Torrance CA
    Posts
    415
    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).

  4. #4
    Senior Member pictographer's Avatar
    Join Date
    May 2013
    Location
    San Jose, CA
    Posts
    702
    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.

  5. #5
    Senior Member
    Join Date
    Aug 2014
    Posts
    113
    Bluegiga WF121

  6. #6
    Senior Member
    Join Date
    Jan 2013
    Posts
    966
    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 ;-)

  7. #7
    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.

  8. #8
    Senior Member
    Join Date
    Aug 2014
    Posts
    113
    Quote Originally Posted by synfinatic View Post
    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.

  9. #9
    Did you find a good breakout board for it? So far the only two I've been able to find are:

    https://oshpark.com/shared_projects/9vAB5zCG
    and
    http://www.inmojo.com/store/jeff-row...reakout-board/

    The first doesn't breakout a lot of the pins and the second requires the ground pad to be done in a reflow oven which I don't have. Of course the 2nd board isn't in stock and I don't see an ETA so I wonder if it actually is for sale at all anymore?

  10. #10
    Senior Member
    Join Date
    Aug 2014
    Posts
    113
    Those are the only ones I'm aware of. I have the Osh Park one.

  11. #11
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    4,097
    Quote Originally Posted by synfinatic View Post
    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.

  12. #12
    Quote Originally Posted by synfinatic View Post
    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 by CheapB; 11-24-2014 at 06:07 PM.

  13. #13
    Senior Member
    Join Date
    Aug 2014
    Posts
    113
    Quote Originally Posted by MichaelMeissner View Post
    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...

  14. #14
    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.

  15. #15
    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.

  16. #16
    Quote Originally Posted by synfinatic View Post
    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.

  17. #17
    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.

Posting Permissions

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