-
-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setting values is not consitant #180
Comments
Hey, First of all, I'm assuming the characteristic you're writing to is correct and does expect a uint16... A value of 40 as the "SolderingTemp" seems a bit low... Let me know... |
Thanks for the suggestions and ideas. "characteristics": {
"whitelist": [
"00000001-0000-1000-8000-00805f9b34fb",
"00000000-0000-1000-8000-00805f9b34fb"
],
"definitions": {
"00000000-0000-1000-8000-00805f9b34fb": {
"name": "save",
"types": [
"uint16"
]
},
"00000001-0000-1000-8000-00805f9b34fb": {
"name": "temp",
"types": [
"uint16"
]
}
} Unfortunately, this did not change the behavior. I am reasonably confident that the value is a uint16 value , and it can be sent more than once via the Nordic BT app using a uint16 value. Looking through past issues, this one has very similar symptons. Could it be possible that there is some overlap ? Comparing the merged code for the 8bit values, it looks like the code for 16 bit values is correct so i do not quite see what could be going on here,I do find it strange how similar the two issues seem even though the code has been fixed. |
I don't think the problem is with the value being sent, though we can add logs for that to make sure. diff --git a/main/ble.c b/main/ble.c
index e189601..4056bf1 100644
--- a/main/ble.c
+++ b/main/ble.c
@@ -529,8 +529,8 @@ int ble_characteristic_write(mac_addr_t mac, ble_uuid_t service_uuid,
goto Exit;
ble_operation_enqueue(&operation_queue,
- characteristic->properties & CHAR_PROP_WRITE ?
- BLE_OPERATION_TYPE_WRITE : BLE_OPERATION_TYPE_WRITE_NR, device,
+ characteristic->properties & CHAR_PROP_WRITE_NR ?
+ BLE_OPERATION_TYPE_WRITE_NR : BLE_OPERATION_TYPE_WRITE, device,
characteristic, value_len, value);
ret = 0; |
Hey, I tried with the patch. It did not change the issue. |
When it does succeed, does it actually set the value as expected and you see that reflected on the soldering iron, or does success simply mean that it doesn't disconnect? diff --git a/main/ble.c b/main/ble.c
index e189601..aa8058a 100644
--- a/main/ble.c
+++ b/main/ble.c
@@ -169,11 +169,17 @@ static inline void ble_operation_perform(ble_operation_t *operation)
operation->characteristic->handle, ESP_GATT_AUTH_REQ_NONE);
break;
case BLE_OPERATION_TYPE_WRITE:
+ ESP_LOGI(TAG, "Writing to characteristic: " UUID_FMT,
+ UUID_PARAM(operation->characteristic->uuid));
+ ESP_LOG_BUFFER_HEX(TAG, operation->value, operation->len);
esp_ble_gattc_write_char(g_gattc_if, operation->device->conn_id,
operation->characteristic->handle, operation->len, operation->value,
ESP_GATT_WRITE_TYPE_RSP, ESP_GATT_AUTH_REQ_NONE);
break;
case BLE_OPERATION_TYPE_WRITE_NR:
+ ESP_LOGI(TAG, "Writing to (NR) characteristic: " UUID_FMT,
+ UUID_PARAM(operation->characteristic->uuid));
+ ESP_LOG_BUFFER_HEX(TAG, operation->value, operation->len);
esp_ble_gattc_write_char(g_gattc_if, operation->device->conn_id,
operation->characteristic->handle, operation->len, operation->value,
ESP_GATT_WRITE_TYPE_NO_RSP, ESP_GATT_AUTH_REQ_NONE); I looked a bit at the source code you sent, even if we do send garbage over, it will make sure the value is between the minimum and maximum values, not disconnect. |
When you were using ESPHome before, were you able to consistently set the temperature? |
Yeah, that is the strange thing - it worked flawlessly there, I even had a slider setup for it in HA which I could adjust as often as I wanted. This was the ESphome config that worked . Unfortunately as soon as you tried to add all the other settings ESPhome would crash from heap overflow. |
Looking a graph, I don't see a correlation between the "Set Temp" and the "Tip Temp". Why is that? |
Describe the bug
When using the
/Set
prefix , I am able to set values once. On most occasions , when trying to send a second/Set
the BLE side fails. I do have a suspicion that this may be due to the data type formatting ( ??) causing the device to think the message is incomplete, but I am unsure how I can verify this , nor am l I 100% sure if this needs to defined in the config. I have used the same format for sending data as is being reported from the device.To Reproduce
In essence , this is using a standard
/Set
command plus the value. I am using the debug console on MQTT under Home Assitant to send the messages.For testing I am using the same format as the revived packet ( 40,0) to format the data I
/Set
, ie also (40,0). Looking at the source code from the device, I know the data is sent as a uint16 value .Configuration and logs
My config file is as follows:
here is a screen capture of MQTT debug to show the messages and data
Here is the serial log capture of a successful send and a failed send.
failed_Set.txt
success_Set.txt
Additional context
I am happy to provide any further log or info if needed
The text was updated successfully, but these errors were encountered: