LPN AI
Last updated
Last updated
4..20mA to LoRa interface
LPN AI SW Specification / V0.11
Document Information:
The LPN AI can handle 2 analog inputs, according to user configuration, and transmit the results to a LoRaWAN server.
Telegrams from the server to the Node (LPN AI) are downlinks and from the node to the server are uplinks. In the LoRaWAN, all uplinks are provided with a CRC by default, but the downlinks are not.
1. Jumper settings:
Before connecting the input signal path to the LPN AI, set the jumper correctly:
For correct measurement configure the AI1 and AI2 MeasureTyp equivalent. Attention: Wrong Jumper settings can damage the device, especially the position 2-3 (0...20mA) with input voltage
>2V can damage the burden!
2. Function Buttons
Reset of the device configuration during power up possible: If both buttons are pressed, the LoRa configuration (CFG.TXT) is reset to the default values.Function of LEDs
3. Function of LEDs
After switching on, all LEDs light up for 0.5 seconds, if the LEDs remain lit and the red LED flashes briefly, the bootloader is active. Blink variants of the blue and green LEDs: 12%-> 0.7s off + 0.1s on; 50%--> 0.4s off + 0.4s on; 88%-> 0.1 s off + 0.7s on
4. LoRa Up and Downlink
LoRa Port 4’AI’:
An Uplink is sent on port 4, when an AI application uplink is triggered or button 1 was pressed or by the live sign interval LivesignConfirmedTx.
The port 4 uplink is also used for each unknown (and Port 4) confirmed port downlink
Uplink payload structure:
The size of the payload is depending on the selected send method chosen in the config.txt file.
Payload size (n+1) is 9..49 (Standard size is 11). The AI1 or AI2 outputs data in the Fehler! Verweisquelle konnte nicht gefunden werden. according to the MeasureTyp.
5. Configuration via USB interface
Insert the USB cable and open CFG.TXT, where all settings for LoRa and AI can be configured (not in USB-CDC Mode).
Configuration changes only take effect after a restart.
LoRa configuration in CFG. TXT:
LoRa (vers. 0x43010200):
PrivateNetwork=0 // 0 = Public (Preamble = 0x34) 1 = Private (Preamble = 0x12)
Activation:
OTA=0
OTA(OverTheAir):
DevEUI=3734333665357D04
AppEUI=70B3D5FFFE29701B
AppKey=2B8DEFCD2301674554761032DCF E98BA
ABP(ActivationByPersonalization): DevAddr=0x00420136
NetwSesKey=1123456789ABCDEFFEDCBA9 876543211
AppSesKey=EEDCBA987654321001234567 89ABCDEE
Broadcast: BC_Addr=0x00000000 // 0 for not used
BC_NetwSesKey=2223456789ABCDEEEEDCB A9876543222
BC_AppSesKey=DDDCBA98765432111123456 789ABCDDD
Datarate (0.7;) DR_0... DR_7. SF12... FSK):
MinDR =0
MaxDR =7
DefDR =0
Rx2DefDR=0 // default receives data rate
Startup: // Start-up behavior first sending in a time slot or random: SlotTime=000 [100ms] // for Var1 + 3 (min. 10 s at OTA; = 0-> OTA 10s ABP s = 2.3)
TimeSlotNr=0000 // Var1: (0 see Var2) 1.. 9999-> OTA: TimeSlotNr * 10 s ABP: TimeSlotNr * 2.3
s RndTime=0010 [m] // Var2: (0 see Var3) 1.. 9999-> randomize 10 s... XXXX * 60s
GrpDevAddr=1024 // Var3: (0 see Var2 with 0060) 1.. 9999-> TimeSlotNr = DevAddr/GrpDevAddr + 1-> Var1
Communication:
ConfirmedTx=0 // send 0 = unconfirmed 1 = confirmed uplinks
LivesignConfirmedTx=1440 [m] // At the latest after this time + ConfirmedTxTimeout send confirmed Tx
uplink ConfirmedTxTimeout=0000 [s] // 0 = send immediate. x = no later than x seconds send
RxConfirmTimeout=0000[s] // 0 = confirm immediately. x = confirm after x seconds
The first uplink can also be forced with button 1. Uplinks varies randomly in the range of 0...2s. LivesignConfirmedTx ensures, at a defined interval, that the uplink is maintained by triggering a confirmed Tx. By means of ConfirmedTxTimeout, an application telegram can also be sent as confirmed if an application telegram is sent in this time window. The Acknowledgment can be terminated by means of the RxConfirmTimeout with the confirmed downlink, so an application response can also contain the acknowledgment during this time (the Ack is sent immediately at 0).
6. AI configuration in CFG. TXT
AI:
SendInterval=0060 [m]
MinSendInterval=0010 [m] (for Sendmethod Delta and Trigger)
MeasureTyp 0:U 0..10000[mV]; 1:I 0..20000[uA]; 2:PT1000 -500..+1500[°C/10] (see Jumper settings)
| Sendmethod 0:Value 1:Data list 2:Mean data list 3:Mean 4:Mean-Min-Max 5:Delta 6:Trigger
| | Measureinterval [m] (0:SendInterval for Sendmethod 1+2 and loop (about 8..16ms) for Sendmethod>2)
| | | Delta
| | | | Lower Trigger
| | | | | Upper
Trigger
AI_1=0;0;0000;0000;00000;00000
AI_2=0;0;0000;0000;00000;00000
Max. 10 values can be saved in the data list, so SendInterval / Measureinterval should be <= 10, otherwise older values will be overwritten by newer ones.
The mean value in the Mean data list is measured in a loop (8ms for 1 channel or 16ms for both channels). Other mean values are measured in the Measureinterval (0 is loop).
The mean value summarizes up to 65535 measurements (about 18 minutes for 2 channels and 9 minutes for one channel) and after 65535 measurements it calculate like this sum= sum-sum/65535+measure.
The Delta, Lower Trigger and Upper Trigger value should be in the Fehler! Verweisquelle konnte nicht gefunden werden. of the corresponding MeasureTyp.
An AI uplink is generated each SendInterval or in case of Sendmethod-Delta or Sendmethod-Trigger additionally on event and expired MinSendInterval. The SendInterval and MinSendInterval are reloaded after each uplink.
7. SW update via USB bootloader
If necessary, the CM1 can be updated using USB DFU:
DFU tool «DFuSe demo» start (link http://www.st.com/en/development-tools/stsw-stm32080.html ).
Click "Choose..." under upgrade or verify action (bottom right) to load the current DFU file.
Take out the battery (turn off device), plug in USB cable with the button pushed and then put the batteries back in (turn on device).
The device should be now in bootloader mode (device appears under «available DFU devices» and both LEDs blink time-shifted every 500ms).
Click «Upgrade» and ignore any messages. The update takes about 2 minutes and 20 seconds.
Once the update is finished, unplug the USB cable, and restart the device (take out batteries, and put them back in).
Important: After having installed the DFU tool, look up the UM0412.pdf file. Before starting with the first update, the driver path must be searched manually (C:\Program files (x 86) \STMicroelectronics\Software\DfuSe v3.0.5\Bin\Driver).
Server Attributes:
valueMax
valueMin
indicatorMax
indicatorMin
At first, connect the Device like in the picture shown: