Integration

Setup VM (using Nodejs version 10 or above)

Download the source code

tar -zxf shio-http-server-v1.11.tar.gz

cd shio-http-server-v1.11

ls -al

decode.js
.env
index.js
package.json
package-lock.json
README.md

npm install express body-parser dotenv mqtt fs-extra

npm WARN http-server@1.0.0 No repository field.

+ dotenv@8.2.0
+ body-parser@1.19.0
+ mqtt@3.0.0
+ express@4.17.1
+ fs-extra@9.0.1
added 131 packages from 85 contributors and audited 131 packages in 4.061s
found 0 vulnerabilities

node index.js

Server start! (8080)


Receiving Message

When data comes in, two messages will be shown in console:
1 Received packet
2 Data packet


Save iBeacon list to a file

To save the iBeacon list to a file, specify the file name in .evn and uncomment FILE.


Integration to Other Systems

Hive MQTT

You can add your mqtt broker address in .env

PORT=8080
TZ=Asia/Hong_Kong
MQTT_HOST=mqtt://broker.mqttdashboard.com
MQTT_PORT=8000

Server start! (8080)
To MQTT server:mqtt://broker.mqttdashboard.com:8000

node index.js

Server start! (8080)
To MQTT server:mqtt://broker.mqttdashboard.com:8000

Visit http://www.hivemq.com/demos/websocket-client/ to get your data

You can see your data after subscribing softhard/# with QoS 0


JSON Format Definition

NBIOT Packet {
uId: integer,
gId: integer ,
deviceId: string,
payload: string,
freq: string,
datarate: string,
snr: string,
rssi: string,
seqnum: string,
timestamp: string, UTC,
port: integer,
lpwantype: ‘NBIOT’,
imei: string
}
{
uId: 13,
gId: 443,
deviceId: ‘89882280666017606371’,
payload: ‘143601070ff10e06e0’,
freq: ‘::ffff:18.197.48.88’,
datarate: ‘-‘,
snr: ‘-‘,
rssi: ‘-63’,
seqnum: ‘1’,
timestamp: ‘2021-07-20T17:51:49+00:00’,
port: 8062,
lpwantype: ‘NBIOT’,
imei: ‘867648043619087’
}
LORAWAN Packet {
uId: integer,
gId: integer,
deviceId: string,
payload: string,
freq: integer,
datarate: integer,
snr: integer,
rssi: integer,
seqnum: integer,
timestamp: string, UTC,
port: integer,
lpwantype: ‘LORAWAN’,
imei: string
}
{
uId: 13,
gId: 443,
deviceId: ‘0004a30b00fbceed’,
payload: ‘14060107138801011F023C’,
freq: 923200000,
datarate: 5,
snr: 9,
rssi: -17,
seqnum: 2,
timestamp: ‘2021-07-20T17:33:17+00:00’,
port: 1,
lpwantype: ‘LORAWAN’,
imei: ‘ac1f09fffe0465ad’
}
SIGFOX Packet{
uId: integer,
gId: integer,
deviceId: string,
payload: string,
freq: string,
datarate: string,
snr: string,
rssi: string,
seqnum: string,
timestamp: string, UTC,
port: ‘-‘,
lpwantype: ‘SIGFOX’,
imei: string
}
{
uId: 48,
gId: 252,
deviceId: ’13C7E25′,
payload: ‘010110024c3901933a0276’,
freq: ‘-‘,
datarate: ‘-‘,
snr: ‘6.00’,
rssi: ‘-116.00’,
seqnum: ‘328’,
timestamp: ‘2021-07-28T12:56:53+00:00’,
port: ‘-‘,
lpwantype: ‘SIGFOX’,
imei: ‘7C54’
}

Data Packet – Edge ECO

5in1 Odor Sensor

StatusData
Power up{“model”:”Edge ECO NBIoT”,”status”:”online”,”version”:”1.10.0″}
{“temperature”:27.4,”humidity”:63,”co2″:636,”tvoc”:30,”pm2″:34,”hcho”:30,”h2s”:93,”nh3″:967}
Regular message{“temperature”:27.4,”humidity”:63,”co2″:636,”tvoc”:30,”pm2″:34,”hcho”:30,”h2s”:93,”nh3″:967}

5in1 Sensor

StatusData
Power up{“model”:”Edge ECO NBIoT”,”status”:”online”,”version”:”1.10.0″}
{“temperature”:27.4,”humidity”:52,”co2″:401,”tvoc”:0,”pm2″:24,”hcho”:0}
Regular message{“temperature”:27.4,”humidity”:52,”co2″:401,”tvoc”:0,”pm2″:24,”hcho”:0}

Odor Sensor

StatusData
Power up{“model”:”Edge ECO NBIoT”,”status”:”online”,”version”:”1.10.0″}
{“temperature”:27.4,”humidity”:63,”h2s”:93,”nh3″:967}
Regular message{“temperature”:27.4,”humidity”:63,”h2s”:93,”nh3″:967}

5in1 Odor Light Sensor

StatusData
Power up{“model”:”Edge ECO NBIoT”,”status”:”online”,”version”:”1.10.0″}
{“temperature”:24.4,”humidity”:61,”co2″:402,”tvoc”:30,”pm2″:50,”hcho”:140,”h2s”:4,”nh3″:10}
{“light”:55}
Regular message{“temperature”:24.4,”humidity”:61,”co2″:402,”tvoc”:30,”pm2″:50,”hcho”:140,”h2s”:4,”nh3″:10}
{“light”:55}

Data Packet – Edge Lite

Temperature Sensor

Power up
Sample Payload141600090203050710440100f50247
Decoded payload{“model”:”Edge Lite NBIoT”,”status”
:”online”,”version”:”2.3.5″,”vdd”:4
164,”temperature”:24.5,”humidity”:7
1}
Regular message
Sample Payload1416010710440100f60243
Decoded payload{“model”:”Edge Lite NBIoT”,”status”
:”active”,”vdd”:4164,”temperature”:
24.6,”humidity”:67}

Door Sensor (Normally close)

StatusData
Power up{“model”:”Edge Lite NBIoT”,”status”:”online”,”version”:”1.10.0″,”vdd”:4199,”temperature”:26.6,”humidity”:38,”input1″:1}
Regular message{“model”:”Edge Lite NBIoT”,”status”:”active”,”vdd”:4199,”temperature”:26.6,”humidity”:38,”input1″:1}
Door is opened{“vdd”:4200,”temperature”:26,”humidity”:40,”input1″:0}
Door is closed{“vdd”:4201,”temperature”:26,”humidity”:39,”input1″:1}

Flood Sensor

StatusData
Power up{“model”:”Edge Lite NBIoT”,”status”:”online”,”version”:”1.10.0″,”vdd”:4199,”temperature”:26.6,”humidity”:38,”input1″:0}
Regular message{“model”:”Edge Lite NBIoT”,”status”:”active”,”vdd”:4199,”temperature”:26.6,”humidity”:38,”input1″:0}
Floor is wet{“vdd”:4201,”temperature”:26,”humidity”:39,”input1″:1}
Floor is dry{“vdd”:4201,”temperature”:26,”humidity”:39,”input1″:0}

Limit Switch / Gate Sensor (Normally open)

StatusData
Power up{“model”:”Edge Lite NBIoT”,”status”:”online”,”version”:”1.10.0″,”vdd”:4199,”temperature”:26.6,”humidity”:38,”input1″:0}
Regular message{“model”:”Edge Lite NBIoT”,”status”:”active”,”vdd”:4199,”temperature”:26.6,”humidity”:38,”input1″:0}
Switch is closed{“vdd”:4201,”temperature”:26,”humidity”:39,”input1″:1}
Switch is opened{“vdd”:4201,”temperature”:26,”humidity”:39,”input1″:0}

IR Sensor

StatusData
Power up{“model”:”Edge Lite NBIoT”,”status”:”online”,”version”:”1.10.0″,”vdd”:4199,”temperature”:26.6,”humidity”:38,”input1″:0}
Regular message{“model”:”Edge Lite NBIoT”,”status”:”active”,”vdd”:4199,”temperature”:26.6,”humidity”:38,”input1″:0}
An object is detected{“vdd”:4201,”temperature”:26,”humidity”:39,”input1″:1}
No object in front{“vdd”:4201,”temperature”:26,”humidity”:39,”input1″:0}

PIR Sensor

StatusData
Power up{“model”:”Edge Lite NBIoT”,”status”:”online”,”version”:”1.10.0″,”vdd”:4199,”temperature”:26.6,”humidity”:38,”input1″:0}
Regular message{“model”:”Edge Lite NBIoT”,”status”:”active”,”vdd”:4199,”temperature”:26.6,”humidity”:38,”input1″:0}
A moving object is detected{“vdd”:4201,”temperature”:26,”humidity”:39,”input1″:1}

Smoke Sensor

StatusData
Power up{“model”:”Edge Lite NBIoT”,”status”:”online”,”version”:”1.10.0″,”vdd”:4199,”temperature”:26.6,”humidity”:38,”input1″:0}
Regular message{“model”:”Edge Lite NBIoT”,”status”:”active”,”vdd”:4199,”temperature”:26.6,”humidity”:38,”input1″:0}
Smoke is detected{“vdd”:4201,”temperature”:26,”humidity”:39,”input1″:1}

Door Counter

StatusData
Power up{“model”:”Edge Lite NBIoT”,”status”:”online”,”version”:”1.10.0″,”vdd”:4196,”temperature”:26.3,”humidity”:50,”input1″:0,”count”:0}
Regular message{“vdd”:4196,”temperature”:26,”humidity”:52,”input1″:0,”count”:1}
Door count reaches the limit{“vdd”:4195,”temperature”:26.1,”humidity”:53,”input1″:0,”count”:12}

IR / Capsense Level Detector

StatusData
Power up{“model”:”Edge Lite NBIoT”,”status”:”online”,”version”:”1.10.0″,”vdd”:4199,”temperature”:26.6,”humidity”:38,”input1″:0}
Regular message{“model”:”Edge Lite NBIoT”,”status”:”active”,”vdd”:4199,”temperature”:26.6,”humidity”:38,”input1″:0}

H2S Sensor

StatusData
Power up{“model”:”Edge Lite NBIoT”,”status”:”online”,”version”:”1.10.0″,”vdd”:4199,”temperature”:26.1,”humidity”:48,”h2s”:26890}
Regular message{“model”:”Edge Lite NBIoT”,”status”:”active”,”vdd”:4197,”temperature”:26,”humidity”:45,”h2s”:26890}

CO Sensor

StatusData
Power up{“model”:”Edge Lite NBIoT”,”status”:”online”,”version”:”1.10.0″,”vdd”:4196,”temperature”:23.8,”humidity”:32,”co”:0}
Regular message{“model”:”Edge Lite NBIoT”,”status”:”active”,”vdd”:4196,”temperature”:23.8,”humidity”:32,”co”:0}

Noise Sensor

StatusData
Power up{“model”:”Edge Lite NBIoT”,”status”:”online”,”version”:”1.10.0″,”vdd”:4252,”temperature”:28.5,”humidity”:56,”noise”:47}
Regular message{“model”:”Edge Lite NBIoT”,”status”:”active”,”vdd”:4252,”temperature”:28.5,”humidity”:56,”noise”:49}

Ultrasonic Sensor

StatusData
Power up{“model”:”Edge Lite NBIoT”,”status”:”online”,”version”:”1.4.87″,”vdd”:3890,”temperature”:20.9,”humidity”:58,”distance”:0}
Regular message{“model”:”Edge Lite NBIoT”,”status”:”active”,”vdd”:4133,”temperature”:16.8,”humidity”:44,”distance”:0}

Ultrasonic Aqua Sensor

StatusData
Power up{“model”:”Edge Lite NBIoT”,”status”:”online”,”version”:”1.10.0″,”distance”:7650,”speed”:0,”signal_level”:13,”water_level”:7.65}
Regular message{“model”:”Edge Lite NBIoT”,”status”:”active”,”distance”:7650,”speed”:0,”signal_level”:13,”water_level”:7.65}

9-axis Motion Sensor

StatusData
Power up{“model”:”Edge Lite NBIoT”,”status”:”online”,”version”:”1.10.0″}
{“vdd”:4170,”temperature”:26.2,”humidity”:31,”acc_x”:0.13,”acc_y”:-0.97,”acc_z”:0.22}
{“angular_rate_x”:2.5,”angular_rate_y”:-4.3,”angular_rate_z”:0.1,”magnetic_field_x”:0,”magnetic_field_y”:0.33,”magnetic_field_z”:0.29}
Regular message{“vdd”:4170,”temperature”:26.2,”humidity”:31,”acc_x”:0.13,”acc_y”:-0.97,”acc_z”:0.22}
{“angular_rate_x”:2.5,”angular_rate_y”:-4.3,”angular_rate_z”:0.1,”magnetic_field_x”:0,”magnetic_field_y”:0.33,”magnetic_field_z”:0.29}

Data Packet – Edge Router

iBeacon

StatusData
Power up{“model”:”Edge Router NBIoT”,”status”:”online”}
Regular message{“ibeacon_group”:”00″,”ibeacon_num”:”05″,”ibeacon_set”:”(0400030009C4;76)(800018385754;76)(80001D3A5754;80)(800019B95754;63)(105357FF1E03;87)”}

Data Sender

StatusData
Power up{“model”:”Edge Router NBIoT”,”status”:”online”}
Regular message{“data”:”hello”}

Key definition

FieldKey NameUnitFormat
Temperaturetemperature°Csigned, 1 decimal place
Humidityhumidity%unsigned
Lightlightluxunsigned
GPSgps_qualityunsigned
gps_satelliteunsigned
gps_latsigned, dd format
gps_longsigned, dd format
gps_altitudemunsigned
gps_speedm/sunsigned
gps_courseunsigned
BatteryvddmVunsigned
Analoganalogsigned
FW Versionversionstring
Countcount
External temperatureexternal_temperature°Csigned, 1 decimal place
Inputinput1bool
input2bool
input3bool
Distancedistancemmunsigned
Motionmotionbool
IR Temperatureir_internal_temperature°Csigned, 1 decimal place
ir_external_temperature°Csigned, 1 decimal place
Occupancyoccupancybool
Waterleakwaterleakbool
Modelmodelstring
Statusstatusstring
IBeaconibeacon_groupunsigned
ibeacon_numunsigned
ibeacon_setstring
Datadatastring
Lift Signalliftstring
NoisenoisedBunsigned
Accelerationacc_xgsigned, 2 decimal place
acc_ygsigned, 2 decimal place
acc_zgsigned, 2 decimal place
Angleang_xsigned, 2 decimal place
ang_ysigned, 2 decimal place
Speedspeedm/sunsigned, 2 decimal place
Signal Levelsignal_leveldBmunsigned
Water Levelwater_levelmunsigned, 2 decimal place
In Countin_countunsigned
Out Countout_countunsigned
Angular Rateangular_rate_xdpssigned, 1 decimal place
angular_rate_ydpssigned, 1 decimal place
angular_rate_zdpssigned, 1 decimal place
Magnetic Fieldmagnetic_field_xGausssigned, 2 decimal place
magnetic_field_yGausssigned, 2 decimal place
magnetic_field_zGausssigned, 2 decimal place
Timestampts_type1: System time
2: GPS time
ts_year
ts_month
ts_day
ts_hour
ts_minute
ts_second
CurrentcurrentAunsigned, 2 decimal place
Colourcolour_redluxunsigned
colour_blueluxunsigned
colour_greenluxunsigned
colour_whiteluxunsigned
Total Suspended Particles
總懸浮顆粒 (TSP)
tspμg/m3unsigned
PM1.0 超细颗粒物pm1μg/m3unsigned
PM2.5 细颗粒物pm2μg/m3unsigned
PM10 可吸入颗粒物pm10μg/m3unsigned
Sulphur dioxide 二氧化硫 (SO2)so2ppbunsigned
Nitrogen dioxide 二氧化氮 (NO2)no2ppbunsigned
Carbon monoxide 一氧化碳 (CO)coppmunsigned
Ozon 臭氧 (O3)o3ppbunsigned
Hydrogen sulfide 硫化氫 (H2S)h2sppbunsigned
Carbon dioxide 二氧化碳 (CO2)co2ppmunsigned
Total Volatile Organic Compound
總揮發性有機化合物 (TVOC)
tvocppbunsigned
Formaldehyde 甲醛 (HCHO)hchoμg/m3unsigned
Ammonia 氨 (NH3)nh3ppbunsigned
Methane 甲烷 (CH4)ch4ppbunsigned
Propane 丙烷 (C3H8)c3h8ppbunsigned
Ethanol 乙醇 (C2H5OH)c2h5ohppbunsigned