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

Thread: Configure WiFi scenario?

  1. #1

    Configure WiFi scenario?

    Hi all I was hoping to do a bit of an iot style project and was wondering what WiFi modules people are using?

    I have a camera at home you use the phone to scan the barcode on it and it sends the WiFi settings to the camera..

    I was hoping to reproduce a similar functionality

  2. #2
    Senior Member
    Join Date
    Dec 2016
    Location
    Montreal, Canada
    Posts
    3,204
    thats P2P, not the same concept as an unsecured wifi

  3. #3
    Senior Member
    Join Date
    Apr 2013
    Posts
    1,915
    Most of the Arduino class wifi modules are pretty simplistic so the assumption is that you need to give them the right settings via a serial command or similar setup (side channel). Many are more capable but the module design locks those out, or at least don't document them.

    To get setup like the one described you need a module that can act as it's own access point and offer some form of configuration interface in that state, so your phone or other device connects to the access point, hands off the data and then both devices return to your main network. There are a bunch of security issues with this method and the app side coding is really hard to do well. They can be engineered around with effort (using barcodes to get hopefully unique passwords is a good idea) but do need a lot of thought.

    In any case the assumption wold be you'd be looking up from Arduino class devices into the bottom end of the Pi segment at things using wifi router chip sets that are designed to host a webpage, accept an SSH and generally behave as a linuxish computer rather than a micro controller. I've worked with the Onion Omega but there are lots of them around at the moment.

    If this is a commercial product would be suggesting looking into the openwrt world on which I believe the IOT items I've met have been based. If this is a hobby/small pro project the side channel method may get you close enough by using blue tooth, light or sound to get wifi details from a phone app into your Arduino-ish device that then sends via AT command to something like an ESP8266 module and gets you your IOT. The problem here is that you will have lots of edge cases where a given phone mangles your chosen channel, ok where this only upsets 1-5 users who you can sort out in person but not good if thats a couple of hundred needing 1 on 1 tech support to get going.

    Whatever solution you choose, for the sake of the rest of us make sure you make it difficult to turn into a botnet.

  4. #4
    Senior Member Epyon's Avatar
    Join Date
    Apr 2013
    Location
    Belgium
    Posts
    443
    The ESP8266 has a mode where it acts like an AP running a webserver. You use this to configure the wifi credentials and after a reboot it joins the configured network as a regular device. Maybe that can be an option?

  5. #5
    Quote Originally Posted by thomen View Post
    Hi all I was hoping to do a bit of an iot style project and was wondering what WiFi modules people are using?

    I have a camera at home you use the phone to scan the barcode on it and it sends the WiFi settings to the camera..

    I was hoping to reproduce a similar functionality
    Quote Originally Posted by Epyon View Post
    The ESP8266 has a mode where it acts like an AP running a webserver. You use this to configure the wifi credentials and after a reboot it joins the configured network as a regular device. Maybe that can be an option?

    Thanks all!
    It's for a uni project as a point of interest I was wondering how it was usually done..

  6. #6
    Would an Adafruit HUZZAH let you connect your teensy to a local WiFi network?

  7. #7
    Senior Member
    Join Date
    Apr 2013
    Posts
    1,915
    in terms of 'how it's done' going off assorted kickstarters I've either backed or watched that would be 'badly'. Do not believe there is anybody who has a 'configure your IOT' ap that does all the back end for you, leaving projects to spin their own IOS/Android/windows aps with all the fun that brings.

    Device side I think we have trended towards using router chips and things like openwrt that support SSH command lines to do the job in access point mode but haven't seen any actual case studies to back that up.

    Huzzah would do the job easily if you scratch the 'configure via generic app' requirement and either hard code or provide some config channel that's good enough for your own purposes. Programing Huzzahs is a bit fussy because of the whole 'press two buttons in order' bootloader dance. Can either be used standalone or bridged to a Teensy via serial or other interface of choice.

    edit: should have said the solution I came up with for my home automation controller was a Pi bridged via serial to a teensy. Not a good choice for anything battery powered but means you can leverage google much more to get it working. Actual Pi side software was node red, so could develop code for both ends of the interface from my desktop PC side by side.
    Last edited by GremlinWrangler; 02-28-2017 at 08:45 AM.

  8. #8
    Senior Member Epyon's Avatar
    Join Date
    Apr 2013
    Location
    Belgium
    Posts
    443
    The Huzzah ESP8266 is just a user-friendly (and tested!) board with the ESP8266. It retains all the functionality of the ESP8266 but is easier to interface with your microcontroller or peripheral of choice. So yes, you can use this board to make it work like an AP at first startup, push your wifi credentials to it through HTTP/BT/UART whatever and then have it reboot to become a normal, secured client on your network.

    You could also check out the Particle Photon. This has somewhat the same routine, except they already built a smartphone app to do the provisioning. The Photon does require you to use the clumsy and unprofessional Particle IDE though.

  9. #9
    Senior Member
    Join Date
    Jun 2013
    Location
    Torrance CA
    Posts
    397
    Quote Originally Posted by Epyon View Post
    You could also check out the Particle Photon. This has somewhat the same routine, except they already built a smartphone app to do the provisioning. The Photon does require you to use the clumsy and unprofessional Particle IDE though.
    One minor correction -- you can bypass their web IDE with their command line utilities. You can edit code in your favorite text editor, save it, then go to the command line and issue something like

    particle flash <device_id> <source_folder>

    which will automagically upload the code to their cloud compiler and reprogram your device.

    I completely agree with you that their web IDE leaves much to be desired.

  10. #10
    Senior Member Epyon's Avatar
    Join Date
    Apr 2013
    Location
    Belgium
    Posts
    443
    Quote Originally Posted by potatotron View Post
    One minor correction -- you can bypass their web IDE with their command line utilities. You can edit code in your favorite text editor, save it, then go to the command line and issue something like

    particle flash <device_id> <source_folder>

    which will automagically upload the code to their cloud compiler and reprogram your device.
    Interesting, didn't know that. But what about libraries and dependencies? Being stuck with the default libraries offered by some platform and not being able to edit anything in them is unacceptable for any professional environment, which is why I dropped Particle and the Photon altogether. If I understand you correctly, you can only write code and then send it to their IDE, not develop code? So you're still stuck with all the limits, but now in an editor of your choosing.

  11. #11
    Senior Member
    Join Date
    Jun 2013
    Location
    Torrance CA
    Posts
    397
    Quote Originally Posted by Epyon View Post
    Interesting, didn't know that. But what about libraries and dependencies? Being stuck with the default libraries offered by some platform and not being able to edit anything in them is unacceptable for any professional environment, which is why I dropped Particle and the Photon altogether. If I understand you correctly, you can only write code and then send it to their IDE, not develop code? So you're still stuck with all the limits, but now in an editor of your choosing.
    It is possible, but it's not great. You can override their libraries or include your own by putting them in sub-folders in your project folders (but of course that means the downside is you have multiple copies of libraries all over your file system).

    You do all work locally, then when you want to flash your device the command line utility zips up the folder + sub folders + all files & sends it to the cloud compiler, and if successfully compiled it will flash your device.

    You can also have the cloud compiler return a binary, or you can flash your device from a binary file instead of a project folder (useful if you want to flash many devices).

    They keep saying they're going to release a standalone IDE that will work via USB / DFU and it's possible to do some things that way now, but no full offline edit / compile / flash chain exists yet.

Posting Permissions

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