Closed aitriago closed 6 months ago
@aitriago this is likely an issue with your Bluetooth device.
Each read command here generally corresponds to a single BLE packet, that normally are usually between 185 up to about 512 bytes. If your payload is exceeding the MTU (maximum transmission unit) that the BLE receiver & BLE device have negotiated, it will be cut off.
You will need to change your peripheral implementation to properly support Long Attribute Reads if you are sending payloads that exceed a single packet. See https://stackoverflow.com/questions/38241986/ble-read-long-characteristics-value-using-android-ios for some discussion about this. But, there's nothing that can be fixed or handled in the plugin for this.
You will need to change your peripheral implementation to properly support Long Attribute Reads if you are sending payloads that exceed a single packet. See https://stackoverflow.com/questions/38241986/ble-read-long-characteristics-value-using-android-ios for some discussion about this. But, there's nothing that can be fixed or handled in the plugin for this.
I agree. Thank you @peitschie!
Describe the bug We read and write a JSON config file to a device using read and write functions. If the file is shorter than 512 bytes, everything runs fine. But then it is longer, in Android devices we get up to 512 bytes.
To Reproduce You will need a device that allows reading/writing capabilities/
Plugin version:
Desktop (please complete the following information):
Smartphone (please complete the following information):
-Devices with the BUG:
Additional context The JSON file we write:
{"wifi": {"ap_pass": "password", "sta_ssid": "Entrepanoles", "sta_pass": "entrepanesq244", "ap_ssid": "tankmont3l3m0"}, "channel": [{"min_level": "10.00", "max_level": "100.00", "chan_label": 1, "type": "RS485|ADC", "name": "Mi tanque grande en el cuarto azul", "min_volt": 0, "idpin": 1, "enable": false, "min_amp": 0, "tank_capacity": "5000.00"}], "info": {"refresh_interval": 30, "model": "XXXXX-S3", "interval": 30, "mcu_id": "3030f959d194", "channels": 1, "url": "https://api.XXXXXXXXX.net/api/v1", "refresh_inerval": 30}}
The JSON file we read:
{"wifi": {"ap_pass": "password", "sta_ssid": "Entrepanoles", "sta_pass": "entrepanesq244", "ap_ssid": "tankmont3l3m0"}, "channel": [{"min_level": "10.00", "max_level": "100.00", "chan_label": 1, "type": "RS485|ADC", "name": "Mi tanque grande en el cuarto azul", "min_volt": 0, "idpin": 1, "enable": false, "min_amp": 0, "tank_capacity": "5000.00"}], "info": {"refresh_interval": 30, "model": "XXXXX-S3", "interval": 30, "mcu_id": "3030f959d194", "channels": 1, "url": "https://api.XXXXXXXXX.net/api/v1", "refresh Add any other context about the problem here.