User Tools

Site Tools


public:products:cv-100l

AirCV - Universal S0 converter





  • The universal converter is used for application where you need to send data from S0 or pulses over the LoRa network
  • We offer battery operated units, as well as external power operated units.
  • Each universal converter has implemented LUA scripts and can be configured via configuration software
  • Can be modified to use analog input and up to 2x resistor measuring

Configuration SW

2019.12

2020.06

Configuration cable

Optically isolated converter
  • Good for externally power supplied units. It can save you from overvoltaging your PC in case of faulty cable connection.
  • Can be supplied by iNELS Air
  • 3.5mm jack connector


Before installation

1. Loosen the screws and open the lid
2. Connect the cables from S0 to the terminal board
3. Remove the paper from the battery bay
4. The device initializes, flashes green 3 times
5. Put the lid back in the box and pull it off screws

LED signalization

  • 3x green - successful device initialization and network connection (with OTTA)
  • 1x green - successful sending of the first data
  • 1x red - unsuccessful sending of the first data
Energy consumption - battery operated
Battery type: Lithium 3.6VDC D-cell
Battery capacity: 17 000 mAh
Battery lifespan: 4.5 years when transmitting twice a day with SF12/125 kHz (spreading factor), TXP=14 dBm
Energy consumption - external power supply
Voltage: 85- 305 VAC
Frequency: 47-63 Hz
Maximum power consumption: 4 W
Pulse input
Number of inputs: 2 or 4 depending on specification
Impulse counter: 32 bits (up to 232 = 4 294 967 296 pulses)
Minimum pulse duration: 30 ms
Maximum pulse duration:
Maximum input voltage: 6V
Maximum pulse frequency: To be specified
Communication via LoRa
LoRaWAN specification: 1.0.1
Class: A
Frequency: 868 MHz (ISM)
Antenna: External connected via SMA connector
Communication via NB-IoT
Bands: B1/B3/B5/B8/B20/B28
Antenna: External, connected via SMA connector
General information
IP coverage: IP65
Dimensions: 123 x 82 x 56 mm
Operational temperature: -30 °C to +60 °C





Data

  • The data is twelve bytes long for each channel. The current pulse counter value is sent in the first four bytes.
  • Two historical values are stored in the next eight bytes.
  • The value of the pulse counter is incremented throughout the running of the sensor.
  • The data transmission interval is set to 12 hours
  • the interval of sending data can be changed by sending configuration packet

Default payload

Byte (included) Meaning The range of values Note
0 SensorType 0x05 Fixed value indicating the type of sensor
1 - 2 SupplyVoltage 0x0000 - 0x0EFF Supply voltage in mV
3 - 6 S0Ch0LastValue 0x00000000 - 0xFFFFFFFFChannel 0 - number of pulses measured from device startup
7 - 10 S0Ch0History1 0x00000000 - 0xFFFFFFFFChannel 0 - previous value of the number of pulses. Number 1
11 - 14 S0Ch0History2 0x00000000 - 0xFFFFFFFFChannel 0 - previous value of the number of pulses. Number 2
15 - 18 S0Ch1LastValue 0x00000000 - 0xFFFFFFFFChannel 1 - number of pulses measured from device startup
19 - 22 S0Ch1History1 0x00000000 - 0xFFFFFFFFChannel 1 - previous value of the number of pulses. Number 1
23 - 26 S0Ch1History2 0x00000000 - 0xFFFFFFFFChannel 1 - previous value of the number of pulses. Number 2
27 - 30 S0Ch2LastValue 0x00000000 - 0xFFFFFFFFChannel 2 - number of pulses measured from device startup
31 - 34 S0Ch2History1 0x00000000 - 0xFFFFFFFFChannel 2 - previous value of the number of pulses. Number 1
35 - 38 S0Ch2History2 0x00000000 - 0xFFFFFFFFChannel 2 - previous value of the number of pulses. Number 2
39 - 42 S0Ch3LastValue 0x00000000 - 0xFFFFFFFFChannel 3 - number of pulses measured from device startup
43 - 46 S0Ch3History1 0x00000000 - 0xFFFFFFFFChannel 3 - previous value of the number of pulses. Number 1
47 - 50 S0Ch3 History2 0x00000000 - 0xFFFFFFFFChannel 3 - previous value of the number of pulses. Number 2

NOTE: For double input converter only 0 - 26 bytes apply.

Configuration

The IoT Converter can be configured via a PC application or remotely via a LoRaWAN or NB-IoT network.
Inside the IoT converter is a button that allows you to wake up the IoT converter immediately (asynchronous to the internal clock).

LUA script interface

In addition to configuration via a PC application, a LUA scripting interface is implemented in the IoT converter.
The LUA scripting interface allows you to implement your own logic (data preprocessing, etc.) within the converter.
Payload can be also modified by using LUA script.
Details regarding LUA scripts with examples can be found here: https://wiki.acrios.com/doku.php?id=public:general:lua_api

Configurable parameters

  • Data transmission interval
  • Number of pulses at which data will be sent (for each channel separately)
  • ADR - Adaptive Data Rate
  • SF - Spreading Factor
  • TXP - Transmit Power
  • CNF/UNCNF - Confirmed/Unconfirmed messaging

S0 LUA configuration

api.S0setThreshold(channel, value)

This function defines a threshold between current value of a S0 channel counter and last reported value. When the difference of these last two reaches the value, the onThreshold() event is called.

Arguments

  • channel (integer) - Number of the S0 channel, 0 to 3.
  • value (integer) - Threshold value, 0 disables the threshold, 0x1-0xFFFFFFFF sets the threshold.

Example

--sets threshold for channel 2 to the value of 10000 
api.S0setThreshold(2, 10000)

api.S0initializeCounter(channel, value)

This function is typically used on startup to restore current value of the S0 counter from a non-volatile memory

Arguments

  • channel (integer) - Number of the S0 channel, 0 to 3.
  • value (integer) - Value of the S0 counter

Example

--sets counter value for channel 0 to the value of 100 
api.S0initializeCounter(0, 100)

value = api.S0readCounter(channel)

This function reports the current value of the S0 channel counter specified in the channel input argument. Note: By calling this function, an internal shadow variable for the channel counter is updated, so that the counter for onThreshold() event is reset.

Arguments

  • channel (integer) - Number of the S0 channel, 0 to 3.

Returns

  • value (integer) - Value of the S0 counter

Example

--reads the value of S0 channel 3 and stores to val variable 
val = api.S0readCounter(3)

Default payload LUA script

This script defines a LUA function wordToBuffer() for easy insertion of 32bit integer to a buffer and getS0Data() function, which is used to format a packet containing values from S0 counters and current battery voltage. A new event is used - onThreshold(), which is called when an S0 channel is incremented by a defined amount of units (here the value is setup to 1000 in the onStartup() callback function). The data frame is sent to LoRa either periodically or when the threshold is hit.

function wordToBuffer(word)
    local buff = ""
    buff = buff ..  string.char(word%256) ..  string.char((word/256)%256)
    buff = buff .. string.char(((word/256)/256)%256)
    buff = buff .. string.char((((word/256)/256)/256)%256) 
    return buff
end
 
-- get and format S0 inputs
function getS0Data()
    s00 = api.S0readCounter(0) 
    print("S0-0: "..tostring(s00))
    s01 = api.S0readCounter(1) 
    print("S0-1: "..tostring(s01))
    s02 = api.S0readCounter(2)
    print("S0-2: "..tostring(s02))
    s03 = api.S0readCounter(3) 
    print("S0-3: "..tostring(s03))
 
    -- read old values
    s00_l = api.getVar(0)
    s01_l = api.getVar(1)
    s02_l = api.getVar(2)
    s03_l = api.getVar(3)
 
    s00_ll = api.getVar(4)
    s01_ll = api.getVar(5)
    s02_ll = api.getVar(6)
    s03_ll = api.getVar(7)
 
    -- update old values
    api.setVar(0, s00)
    api.setVar(1, s01)
    api.setVar(2, s02)
    api.setVar(3, s03)
 
    api.setVar(4, s00_l)
    api.setVar(5, s01_l)
    api.setVar(6, s02_l)
    api.setVar(7, s03_l)
 
    -- get battery voltage
    v = api.getBatteryVoltage()
 
    -- assemble the frame
    buf = string.char(5) -- device class
    buf = buf .. wordToBuffer(s00) 
    buf = buf .. wordToBuffer(s00_l) 
    buf = buf .. wordToBuffer(s00_ll) 
    buf = buf .. wordToBuffer(s01) 
    buf = buf .. wordToBuffer(s01_l) 
    buf = buf .. wordToBuffer(s01_ll) 
    buf = buf .. wordToBuffer(s02) 
    buf = buf .. wordToBuffer(s02_l) 
    buf = buf .. wordToBuffer(s02_ll) 
    buf = buf .. wordToBuffer(s03) 
    buf = buf .. wordToBuffer(s03_l) 
    buf = buf .. wordToBuffer(s03_ll) 
 
    buf = buf .. string.char(0)
    buf = buf .. string.char(v%256) ..  string.char((v/256)%256)
    buf = buf .. string.char(0)
 
    -- print the frame
    print("Frame in hex: <devClass, S0_0, S0_0_last, ... , 0, voltage, 0>")
    api.dumpArray(buf)
 
    return buf
 
end
 
function onWake () 
    buf,err,ack,wake = api.getGUIContext()
    print("onWake(), periodic wake up")
    buf = getS0Data()
        print("Sending to LORA")
        api.loraSend(ack,20000,buf)
        print("Done sending")
        print("No error, sent to lora")
 
    api.wakeUpIn(0,0,wake,0)
 
end
 
function onThreshold ()
        buf,err,ack,wake,src = api.getGUIContext()
 
        print("onThreshold(), reason S0: " .. tostring(src))
 
        buf = getS0Data()
        print("Sending to LORA")
        api.loraSend(ack,20000,buf)
        print("Done sending")
        print("No error, sent to lora")
end 
 
 
function onStartup()
    print("onStartup(), Starting up LUA interface...")
 
    --set to threshold
    api.S0setThreshold(0, 1000)
    api.S0setThreshold(1, 1000)
    api.S0setThreshold(2, 1000)
    api.S0setThreshold(3, 1000)
 
    -- initialize old values
    api.setVar(0, 0)
    api.setVar(1, 0)
    api.setVar(2, 0)
    api.setVar(3, 0)
    api.setVar(4, 0)
    api.setVar(5, 0)
    api.setVar(6, 0)
    api.setVar(7, 0)
end

EasyConf is a simplified communication protocol for remote over-the-air update of basic parameters of LoRaWAN version of AirCV devices.

Its purpose is not to replace the existing protocol, which is based on generated YAML file from Converter GUI software, but rather as an easy-to-manually-generate variant with basic parameters.

Protocol

Unlike for the standard configuration protocol, where the configuration frames are sent to port 123, in EasyConf, the configuration commands are sent to port 124. The format is the following:

Time period changing command:
Identification BCD time - hundreds of minutes BCD time - minutes
0xC1 0x00 - 0x99 (only 0~9 nibbles are acceptable) 0x00 - 0x99 (only 0~9 nibbles are acceptable)

Example: C11234 - length of 3 bytes, setting the time period to 1234 minutes

Identification Boolean value - confirmed 0x01, unconfirmed 0x00
0xC2 0x01 or 0x00

Example: C200 - length of 2 bytes, setting the uplink messages to be unconfirmed

LoRaWAN datarate command:
Identification Datarate number (0x00 ~ DR0 ~ SF12 to 0x05 ~ DR5 ~ SF7)
0xC3 0x00 to 0x05

Example: C300 - length of 2 bytes, setting the uplink data rate to DR0, spreading factor SF12, maximum range

LoRaWAN automatic data rate command:
Identification Boolean value - ADR on 0x01, ADR off 0x00
0xC4 0x01 or 0x00

Example: C401 - length of 2 bytes, enable ADR (recommended)

Batch configuration change:
Identification BCD time - hudreds of minutes BCD time - minutes Boolean value - confirmed 0x01, unconfirmed 0x00 Datarate number (0x00 ~ DR0 ~ SF12 to 0x05 ~ DR5 ~ SF7) Boolean value - ADR on 0x01, ADR off 0x00
0xC5 0x00 - 0x99 0x00 - 0x99 0x01 or 0x00 0x00 to 0x05 0x01 or 0x00

Example: C50010010500 - length of 6 bytes, period 10 minutes, enable confirmed uplink, data rate DR5/SF7, disable automatic data rate

LoRaWAN multicast credentials settings:
Identification Multicast Device Address Multicast Network Session Key Multicast Application Session Key Multicast initial Downcounter value
0xCC 4 bytes 16 bytes 16 bytes 4 bytes
Example

To get this settings:

This message must be sent, with zero initial downcounter:

CC5ea85a58f5d0ab660f5603b1da794f2430218eff5d31fdc2bdfba35a99230c1df3cbb22000000000

Wire connection


S1 - pulse input 1
GND - ground 1
S2 - pulse input 2
GND - ground 2
S3 - pulse input 3
GND - ground 3
S4 - pulse input 4
GND - ground 4
VCC - power
GND - ground




Older revision


4 - pulse input 4
GND - ground 4
3 - pulse input 3
GND - ground 3
2 - pulse input 2
GND - ground 2
1 - pulse input 1
GND - ground 1
VCC - power
GND - ground

Note: Older revision has the same functions, only PCB layout may be different.

public/products/cv-100l.txt · Last modified: 2020/07/03 14:59 by Acrios Admin