I ma having errors when I send packets over Lora, and the problem is that there are packets that are not complete.
In that photo I have a the last packet received correctly with the highlighted text, and the next one is an incomplete packet.
It is possible to “kind of fix it” by changing the protocol. The problem is that when a length exceed, that interface is reseted.
LENGTH 32 16 7 1 “BIG_ENDIAN” 0 nil 10000.
The error can be replicated by using COM ground, sending a dummy packet, and then receive it.
Source of the error
I created a test in which I am receiving data from lora and sending to UART. With the test I realised that THE DATA RECEIVED FROM LORA IS PERFECT, I DONT RECEIVE FRAGMENTATED PACKETS.
Preliminary result v1
After some testing I realised that the problem is frequency of transmission. It should be less than 30 bytes every 2 seconds. The error is being generated when I am transmitting information constinously.
Preliminary result v2
Doing some chages to the UART2TCP I realised that the problem is on the queues. They dont work as expected.
Explaining interface
It looks like this :INTERFACE <%= insisat_openday_target_name %>_INT tcpip_server_interface.rb 8002 8002 10.0 nil LENGTH 32 16 7 1 "BIG_ENDIAN" 0 nil 100
This is:
- LENGTH: PROTOCOL
- 32: Length Bit Offset
- 16: Length Bit Size
- 7: Length Value Offset
- 1: Bytes per Count
- “BIG_ENDIAN”: Length Endianness
- 0: Discard Leading Bytes
- nil: Sync Pattern
- 100: Max Length
I am using the packet as an example: 20 01 c0 00 00 1b 3d 0a 87 40 a4 70 9d 3f 52 b8 9e 3f 00 00 a0 3f ae 47 a1 3f 5c 8f a2 3f 0a d7 a3 3f
- Lenght of the packet: 34 Bytes
- Length field content: 27 Bytes
- Length of the Header (without the 16 bits of the length): 4
- Length of data: 28
- Length of the length = 16 bits = 2 bytes
$$ L_{PACKET} = L_{HEADER} + L_{LENGTH} + L_{DATA} \Rightarrow 34 = 4 + 2 + 28 $$ In that example the packet said the length is 27, that means. C Is content of the variable:
$$ C_{LENGTH} + {Offset} = L_{Packet} \Rightarrow 27 + 7 = 34 $$