Socket
Book a DemoInstallSign in
Socket

mongoose-os-emulator

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mongoose-os-emulator

The project aims to support mongoose os mjs emulation on PC.

1.0.5
latest
Source
npmnpm
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

iot_blockchain_exps

The project aims to support mongoose os mjs emulation on PC.

Install

npm install --save mongoose-os-emulator

In your init.js file include the below line at the top.

require('mongoose-os-emulator')();

Run

node init.js 0

Where 0 is your emulated device_id. The localhost port for the UI can be calculated as 5000 + device_id. E.g.

node init 1
http://127.0.0.1:5001

Test

To Run on Windows

double click run.bat

To run on Linux

./run.sh

To make a request

run ota_server and send postman or from GUI request


http://127.0.0.1:5001/rpc/on_request

{
	
	"req_id":"123",
	"src_ip":"127.0.0.1:8080",
	"status":{"message":"under process"},
	"job":{"res_id":61,"res_name":"Ultrasound sensor","action":"read"}
	
}

Alt text Alt text

Limitations

Currently only these libraries are supported with limited scope. Feel free to add more features and raise a PR.

    this.Sys = load('api_sys.js');
    this.HTTP = load('api_http.js');
    this.RPC = load('api_rpc.js');
    this.Cfg = load('api_config.js');
    this.ffi = load('api_ffi.js');
    this.Event = load('api_events.js');
    this.Net = load('api_net.js');
    this.File = load('api_file.js');
    this.GPIO = ffi('gpio')
    this.Timer = load('api_timer.js');
    this.UART = load('api_uart.js');

Keywords

iot

FAQs

Package last updated on 20 Apr 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.