NEQTO Docs
  • Languages iconEnglish
    • 日本語
  • Docs
  • API
  • FAQ

›Integration

Getting Started

  • NEQTO Hello World!
  • Tutorial Step 1. NEQTO Console Setting
  • Tutorial Step 2. Device Settings & Launching Service (NEQTO Bridge)
  • Tutorial Step 2. Device Settings & Launching Service (STM32 Discovery)
  • Tutorial Step 2. Device Settings & Launching Service (SPRESENSE)
  • Tutorial Step 3. Application development using scripts

NEQTO

  • NEQTO Account Registration
  • Sub-accounts
  • API Usage
  • NEQTO CloudSync for GCP
  • NEQTO Engine Firmware List
  • Support Guidelines

NEQTO Console

  • Introduction
  • Fundamentals
  • Administrative Actions
  • Device Management
  • Linux-based Device Management
  • Batch Registration
  • Scripts
  • Actions and Contacts
  • View Data from the Console
  • NEQTO Apps

    • About NEQTO Apps
    • NEQTO Infinitypool
    • NEQTO Insights
    • NEQTO Custodia
    • NEQTO Flow
  • Machine Driver
  • Recommended Browsers
  • Billing Information

SPRESENSE

    Hardware Specifications

    • 01. About Spresense

    Software Specifications

    • 01. Operational Flow
    • 02. Initial Installation
    • 03. Spresense Wi-Fi Initial Setup
    • 04. Spresense LTE-M Initial Setup
    • 05. Debug Log Acquisition
    • 06. System LED Indications
    • 07. Event Messages
    • 08. Updating Firmware

    neqto.js

    • 01. About neqto.js
    • 02. Log
    • 03. Timers
    • 04. HTTP
    • 05. HTTPS
    • 06. MQTT
    • 07. Secure
    • 08. Storage
    • 09. Sleep
    • 10. RTC
    • 11. GPIO
    • 12. UART
    • 13. SPI
    • 14. I2C
    • 15. ADC
    • 16. GNSS
    • 17. Camera
    • 18. Utils
    • 19. nqSpresense
    • 20. nqService
    • 21. nqMqtt
    • 22. nqFOTA
    • 23. nqWiFi
    • 24. nqLte

STM32 Discovery

    Hardware Specifications

    • 01. About STM32 Discovery Kit (B-L4S5I-IOT01A)

    Software Specifications

    • 01. Operational Flow
    • 02. Initial Installation
    • 03. STM32 Discovery Wi-Fi Initial Setup
    • 04. Debug Log Acquisition
    • 05. System LED Indications
    • 06. Event Messages
    • 07. Updating Firmware

    neqto.js

    • 01. About neqto.js
    • 02. Log
    • 03. Timers
    • 04. HTTP
    • 05. HTTPS
    • 06. MQTT
    • 07. Secure
    • 08. Storage
    • 09. Sleep
    • 10. RTC
    • 11. UserSW
    • 12. GPIO
    • 13. UART
    • 14. SPI
    • 15. I2C
    • 16. ADC
    • 18. Utils
    • 19. nqDiscovery
    • 20. nqService
    • 21. nqMqtt
    • 22. nqFOTA
    • 23. nqWiFi

NEQTO Bridge

    Hardware Specifications

    • 01. NEQTO Bridge Module
    • 02. NEQTO Bridge Wi-Fi Module
    • 03. NEQTO Bridge LTE-1 Module
    • 04. NEQTO Bridge LTE-M/NB Module
    • 05. NEQTO Bridge IO Board
    • 06. NEQTO Bridge Digital IO Board
    • 07. NEQTO Bridge Connector Board

    Software Specifications

    • 01. Operational Flow
    • 02. NEQTO Bridge Wi-Fi Module Initial Setup
    • 03. NEQTO Bridge LTE Module Initial Setup
    • 04. Debug Log Acquisition
    • 05. System LED Indications
    • 06. Event Messages
    • 07. Updating Firmware

    neqto.js

    • 01. About neqto.js
    • 02. Log
    • 03. Timers
    • 04. HTTP
    • 05. HTTPS
    • 06. MQTT
    • 07. Secure
    • 08. Storage
    • 09. Sleep
    • 10. RTC
    • 11. UserSW
    • 12. GPIO
    • 13. UART
    • 14. SPI
    • 15. I2C
    • 16. ADC
    • 17. BLE
    • 18. Utils
    • 19. nqBridge
    • 20. nqService
    • 21. nqMqtt
    • 22. nqFOTA
    • 23. nqWiFi
    • 24. nqLte
    • 25. nqLAN
    • 26. nqEx

Linux-based device

    Software Specifications

    • 01. System Requirements
    • 02. Installation
    • 03. Software Configurations
    • 04. Operational Flow
    • 05. Debug Log Acquisition
    • 06. Event Messages
    • 07. Updating Software

    neqto.js

    • 01. About neqto.js
    • 02. Log
    • 03. Timers
    • 04. HTTP
    • 05. HTTPS
    • 06. MQTT
    • 07. Secure
    • 08. Storage
    • 09. RTC
    • 10. UNIXSocket
    • 11. FileSystem
    • 12. SubProcess
    • 13. Utils
    • 14. nqLinux
    • 15. nqService
    • 16. nqMqtt
    • 17. nqFOTA
    • 18. nqLAN

neqto.js Libraries

  • About neqto.js Libraries
  • UART

    • GM65 Barcode Reader
    • SRF Ultrasonic Range Finder - Serial Mode

    I2C

    • HTS221 v2 Temperature and Humidity Sensor
    • LIS2DW12 v2 Accelerometer
    • SRF Ultrasonic Range Finder - I2C Mode
    • [Archive] HTS221 Temperature and Humidity Sensor
    • [Archive] LIS2DW12 Accelerometer

    Utils

    • RTC Alarm Synchronized Scheduler

    Integration

    • AWS S3 v2
    • AWS IoT Core v2
    • Azure IoT v2
    • GCP IoT Core
    • [Archive] AWS S3
    • [Archive] AWS IoT Core

neqto.js Snippets

  • About neqto.js Snippets
  • DataDog
  • Dropbox
  • Google Sheets
  • InfluxDB
  • Oracle Cloud Object Storage
  • Salesforce
  • SAP Cloud Platform Internet of Things
  • Splunk
  • Niagara

Release Notes

  • NEQTO Console Updates
  • NEQTO Firmware (Bridge Wi-Fi/LTE Module) Releases
  • NEQTO Firmware (STM32 Discovery Wi-Fi) Releases
  • NEQTO Firmware (Spresense Wi-Fi/LTE-M) Releases
  • NEQTO Engine for Linux Releases

[Archive] AWS IoT Core

This library has been archived and is no longer supported. The latest version of the AWS IoT Core Library can be found here.

The IOT_CORE library can be used to interact with the AWS IoT Core service to publish messages to the Message Broker's topic structure. For instance, using a temperature/humidity sensor, a user can publish the resulting readings straight from the sensor to a topic on IoT Core. The following information from the user is required to successfully publish to an IoT Core topic:

  • Certificate: A secure certificate created on AWS IoT core used for authorization
  • Key: The RSA private key for AWS IoT Core, used for authorization
  • Host: The custom endpoint from AWS IoT Settings page, to connect to AWS IoT
  • Topic: A topic to publish to on AWS IoT Core

After the initial setup of the IoT core settings on AWS and the obtainment of the required information, the user can perform two main operations using the IOT_CORE library: publish and post.

When creating the IOT_CORE object the following parameters must be set; cert, key, host, and topic.

These parameters can be set inside a typical JavaScript object as {key:value} pairs of type string, as follows:

Options

var iotOptions = {
    cert: "CERTIFICATE",
    key: "RSA_PRIVATE_KEY",
    host: "host.to.iot.region.amazonaws.com",
    topic: "topicToPublishTo",
};

Creation

Once the options are set, they can be passed in straight to IOT_CORE during creation:

var iotCore = new IOT_CORE(iotOptions);

Parameter Functions

After creating the iotCore object, each of the aforementioned parameters may be changed by the corresponding function call with a passed in {value} of String type:

  • cert: setCert({value})
  • key: setKey({value})
  • host: setHost({value})
  • topic: setTopic({value})

If setting multiple parameters at the same time, the parameters can be put into a typical JavaScript type object and passed to the setParameters({parametersObject}) function, or each parameter set function can be chained, e.g. iotCore.setCert("NEW_CERTIFICATE").setKey("RSA_KEY").setHost("awsHost.com").

After creating the IOT_CORE library object and setting the initial parameters, the user is ready to publish to the set topic using either publish() or post().

Main IoT Core Functions

POST

When calling the post({payload}) function, the user is required to send the accompanying payload object, which should either be a JSON object containing data (recommended) or a String. The post function will then use the set parameters to publish the payload to AWS IoT Core at the set topic. Post makes a post request over HTTPs.

PUBLISH

When calling the publish({payload}) function, the user is required to send the accompanying payload of type String to publish to the AWS IoT core topic. The publish function will then use the set parameters to publish the payload the set topic. Publish makes an mqtt publish call to publish data to the topic on IoT Core.

Example Script

The following script is an example of a user script after importing the IOT_CORE library along with an HTS221 sensor library.

The user activates interfaces on the NEQTO IO board and create a new I2C device object to interact with the HTS221 sensor.

The user then sets the initial IoT Core settings and creates an iot object that will be ready to publish to the set topic.

The user intends to measure and send 10 readings from the temperature/humidity HTS221 sensor at 10 second intervals to the IoT Core topic. A while loop is specified so that the readings are provided to the variable called tempHumi. The tempHumi reading result is a typical object in a JSON like format of {temp: <value>, humi <value>} which is finally passed along as the payload to the iot.post() method.

// IMPORTED LIBRARIES
// - HTS221
// - IOT_CORE

// Logging setup
log.setLevel(2);   //-1:NONE 0:ERROR 1:WARNING 2:DEBUG 3:TRACE
log.printLevel(2);  //0:DISABLE 1:LOG 2:CONSOLE 3:BOTH
log.clear();

//Use standard interface of NEQTO I/O board
nqEx.enI2CS(true);
nqEx.enI2CL(true);

//I2C Config
var baudrate = 400000;
var i2c = new I2C(1);

i2c.open(baudrate);

var hts = new HTS221(i2c);
hts.init();

var NUM_READINGS = 10;
var iteration = 0;

// Set IoT Core user options
var iotOptions = {
    cert: "-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----\n",
    key: "-----BEGIN RSA PRIVATE KEY-----\n-----END RSA PRIVATE KEY-----\n",
    host: "host.to.iot.core.amazonaws.com",
    topic: "topicToPublishTo"
}

var iot = new IOT_CORE(iotOptions);

// Main Loop
// Read temperature and humidity and publish to iot core topic every 10 seconds
while (iteration < NUM_READINGS) {
    // HTS returns an object like { temp: <value>, humi: <value> }
    var tempHumi = hts.getResult();

    iot.post(tempHumi);

    setTimeout(10000).wait();
    iteration += 1;
}
The company names and product names mentioned above are registered trademarks or trademarks of their respective companies.

Updated: 2021-02-19
← [Archive] AWS S3About neqto.js Snippets →
  • Options
  • Creation
  • Parameter Functions
  • Main IoT Core Functions
    • POST
    • PUBLISH
  • Example Script
AboutNewsProductsFAQPrivacy Policy}
NEQTO Console
IntroductionFundamentalsAdministrative ActionsDevice Management NEQTO Apps
NEQTO Bridge
NEQTO Bridge ModuleNEQTO Bridge Wi-Fi ModuleNEQTO Bridge LTE-1 ModuleError Logging Event Messages
API Documentation
API UsageGlobal APIRegional APIAPI Terms of Service
Jigsaw, Inc.
© 2023 JIG-SAW INC.