1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

Project Design step for Internet of Things

Discussion in 'IoT - Internet of Things' started by Parth86, Sep 30, 2017.

  1. Little Ghostman

    Little Ghostman Well-Known Member Most Helpful Member

    Joined:
    Jan 7, 2011
    Messages:
    3,737
    Likes:
    433
    Location:
    SCOTLAND
    Or just go with a raspberry pi, you got all options then.
     
  2. Parth86

    Parth86 Member

    Joined:
    Dec 25, 2011
    Messages:
    538
    Likes:
    5
    I have not bought Wemos Mini D1 yet. Cost of module is too high. I can't effort right now. I have to wait for one or two months . I want to write some code till then. Is it possible ?

    I have installed Arduino IDE in my PC. Now I have this program. I am totally new for this IDE. Please guide me. how to start with simple example. once I get idea I can go for further steps. Led is my favorite component to test. first I want to test with LED.

    Problem statement : write a program that will control LED

    Code (c):

    /*
      ===========================================
           Copyright (c) 2017 Stefan Kremser
                  github.com/spacehuhn
      ===========================================
    */


    // Including some libraries we need //
    #include <Arduino.h>

    #include <ESP8266WiFi.h>
    #include <ESP8266WebServer.h>
    #include <FS.h>


    // Settings //

    //#define USE_DISPLAY /* <-- uncomment that if you want to use the display */
    #define resetPin 4 /* <-- comment out or change if you need GPIO 4 for other purposes */
    #define USE_LED16 /* <-- for the Pocket ESP8266 which has a LED on GPIO 16 to indicate if it's running */


    // Including everything for the OLED //
    #ifdef USE_DISPLAY
      #include <Wire.h>
     
      //include the library you need
      #include "SSD1306.h"
      #include "SH1106.h"

      //create display(Adr, SDA-pin, SCL-pin)
      SSD1306 display(0x3c, 5, 4); //GPIO 5 = D1, GPIO 4 = D2
      //SH1106 display(0x3c, 5, 4);
     
      //button pins
      #define upBtn 12 //GPIO 12 = D6
      #define downBtn 13 //GPIO 13 = D7
      #define selectBtn 14 //GPIO 14 = D5
      #define displayBtn 0 //GPIO 0 = FLASH BUTTON
     
      //render settings
      #define fontSize 8
      #define rowsPerSite 8
     
      int rows = 4;
      int curRow = 0;
      int sites = 1;
      int curSite = 1;
      int lrow = 0;

      int menu = 0; //0 = Main Menu, 1 = APs, 2 = Stations, 3 = Attacks, 4 = Monitor

      bool canBtnPress = true;
      int buttonPressed = 0; //0 = UP, 1 = DOWN, 2 = SELECT, 3 = DISPLAY
      bool displayOn = true;
    #endif

    // More Includes! //
    extern "C" {
      #include "user_interface.h"
    }

    ESP8266WebServer server(80);

    #include <EEPROM.h>
    #include "data.h"
    #include "NameList.h"
    #include "APScan.h"
    #include "ClientScan.h"
    #include "Attack.h"
    #include "Settings.h"
    #include "SSIDList.h"

    /* ========== DEBUG ========== */
    const bool debug = true;
    /* ========== DEBUG ========== */

    // Run-Time Variables //
    String wifiMode = "";
    String attackMode_deauth = "";
    String attackMode_beacon = "";
    String scanMode = "SCAN";

    bool warning = true;

    NameList nameList;

    APScan apScan;
    ClientScan clientScan;
    Attack attack;
    Settings settings;
    SSIDList ssidList;

    void sniffer(uint8_t *buf, uint16_t len) {
      clientScan.packetSniffer(buf, len);
    }

    #ifdef USE_DISPLAY
    void drawInterface() {
      if(displayOn){
     
        display.clear();

        int _lrow = 0;
        for (int i = curSite * rowsPerSite - rowsPerSite; i < curSite * rowsPerSite; i++) {
          if (i == 0) display.drawString(3, i * fontSize, "-> WiFi " + wifiMode);
          else if (i == 1) display.drawString(3, i * fontSize, "-> " + scanMode);
          else if (i == 2) display.drawString(3, i * fontSize, "-> " + attackMode_deauth + " deauth");
          else if (i == 3) display.drawString(3, i * fontSize, "-> " + attackMode_beacon + " beacon flood");
          else if (i - 4 < apScan.results) {
            display.drawString(4, _lrow * fontSize, apScan.getAPName(i - 4));
            if (apScan.isSelected(i - 4)) {
              display.drawVerticalLine(1, _lrow * fontSize, fontSize);
              display.drawVerticalLine(2, _lrow * fontSize, fontSize);
            }
          }
          if (_lrow == lrow) display.drawVerticalLine(0, _lrow * fontSize, fontSize);
          _lrow++;
        }
     
        display.display();
      }
    }
    #endif

    void startWifi() {
      Serial.println("\nStarting WiFi AP:");
      WiFi.mode(WIFI_STA);
      wifi_set_promiscuous_rx_cb(sniffer);
      WiFi.softAP((const char*)settings.ssid.c_str(), (const char*)settings.password.c_str(), settings.apChannel, settings.ssidHidden); //for an open network without a password change to:  WiFi.softAP(ssid);
      Serial.println("SSID     : '" + settings.ssid+"'");
      Serial.println("Password : '" + settings.password+"'");
      Serial.println("-----------------------------------------------");
      if (settings.password.length() < 8) Serial.println("WARNING: password must have at least 8 characters!");
      if (settings.ssid.length() < 1 || settings.ssid.length() > 32) Serial.println("WARNING: SSID length must be between 1 and 32 characters!");
      wifiMode = "ON";
    }

    void stopWifi() {
      Serial.println("stopping WiFi AP");
      Serial.println("-----------------------------------------------");
      WiFi.disconnect();
      wifi_set_opmode(STATION_MODE);
      wifiMode = "OFF";
    }

    void loadIndexHTML() {
      if(warning){
        sendFile(200, "text/html", data_indexHTML, sizeof(data_indexHTML));
      }else{
        sendFile(200, "text/html", data_apscanHTML, sizeof(data_apscanHTML));
      }
    }
    void loadAPScanHTML() {
      warning = false;
      sendFile(200, "text/html", data_apscanHTML, sizeof(data_apscanHTML));
    }
    void loadStationsHTML() {
      sendFile(200, "text/html", data_stationsHTML, sizeof(data_stationsHTML));
    }
    void loadAttackHTML() {
      sendFile(200, "text/html", data_attackHTML, sizeof(data_attackHTML));
    }
    void loadSettingsHTML() {
      sendFile(200, "text/html", data_settingsHTML, sizeof(data_settingsHTML));
    }
    void load404() {
      sendFile(200, "text/html", data_errorHTML, sizeof(data_errorHTML));
    }
    void loadInfoHTML(){
      sendFile(200, "text/html", data_infoHTML, sizeof(data_infoHTML));
    }
    void loadLicense(){
      sendFile(200, "text/plain", data_license, sizeof(data_license));
    }

    void loadFunctionsJS() {
      sendFile(200, "text/javascript", data_js_functionsJS, sizeof(data_js_functionsJS));
    }
    void loadAPScanJS() {
      sendFile(200, "text/javascript", data_js_apscanJS, sizeof(data_js_apscanJS));
    }
    void loadStationsJS() {
      sendFile(200, "text/javascript", data_js_stationsJS, sizeof(data_js_stationsJS));
    }
    void loadAttackJS() {
      attack.ssidChange = true;
      sendFile(200, "text/javascript", data_js_attackJS, sizeof(data_js_attackJS));
    }
    void loadSettingsJS() {
      sendFile(200, "text/javascript", data_js_settingsJS, sizeof(data_js_settingsJS));
    }

    void loadStyle() {
      sendFile(200, "text/css;charset=UTF-8", data_styleCSS, sizeof(data_styleCSS));
    }


    void startWiFi(bool start) {
      if (start) startWifi();
      else stopWifi();
      clientScan.clearList();
    }

    //==========AP-Scan==========
    void startAPScan() {
      scanMode = "scanning...";
    #ifdef USE_DISPLAY
      drawInterface();
    #endif
      if (apScan.start()) {

    #ifdef USE_DISPLAY
        apScan.sort();
        rows = 4;
        rows += apScan.results;
        sites = rows / rowsPerSite;
        if (rows % rowsPerSite > 0) sites++;
    #endif

        server.send ( 200, "text/json", "true");
        attack.stopAll();
        scanMode = "SCAN";
      }
    }

    void sendAPResults() {
      apScan.sendResults();
    }

    void selectAP() {
      if (server.hasArg("num")) {
        apScan.select(server.arg("num").toInt());
        server.send( 200, "text/json", "true");
        attack.stopAll();
      }
    }

    //==========Client-Scan==========
    void startClientScan() {
      if (server.hasArg("time") && apScan.getFirstTarget() > -1 && !clientScan.sniffing) {
        server.send(200, "text/json", "true");
        clientScan.start(server.arg("time").toInt());
        attack.stopAll();
      } else server.send( 200, "text/json", "Error: no selected access point");
    }

    void sendClientResults() {
      clientScan.send();
    }
    void sendClientScanTime() {
      server.send( 200, "text/json", (String)settings.clientScanTime );
    }

    void selectClient() {
      if (server.hasArg("num")) {
        clientScan.select(server.arg("num").toInt());
        attack.stop(0);
        server.send( 200, "text/json", "true");
      }
    }

    void addClientFromList(){
      if(server.hasArg("num")) {
        int _num = server.arg("num").toInt();
        clientScan.add(nameList.getMac(_num));
     
        server.send( 200, "text/json", "true");
      }else server.send( 200, "text/json", "false");
    }

    void setClientName() {
      if (server.hasArg("id") && server.hasArg("name")) {
        if(server.arg("name").length()>0){
          nameList.add(clientScan.getClientMac(server.arg("id").toInt()), server.arg("name"));
          server.send( 200, "text/json", "true");
        }
        else server.send( 200, "text/json", "false");
      }
    }

    void deleteName() {
      if (server.hasArg("num")) {
        int _num = server.arg("num").toInt();
        nameList.remove(_num);
        server.send( 200, "text/json", "true");
      }else server.send( 200, "text/json", "false");
    }

    void clearNameList() {
      nameList.clear();
      server.send( 200, "text/json", "true" );
    }

    void editClientName() {
      if (server.hasArg("id") && server.hasArg("name")) {
        nameList.edit(server.arg("id").toInt(), server.arg("name"));
        server.send( 200, "text/json", "true");
      }else server.send( 200, "text/json", "false");
    }

    void addClient(){
      if(server.hasArg("mac") && server.hasArg("name")){
        String macStr = server.arg("mac");
        macStr.replace(":","");
        Serial.println("add "+macStr+" - "+server.arg("name"));
        if(macStr.length() < 12 || macStr.length() > 12) server.send( 200, "text/json", "false");
        else{
          Mac _newClient;
          for(int i=0;i<6;i++){
            const char* val = macStr.substring(i*2,i*2+2).c_str();
            uint8_t valByte = strtoul(val, NULL, 16);
            Serial.print(valByte,HEX);
            Serial.print(":");
            _newClient.setAt(valByte,i);
          }
          Serial.println();
          nameList.add(_newClient,server.arg("name"));
          server.send( 200, "text/json", "true");
        }
      }
    }

    //==========Attack==========
    void sendAttackInfo() {
      attack.sendResults();
    }

    void startAttack() {
      if (server.hasArg("num")) {
        int _attackNum = server.arg("num").toInt();
        if (apScan.getFirstTarget() > -1 || _attackNum == 1 || _attackNum == 2) {
          attack.start(server.arg("num").toInt());
          server.send ( 200, "text/json", "true");
        } else server.send( 200, "text/json", "false");
      }
    }

    void addSSID() {
      if(server.hasArg("ssid") && server.hasArg("num") && server.hasArg("enc")){
        int num = server.arg("num").toInt();
        if(num > 0){
          ssidList.addClone(server.arg("ssid"),num, server.arg("enc") == "true");
        }else{
          ssidList.add(server.arg("ssid"), server.arg("enc") == "true" || server.arg("enc") == "1");
        }
        attack.ssidChange = true;
        server.send( 200, "text/json", "true");
      }else server.send( 200, "text/json", "false");
    }

    void cloneSelected(){
      if(apScan.selectedSum > 0){
        int clonesPerSSID = 48/apScan.selectedSum;
        ssidList.clear();
        for(int i=0;i<apScan.results;i++){
          if(apScan.isSelected(i)){
            ssidList.addClone(apScan.getAPName(i),clonesPerSSID, apScan.getAPEncryption(i) != "none");
          }
        }
      }
      attack.ssidChange = true;
      server.send( 200, "text/json", "true");
    }

    void deleteSSID() {
      ssidList.remove(server.arg("num").toInt());
      attack.ssidChange = true;
      server.send( 200, "text/json", "true");
    }

    void randomSSID() {
      ssidList._random();
      attack.ssidChange = true;
      server.send( 200, "text/json", "true");
    }

    void clearSSID() {
      ssidList.clear();
      attack.ssidChange = true;
      server.send( 200, "text/json", "true");
    }

    void resetSSID() {
      ssidList.load();
      attack.ssidChange = true;
      server.send( 200, "text/json", "true");
    }

    void saveSSID() {
      ssidList.save();
      server.send( 200, "text/json", "true");
    }

    void restartESP() {
      server.send( 200, "text/json", "true");
      ESP.reset();
    }

    void enableRandom(){
      attack.changeRandom(server.arg("interval").toInt());
      server.send( 200, "text/json", "true");
    }

    //==========Settings==========
    void getSettings() {
      settings.send();
    }

    void saveSettings() {
      if (server.hasArg("ssid")) settings.ssid = server.arg("ssid");
      if (server.hasArg("ssidHidden")) {
        if (server.arg("ssidHidden") == "false") settings.ssidHidden = false;
        else settings.ssidHidden = true;
      }
      if (server.hasArg("password")) settings.password = server.arg("password");
      if (server.hasArg("apChannel")) {
        if (server.arg("apChannel").toInt() >= 1 && server.arg("apChannel").toInt() <= 14) {
          settings.apChannel = server.arg("apChannel").toInt();
        }
      }
      if (server.hasArg("macAp")) {
        String macStr = server.arg("macAp");
        macStr.replace(":","");
        Mac tempMac;
         if(macStr.length() == 12){
           for(int i=0;i<6;i++){
             const char* val = macStr.substring(i*2,i*2+2).c_str();
             uint8_t valByte = strtoul(val, NULL, 16);
             tempMac.setAt(valByte,i);
           }
           if(tempMac.valid()) settings.macAP.set(tempMac);
         } else if(macStr.length() == 0){
           settings.macAP.set(settings.defaultMacAP);
         }
      }
      if (server.hasArg("randMacAp")) {
        if (server.arg("randMacAp") == "false") settings.isMacAPRand = false;
        else settings.isMacAPRand = true;
      }
      if (server.hasArg("scanTime")) settings.clientScanTime = server.arg("scanTime").toInt();
      if (server.hasArg("timeout")) settings.attackTimeout = server.arg("timeout").toInt();
      if (server.hasArg("deauthReason")) settings.deauthReason = server.arg("deauthReason").toInt();
      if (server.hasArg("packetRate")) settings.attackPacketRate = server.arg("packetRate").toInt();
      if (server.hasArg("apScanHidden")) {
        if (server.arg("apScanHidden") == "false") settings.apScanHidden = false;
        else settings.apScanHidden = true;
      }
      if (server.hasArg("beaconInterval")) {
        if (server.arg("beaconInterval") == "false") settings.beaconInterval = false;
        else settings.beaconInterval = true;
      }
      if (server.hasArg("useLed")) {
        if (server.arg("useLed") == "false") settings.useLed = false;
        else settings.useLed = true;
        attack.refreshLed();
      }
      if (server.hasArg("channelHop")) {
        if (server.arg("channelHop") == "false") settings.channelHop = false;
        else settings.channelHop = true;
      }
      if (server.hasArg("multiAPs")) {
        if (server.arg("multiAPs") == "false") settings.multiAPs = false;
        else settings.multiAPs = true;
      }
      if (server.hasArg("multiAttacks")) {
        if (server.arg("multiAttacks") == "false") settings.multiAttacks = false;
        else settings.multiAttacks = true;
      }
     
      if (server.hasArg("ledPin")) settings.setLedPin(server.arg("ledPin").toInt());
      if(server.hasArg("macInterval")) settings.macInterval = server.arg("macInterval").toInt();

      settings.save();
      server.send( 200, "text/json", "true" );
    }

    void resetSettings() {
      settings.reset();
      server.send( 200, "text/json", "true" );
    }

    void setup() {

      randomSeed(os_random());
     
    #ifdef USE_LED16
      pinMode(16, OUTPUT);
      digitalWrite(16, LOW);
    #endif
     
      Serial.begin(115200);
     
      attackMode_deauth = "START";
      attackMode_beacon = "START";

      EEPROM.begin(4096);
      SPIFFS.begin();

      settings.load();
      if (debug) settings.info();
      settings.syncMacInterface();
      nameList.load();
      ssidList.load();

      attack.refreshLed();

      delay(500); // Prevent bssid leak

      startWifi();
      attack.stopAll();
      attack.generate();

      /* ========== Web Server ========== */

      /* HTML */
      server.onNotFound(load404);

      server.on("/", loadIndexHTML);
      server.on("/index.html", loadIndexHTML);
      server.on("/apscan.html", loadAPScanHTML);
      server.on("/stations.html", loadStationsHTML);
      server.on("/attack.html", loadAttackHTML);
      server.on("/settings.html", loadSettingsHTML);
      server.on("/info.html", loadInfoHTML);
      server.on("/license", loadLicense);

      /* JS */
      server.on("/js/apscan.js", loadAPScanJS);
      server.on("/js/stations.js", loadStationsJS);
      server.on("/js/attack.js", loadAttackJS);
      server.on("/js/settings.js", loadSettingsJS);
      server.on("/js/functions.js", loadFunctionsJS);

      /* CSS */
      server.on ("/style.css", loadStyle);

      /* JSON */
      server.on("/APScanResults.json", sendAPResults);
      server.on("/APScan.json", startAPScan);
      server.on("/APSelect.json", selectAP);
      server.on("/ClientScan.json", startClientScan);
      server.on("/ClientScanResults.json", sendClientResults);
      server.on("/ClientScanTime.json", sendClientScanTime);
      server.on("/clientSelect.json", selectClient);
      server.on("/setName.json", setClientName);
      server.on("/addClientFromList.json", addClientFromList);
      server.on("/attackInfo.json", sendAttackInfo);
      server.on("/attackStart.json", startAttack);
      server.on("/settings.json", getSettings);
      server.on("/settingsSave.json", saveSettings);
      server.on("/settingsReset.json", resetSettings);
      server.on("/deleteName.json", deleteName);
      server.on("/clearNameList.json", clearNameList);
      server.on("/editNameList.json", editClientName);
      server.on("/addSSID.json", addSSID);
      server.on("/cloneSelected.json", cloneSelected);
      server.on("/deleteSSID.json", deleteSSID);
      server.on("/randomSSID.json", randomSSID);
      server.on("/clearSSID.json", clearSSID);
      server.on("/resetSSID.json", resetSSID);
      server.on("/saveSSID.json", saveSSID);
      server.on("/restartESP.json", restartESP);
      server.on("/addClient.json",addClient);
      server.on("/enableRandom.json",enableRandom);

      server.begin();

    #ifdef USE_DISPLAY
      display.init();
      display.flipScreenVertically();
      pinMode(upBtn, INPUT_PULLUP);
      pinMode(downBtn, INPUT_PULLUP);
      pinMode(selectBtn, INPUT_PULLUP);
      if(displayBtn == 0) pinMode(displayBtn, INPUT);
      else pinMode(displayBtn, INPUT_PULLUP);

      display.clear();
      display.setFont(ArialMT_Plain_16);
      display.drawString(0, 0, "ESP8266");
      display.setFont(ArialMT_Plain_24);
      display.drawString(0, 16, "Deauther");
      display.setFont(ArialMT_Plain_10);
      display.drawString(100, 28, "v");
      display.setFont(ArialMT_Plain_16);
      display.drawString(104, 24, "1.6");
      display.setFont(ArialMT_Plain_10);
      display.drawString(0, 40, "Copyright (c) 2017");
      display.drawString(0, 50, "Stefan Kremser");
      display.display();

      display.setFont(Roboto_Mono_8);
     
      delay(1600);
    #endif

    #ifdef resetPin
      pinMode(resetPin, INPUT_PULLUP);
      if(digitalRead(resetPin) == LOW) settings.reset();
    #endif

      if(debug){
        Serial.println("\nStarting...\n");
    #ifndef USE_DISPLAY
        delay(1600);
    #endif
      }
    }

    void loop() {
      if (clientScan.sniffing) {
        if (clientScan.stop()) startWifi();
      } else {
        server.handleClient();
        attack.run();
      }

      if(Serial.available()){
        String input = Serial.readString();
        if(input == "reset" || input == "reset\n" || input == "reset\r" || input == "reset\r\n"){
          settings.reset();
        }
      }

    #ifdef USE_DISPLAY

      if (digitalRead(upBtn) == LOW || digitalRead(downBtn) == LOW || digitalRead(selectBtn) == LOW || digitalRead(displayBtn) == LOW){
        if(canBtnPress){
          if(digitalRead(upBtn) == LOW) buttonPressed = 0;
          else if(digitalRead(downBtn) == LOW) buttonPressed = 1;
          else if(digitalRead(selectBtn) == LOW) buttonPressed = 2;
          else if(digitalRead(displayBtn) == LOW) buttonPressed = 3;
          canBtnPress = false;
        }
      }else if(!canBtnPress){
        canBtnPress = true;
     
        // ===== UP =====
        if (buttonPressed == 0 && curRow > 0) {
          curRow--;
          if (lrow - 1 < 0) {
            lrow = rowsPerSite - 1;
            curSite--;
          } else lrow--;
     
        // ===== DOWN =====
        } else if (buttonPressed == 1 && curRow < rows - 1) {
          curRow++;
          if (lrow + 1 >= rowsPerSite) {
            lrow = 0;
            curSite++;
          } else lrow++;
       
        // ===== SELECT =====
        } else if (buttonPressed == 2) {
       
          // ===== WIFI on/off =====
          if (curRow == 0) {
            if (wifiMode == "ON") stopWifi();
            else startWifi();
       
          // ===== scan for APs =====
          } else if (curRow == 1) {
            startAPScan();
            drawInterface();
     
          // ===== start,stop deauth attack =====
          } else if (curRow == 2) {
            if (attackMode_deauth == "START" && apScan.getFirstTarget() > -1) attack.start(0);
            else if (attackMode_deauth == "STOP") attack.stop(0);

          // ===== start,stop beacon attack =====
          } else if (curRow == 3) {
            if (attackMode_beacon == "START"){

              //clone all selected SSIDs
              if(apScan.selectedSum > 0){
                int clonesPerSSID = 48/apScan.selectedSum;
                ssidList.clear();
                for(int i=0;i<apScan.results;i++){
                  if(apScan.isSelected(i)){
                    ssidList.addClone(apScan.getAPName(i),clonesPerSSID, apScan.getAPEncryption(i) != "none");
                  }
                }
              }
              attack.ssidChange = true;

              //start attack
              attack.start(1);
            }
            else if (attackMode_beacon == "STOP") attack.stop(1);
          }
       
          // ===== select APs =====
          else if (curRow >= 4) {
            attack.stop(0);
            apScan.select(curRow - 4);
          }
        }
        // ===== DISPLAY =====
        else if (buttonPressed == 3) {
          displayOn = !displayOn;
          display.clear();
          display.display();
        }
      }
      drawInterface();
    #endif

    }
     
     
    Last edited: Oct 28, 2017
  3. Little Ghostman

    Little Ghostman Well-Known Member Most Helpful Member

    Joined:
    Jan 7, 2011
    Messages:
    3,737
    Likes:
    433
    Location:
    SCOTLAND
    Do a google, there is a incredible amount of information on the arduino. Its often easier to follow along with a tutorial or watch a couple of videos, rather than try and follow verbal instruction alone. Incidentally, its fairly common to use an arduino in conjuration with the R Pi, this gives you the best of all worlds so to speak. There are a couple of books on the subject as well.

    For IOT, its hard to beat a R Pi for the actual web interface side of things, the Arduino is then mainly used for the sensors or whatever, this reports back to the Pi where it does the web side. The newer Pi 3 is alot more reliable and can now 'BOOT' directly from a external USB hard drive, this was the main downside of the other Pi versions.
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. ronsimpson

    ronsimpson Well-Known Member Most Helpful Member

    Joined:
    Apr 17, 2007
    Messages:
    7,304
    Likes:
    969
    Location:
    Loveland, CO USA

    If you are looking at Pi; the Raspberry Pi 0w is a good option.
    Pi 0 plugs into the wired internet. Or you can add a USB to wireless thing.
    Pi 0w has built in wireless and bluetooth.

    ESP-8266EX is smaller.
     
    • Like Like x 1
  6. Parth86

    Parth86 Member

    Joined:
    Dec 25, 2011
    Messages:
    538
    Likes:
    5
    I am thinking about Raspberry Pi
    which board choose for IOT. here is many board https://www.google.co.in/search?cli.......0...1.1.64.psy-ab..0.0.0....0.Cl-QUrnLjFw

    Which one should I buy to build iot project ?
     
  7. ronsimpson

    ronsimpson Well-Known Member Most Helpful Member

    Joined:
    Apr 17, 2007
    Messages:
    7,304
    Likes:
    969
    Location:
    Loveland, CO USA
    If Pi;

    I have Pi3 and it is quad core and fast. I am using it like a PC. Searching internet and office and writing programs.
    I would not use Pi2 or Pi1 because they are older.
    Pi0 is single core (I think) and slower. So you can not watch video and face book on it. But it has USB, and internet connections etc. Some people are using it with a camera to make a network camera. That eats up all the CPU time.
    The Pi0W is much like a (ESP8266 with ARM computer) but the Pi0 has USB and ST-card and Video out. So you can develop on it.
     
    • Like Like x 1
    • Informative Informative x 1
  8. ronsimpson

    ronsimpson Well-Known Member Most Helpful Member

    Joined:
    Apr 17, 2007
    Messages:
    7,304
    Likes:
    969
    Location:
    Loveland, CO USA
    If Pi;

    I have Pi3 and it is quad core and fast. I am using it like a PC. Searching internet and office and writing programs.
    I would not use Pi2 or Pi1 because they are older.
    Pi0 is single core (I think) and slower. So you can not watch video and face book on it. But it has USB, and internet connections etc. Some people are using it with a camera to make a network camera. That eats up all the CPU time.
    The Pi0W is much like a (ESP8266 with ARM computer) but the Pi0 has USB and SD-card (used like a hard drive) and Video out. So you can develop on it.
    Is there an advantage to plugging in a keyboard and monitor? ? ?
     
  9. Parth86

    Parth86 Member

    Joined:
    Dec 25, 2011
    Messages:
    538
    Likes:
    5
    I will purchase Raspberry Pi 3 but which one should I buy because there are many model available on site with different price

    I don't have separate keyboard and monitor.
     
  10. Little Ghostman

    Little Ghostman Well-Known Member Most Helpful Member

    Joined:
    Jan 7, 2011
    Messages:
    3,737
    Likes:
    433
    Location:
    SCOTLAND
    Not sure of the zero, dont bother with a case, post a link to your options here. the one you want takes a external HDD as the main drive, this gets around the worst feature of the Rpi. The older versions all killed there boot sd card sooner or later, you could move files to a usb stick, but you had to boot from the card. The new pi3 gets around this by allowing you to boot from a external HDD. I would get a tiny solid state HDD for it, you got a complete IOT system in the PI3, as a bonus though you can add a Arduino to it and talk over SPI, that way you get the best of all worlds.

    Forgot to add, dont be stupid with the PI, change all default passwords to hard ones, learn how to secure it so it takes connections from just your MAC addresses (not IP's), read up on Linux versions for the Pi and make it secure as you can.

    The great thing with the pi is the fact you can use python, with that you can build a really complex system easily. Will save you money in the long run.
     
    • Like Like x 1
  11. Parth86

    Parth86 Member

    Joined:
    Dec 25, 2011
    Messages:
    538
    Likes:
    5
  12. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,291
    Likes:
    647
    Location:
    Derbyshire, UK
    I'm a little bemused?, you claimed not to able to afford a Wemos D1 Mini (489.00), yet are now considering the far more expensive Raspberry PI (2914.00) - which is FAR less suitable for IoT use.

    The ESP8266 (used in the D1 Mini) is specifically intended for IoT, and is pretty well the device that started the entire thing.
     
    • Like Like x 1
  13. Parth86

    Parth86 Member

    Joined:
    Dec 25, 2011
    Messages:
    538
    Likes:
    5
    You are right. I was about to buy D1 Mini and you may have noticed that i posted code which is written with Arduino IDE. I had installed Arduino IDE and I was looking some program. some of my friends suggested to me that I should buy Raspberry PI instead of D1 Mini. its bit expensive but it may be benefit for future work

    They said if I want to get job in embedded domain then I should know about Raspberry PI. this is advanced technology. with Raspberry PI I can make many projects. I conveyed my father. he gave me two option. He said he would pay for classes or pay for Raspberry PI kit.

    Now I have to Decide what I have to do. I told them I can learn from home with the help of internet I will not join any classes. If I were to join classes I could learn only it for some time. lab has limited time to work . I could not practice as much as i have board at home

    I think If I learn to run one program on board later I can make many projects.
     
    Last edited: Oct 30, 2017
  14. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,291
    Likes:
    647
    Location:
    Derbyshire, UK
    It really depends what you want to do, if you want to make IoT projects then the Wemos Mini is a far better option than the PI.

    The PI is basically a small PC, and can do considerably more than a Wemos Mini - but for IoT the PI is greatly inferior.

    As far as PI's go, I've got a number of them (either 3 or 4), and I can't say I've ever had much luck with any of them :D
     
  15. ronsimpson

    ronsimpson Well-Known Member Most Helpful Member

    Joined:
    Apr 17, 2007
    Messages:
    7,304
    Likes:
    969
    Location:
    Loveland, CO USA
    This forum only has a small amount about Raspberry Pi. There are places that only talk Pi. I have learned much from youtube videos.
    This week I learned how to back up the Pi on my PC. I made a copy of the Pi's SD-card on the PC and I also made a second SD card if things go wrong.
    Now I will work on making the Pi a web server. I like the new videos. If the video is old there are too many things that have changed.

    I got the Pi + power supply + SD card with the operating system on it. (SD card loaded saved me many hours) + USB wireless thing.
    At first I found used USB keyboard and USB mouse and HDMI monitor or TV.
    Now I have wireless mouse + keyboard.
    If you can plug into the router then you do not need a USB wireless thing.
    upload_2017-10-30_9-41-56.jpeg
    SD card with operating system installed.
    upload_2017-10-30_9-44-25.jpeg
    full kit:
    upload_2017-10-30_9-43-6.jpeg
     
    • Like Like x 1
  16. Parth86

    Parth86 Member

    Joined:
    Dec 25, 2011
    Messages:
    538
    Likes:
    5
  17. ronsimpson

    ronsimpson Well-Known Member Most Helpful Member

    Joined:
    Apr 17, 2007
    Messages:
    7,304
    Likes:
    969
    Location:
    Loveland, CO USA
  18. Little Ghostman

    Little Ghostman Well-Known Member Most Helpful Member

    Joined:
    Jan 7, 2011
    Messages:
    3,737
    Likes:
    433
    Location:
    SCOTLAND
    I got caught up with other stuff this week sorry.

    I dont know much about the device nigel linked too, i will look into it. I have a number of dedicated IOT boards and I use it ALOT, everything from home use to full on mesh network wind turbine monitoring. While i would in know why say Nigel is wrong without looking into it, I can say the Rpi 3 is very very capable at IOT. But over the weekend I will clear some misunderstandings. My gut feeling is Nigel is talking application side IOT and your talking system side IOT.

    I dont know of any sub £300 boards that can manage system side IOT, so I am assuming the board he is talking about has to be application side. This leaves the Rpi, while not truly IOT is it is capable of system side and application side. But there are some rules with the PI, it has some failings you need to understand first. But for a beginner it cannot be beaten. Do I use them?

    No not much I dont, I used a dedicated system designed for mesh IOT integration, but I didnt pay for it. had I of been in your position then I would go pi 3. I did use pi2 a few times and it was great within its limits.

    I am snowed under until sat afternoon, I will come back with details for you.
     
    • Like Like x 1
  19. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,291
    Likes:
    647
    Location:
    Derbyshire, UK
    I was talking application side (which presumably this thread is about?), for system side it's easier to use server based systems - you just need PHP and MYSQL - far easier than trying to run your own on a PI, and no concerns about fixed variable addresses. Or just use your own PC, if you really want a home based server.
     
  20. Parth86

    Parth86 Member

    Joined:
    Dec 25, 2011
    Messages:
    538
    Likes:
    5
  21. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,291
    Likes:
    647
    Location:
    Derbyshire, UK
    Any ESP8266 will do, depending on exactly what you'e doing - but some (such as the ESP-01) have more limited pin connections.

    As I suggested at the beginning of this thread, the Wemos D1 Mini is my ESP8266 board of choice, as it's compact, well featured, and has lot's of support specifically out there for it.

    It's also cheaper than the board you posted the link to.

    https://www.amazon.in/D1-mini-V2-In...&qid=1509873728&sr=1-2&keywords=wemos+d1+mini
     

Share This Page