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 S3

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

The AWS_S3 library can be used to interact with an AWS S3 bucket structure. Using the AWS_S3 library with an accompanied sensor library, for instance, gives the user the ability to save data output from the sensor directly to their personal cloud space. The user should have the following information after setting up a bucket on AWS S3:

  • Region: The AWS region that the bucket resides in (ex: ap-northest-2)
  • Bucket name: The name of the bucket that the user set up
  • Access key ID: An access key id created through AWS's IAM security credentials page
  • Secret key: The secret key associated with the created access key id

After the initial setup of the bucket on AWS S3 and obtaining the required information, the user can utilize the AWS_S3 library to perform three main actions: get, put and delete.

During the creation of the AWS_S3 object, the following parameters must be set; region, bucketName, accessKeyId, secretKey, fileName, filePath, and body.

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

Options

var userOptions = {
    region: "ap-northeast-2",
    bucketName: "sample-bucket",
    accessKeyId: "ACCESSKEYID",
    secretKey: "SeCrEtKeY123",
    fileName: "SensorData.csv",
    filePath: "/",
    body: ""
};

Creation

The above userOptions object can be passed into the AWS_S3 constructor in order to set the user's configuration:

var s3 = new AWS_S3(userOptions);

Parameter Functions

In addition to passing in the userOptions object, users can set each of the fields individually using the following methods:

  • region: setRegion({value})
  • bucketName: setBucketName({value})
  • accessKeyId: setAccessKeyId({value})
  • secretKey: setSecretKey({value})
  • fileName: setFileName({value})
  • filePath: setFilePath({value})
  • body: setBody({value})

These methods can be chained together: s3Library.setRegion("newRegion").setFileName("newFile.txt").setBody("New File contents").

After creating the S3 object and setting its initial parameters, the user is ready to make calls to put(), get(), and delete(). The parameters must be set to access these methods to communicate with S3.

Main S3 Functions

PUT

When calling the put() function, the S3 library will attempt to upload the contents of the body parameter to the current bucket at the file name and path set in the parameters.

GET

When calling the get() function, the S3 library will attempt to download the contents into the body parameter from the file path and name set in the parameters from the current bucket. If no filename is specified, the whole directory structure of the bucket will be downloaded. You can check the downloaded content in the log. Please refer to the Log documentation for functions to access the device log.

DELETE

When calling the delete() function, the S3 library will attempt to delete the file at the file path and name of the current bucket.

Example Script

The following is an example user script after importing the AWS_S3 library alongside an HTS221 sensor library.

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

The user creates a buffer called outputFile which will be a csv type file of comma delimited values for time, temperature and humidity values. The user then takes 10 readings from the HTS221 sensor over 10 second intervals and appends the data to the outputFile buffer with a new line for each new reading value set.

After finishing the sensor readings, the user creates an S3 object with their region, bucket, access key id, secret key, filename, file path, and the outputFile buffer as the body parameters. The user then calls the put() method to upload the csv file to their S3 bucket.

// IMPORTED LIBRARIES
// - HTS221
// - AWS_S3

// 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 IO 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 outputFile = "Time,Temperature,Humidity\n";

var NUM_READINGS = 10;
var iteration = 0;

while (iteration < NUM_READINGS) {

    var dateNow = new Date();
    var tempHumi = hts.getResult();

    outputFile += dateNow.toTimeString() + "," + tempHumi.temp + "," + tempHumi.humi + "\n";

    setTimeout(10000).wait();
    iteration += 1;
}

// S3 User Options
var userOps = {
    region: "ap-northeast-2",
    bucketName: "bucket_name",
    accessKeyId: "ACCESS_KEY_ID",
    secretKey: "SECRET_KEY",
    fileName: "HTS221.csv",
    filePath: "/",
    body: outputFile,
};

var s3 = new AWS_S3(userOps);
s3.put();
The company names and product names mentioned above are registered trademarks or trademarks of their respective companies.

Updated: 2021-02-19
← GCP IoT Core[Archive] AWS IoT Core →
  • Options
  • Creation
  • Parameter Functions
  • Main S3 Functions
    • PUT
    • GET
    • DELETE
  • 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.