Category Archives: ESP32

ESP32 Mongoose OS Interface -MQTT

 

Mongoose OS Credentials configure

Two way to configure the MQTT Credentials  in Mongoose OS file. This Example tested with mongoose os , demo-js app, windows 10, 64bit, mos tool, ESP32 DevKitC from ESPressif.

  • First one is using mos tool  UI
    • GO to  127.0.0.1:1992/  –>  Device Config  –> Change the MQTT Credential in MQTT Setting  and Save with Reboot
    • Afterwards its generate the new file name is conf9.json
  • Second methods is change the mqtt Credential in conf0.json  file

 

Required

  • ESP32 Any kind of boards
  • Mongoose OS firmware
  • Mos Tool
  • MQTT Server Credentials
  • WiFi Crendentials

Note : This ESP32 Mongoose OS interface – MQTT is tested with Windows 10 64bit machine, mos tool(Web Browser based IDE for Mongoose OS), ESp32 DevkitC board from ESPressif.

 

Follow

  • Make sure already set your WiFi Credentials (otherwise MQTT is not work, also check the MQTT Connected status in Terminal windows)

 

Code : init.js  file

 

Output

  • Results : {"free_ram":148676,"total_ram":229296}
  • Topic : /device/esp32_0255EC/events

 


 

 

ESP32 – Getting Started


ESP32 Features

  • The ESP32 WiFi and Bluetooth chip is the generation of Espressif products.
  • It has a dual-core 32-bit MCU, which integrates WiFi HT40 and Bluetooth/BLE 4.2 technology inside.
  • It is equipped with a high-performance dual-core Tensilica LX6 MCU.
  • One core handles high speed connection and the other for standalone application development.
  • The dual-core MCU has a 240 MHz frequency and a computing power of 600 DMIPS.
  • In addition, it supports Wi-Fi HT40, Classic Bluetooth/BLE 4.2, and more GPIO resources.
  •  ESP32 chip integrates a wealth of hardware peripherals, including Capacitive touch sensors, Hall sensors, low noise sensor amplifiers, SD card interfaces, Ethernet interfaces,  High-speed SDIO / SPI, UART,  I2S and I2C, etc.

Read more… →

ESP32 Mongoose-OS Interface – WiFi

WiFi Status Monitor

 


Next :

Previous :


 

ESP32 NodeMCU Module – Net

Functions

  • Constants – Constants to be used in other functions: net.
  • net.createConnection()  – Creates a client.
  • net.createServer()  – Creates a server.
  • net.createUDPSocket()  – Creates an UDP socket.
  • net.multicastJoin()  – Join multicast group.
  • net.multicastLeave()  – Leave multicast group.
  • net.server:close()  – Closes the server.
  • net.server:listen()  – Listen on port from IP address.
  • net.server:getaddr()  – Returns server local address/port.
  • net.socket:close()  – Closes socket.
  • net.socket:connect()  – Connect to a remote server.
  • net.socket:dns()  – Provides DNS resolution for a hostname.
  • net.socket:getpeer()  – Retrieve port and ip of remote peer.
  • net.socket:getaddr()  – Retrieve local port and ip of socket.
  • net.socket:hold()  – Throttle data reception by placing a request to block the TCP receive function.
  • net.socket:on()  – Register callback functions for specific events.
  • net.socket:send()  – Sends data to remote peer.
  • net.socket:ttl()  – Changes or retrieves Time-To-Live value on socket.
  • net.socket:unhold()  – Unblock TCP receiving data by revocation of a preceding hold().
  • net.udpsocket:close()  – Closes UDP socket.
  • net.udpsocket:listen()  – Listen on port from IP address.
  • net.udpsocket:on()  – Register callback functions for specific events.
  • net.udpsocket:send()  – Sends data to specific remote peer.
  • net.udpsocket:dns()  – Provides DNS resolution for a hostname.
  • net.udpsocket:getaddr()  – Retrieve local port and ip of socket.
  • net.udpsocket:ttl()  – Changes or retrieves Time-To-Live value on socket.
  • net.dns.getdnsserver()  – Gets the IP address of the DNS server used to resolve hostnames.
  • net.dns.resolve()  – Resolve a hostname to an IP address.
  • net.dns.setdnsserver()  – Sets the IP of the DNS server used to resolve hostnames.

Ex : Create a server Connection

  • Creates a server using function for 30 seconds timeout net.createServer([type[, timeout]])

Ex : Receive function

Ex : Web server function


TCP Server Connection(Client)

  • Connect the WiFi Station
  • Once got IP address then run Server_Run()  Function
  • Create a connection
  • Connect the server
  • Send the Data “ArunEwolrd IOT Project” to Server

 

 


Next :

Previous :


 

if you have any queries call us +918300026060 or WhatsApp Dismiss

0

Your Cart

%d bloggers like this: