We have added 2 new REST API methods for streams:
- DELETE /streams/{selector}/messages - to quickly erase buffer with accumulated messages in stream
- POST /streams/{selector}/messages - to manually inject messages into stream buffer
We have added 2 new REST API methods for streams:
We have resolved the issue where two channels at the same hierarchy level were simultaneously processing TCP connections from a single device. Now, when a connection is established to any channel, it will break the existing connection.
We have added a new field to the device called "groups," which contains a list of groups that the device is a member of. The field can be used to select devices based on group name or ID. The field format is as follows:
[
{"id": 1, "name": "group1"},
{"id": 2, "name": "group2"},
]
Examples:
We have improved the response format of the GET gw/channels/{ch-selector}/idents/{idents-selector} method. It now includes the device ID and the last time when this ident was active:
[...{
"channel_id": 123,
"device_id": 321,
"ident": "1234567890123456",
"last_active": 1686040736.261311,
"source": "127.0.0.1:48993"
},...]
The same information is available in the MQTT state. The topic format is: flespi/state/gw/channels/XXX/idents/YYY
We have enhanced the error output for REST requests. The error message now includes the specific field or selector that caused the error.:
GET https://gw.flespi.io/gw/channels/all?fields=xxxx'
{"result":[],"errors":[{"field":"xxxx","reason":"field is not allowed"}]
We have enhanced the webhooks functionality by introducing new features:
HTTP Requests chain: Now, you can send up to 5 sequential HTTP requests for each message. The responses from the finished requests will be available for the subsequent requests.
Requests Validation Expression: Each request includes a validation expression. If the expression fails, several options are available to handle the situation.
We have added warnings to logs if messages from devices contain invalid data or cannot be registered. Such warnings are yellow and mean:
We implemented device media storage. This is a separate storage where flespi telematics hub can automatically place files upon reception from device. Some examples of such files are: images and video data from connected camera, ddd files from connected tachograph and so so on.
Currently all pictures received from devices are automatically placed on this storage and public link to the file is added to the message JSON. To test how it works you may use a channel with telegram protocol.
Stored media data can affect your monthly bill. To control it you may fine-tune media files TTL and media files rotation size settings in device properties:
New REST API methods to control device connections were added:
Get a list of device connections:
HTTP Method: GET
Endpoint: gw/devices/{dev-selector}/connections/{conn-selector}
Example Response:
"result": [
{
"channel_id": XXX,
"meta": null,
"id": 2757994813524,
"source": "127.0.0.1:15659",
"established": 1699447504.38722,
"secondary": false,
"device_id": YYYY,
"ident": "IMEI"
}
]
}
Each connection has its own MQTT topics:
Connection state topic: flespi/state/gw/devices/{device-id}/connections/{conn-id}
Connection counters topic: flespi/state/gw/devices/{device-id}/connections/{conn-id}/counters
{
"bytes_in": 1844,
"bytes_out": 130,
"commands_executed": 3,
"commands_failed": 0,
"errors": 0,
"messages": 9,
"messages_skipped": 0,
"settings_processed": 2,
"warnings": 0
}
Close device connections:
HTTP Method: DELETE
Endpoint: gw/devices/{dev-selector}/connections/{conn-selector}
We implemented a new modem 1NCE that uses the 1NCE API to send SMS to devices
We have expanded the capabilities of the Convert message option in Streams. Now, you can also specify the parameters that will be added to the final message
Scheduled removal of the parameter: image.bin.jpeg.
Date of deletion: February 13, 2024
A while back, we introduced media storage for devices, and all images are now uploaded there before message registration. Thus, messages with images (pictures, camera snapshots) now contain image twice - in old parameter image.bin.jpeg with base64-representation of image file and a direct link to image uploaded to device media storage - in field url of object parameter media.image. Therefore, we have decided to discontinue the old method of storing images, and the image.bin.jpeg parameter will be removed on February 13, 2024.
If you have any questions - don't hesitate to contact us in the flespi support chat.
For all platform elements (devices, channel, webhooks, streams, plugins, etc) we increased duration of logs storage from 30 days up to 1 year.
Now you have 12 times more useful information stored in logs and it’s free!
We have added a traffic viewer button to webhook logs. It displays real incoming and outgoing traffic generated by the webhook. It is convenient for checking traffic while configuring the webhook initially.
Corresponding REST API method:
HTTP Method: GET
Endpoint: platform/webhooks/{webhook-selector}/packets
Example Response:
"result": [
{
"timestamp": 1705405542.523666,
"type": 0,
"conn": 1
},
{
"timestamp": 1705405542.523692,
"type": 3,
"conn": 1,
"data": "UE9TVCAvZ3cvZGV2aWNlcyBIVFRQLzEuMQ0KSG9zdDogMTAuOS4wLjQ2OjkwMDQ...."
}
]
}
Webhooks have become more flexible. Now, it is possible to run an expression to validate the response. Depending on the expression result, it is possible to skip the message or repeat it at intervals.
For example, if your backend returns HTTP codes in the 2XX range, you can validate these codes with the following expression:
adsa
In addition to the webhook's traffic button, we have added a traffic viewer button to plugins logs.
Corresponding REST API method:
HTTP Method: GET
Endpoint: gw/plugins/{plugins-selector}/packets
Example Response:
"result": [
{
"timestamp": 1705405542.523666,
"type": 0,
"conn": 1
},
{
"timestamp": 1705405542.523692,
"type": 3,
"conn": 1,
"data": "UE9TVCAvZ3cvZGV2aWNlcyBIVFRQLzEuMQ0KSG9zdDogMTAuOS4wLjQ2OjkwMDQ...."
}
]
}