Update to 0.97 via mqtt

Hi i have piligth on my esp and now i want to update to 0.97 from 0.96 it was uploadret via arduino
but now i cant compile it too many eroors :confused: so i try to use :
mosquitto_pub -t “home/OpenMQTTGateway2/commands/firmware_update” -m '{ “version”: “test”, “password”: “OTAPASSWORD”, “url”: “https://github.com/1technophile/OpenMQTTGateway/releases/download/v0.9.7/esp32dev-pilight-firmware.bin” }
but nothing happend is it possible to OTA like this ? or is there a way to change gpio via mqtt on 12 i cant use RF it onlu work on 16 … so its only change i need

Hi,

The ota update via mqtt is available from v0.9.7, so for updating your current installation you need either to OTA with platformio or Arduino IDE or to upload a binary/build.

What are the errors that you are encountering ? I advise to use platformio.

ok i have to redownload all libs and now it looks ok :smiley:
just one thing on mqtt i see : “version”:“version_tag” not 0.97 like b4. but i think i shulld set it somewhere

1 Like

Yes, when building yourself you can set it here

1 Like

I’m trying to update via mqtt from 0.98 and can’t get any response although tried various combinations with and without server cert, so assume I’m not formatting the message correctly. Can you paste a sample command? Is the version tag meant to be “v0.9.11”, for example?

It should work with the example in the docs, you can enter “test” for the version.

Tried again with the exact syntax in the docs, just changing to the 0.9.11 path, but can’t see any reaction

Do you have a way to share the logs from the serial monitor or is it inaccessible?

Joined to post to this thread. I’m running into the same problem but not sure what to do. I was running 0.95 and wiped & installed 0.9.10 and all is well. I’m trying to update via MQTT to 0.9.12 but like the OP, I’m positive I have the MQTT message ingested correctly but nothing happens.

I googled the forum here, github, etc – I’m at a loss. I can provide logs if wanted, but I haven’t come across any documentation on how to get the serial console working. Maybe I’m searching in the wrong places?

Using an Olimex unit recommended in the forums (esp32-olimex-gtw-ble-wifi)

{"uptime":143046,"version":"v0.9.10","freemem":129168,"mqttport":"1883","mqttsecure":false,"freestack":1740,"rssi":-31,"SSID":"SSID","ip":"192.x.x.x","mac":"xx:xx:xx:xx:xx:xx","lowpowermode":0,"btqblck":378,"btqsum":42434,"btqsnd":36490,"btqavg":1.162894,"interval":55555,"scanbcnct":10,"scnct":2181,"modules":["BT"]}

I was able to get the serial console working via Arduino IDE (+drivers) and I saw this when sending the MQTT request:

N: [ MQTT->OMG ]: {"version":"test","password":"OTAPASSWORD","url":"https://github.com/1technophile/OpenMQTTGateway/releases/download/v0.9.12/esp32-olimex-gtw-ble-wifi-firmware.bin"}
W: Starting firmware update
N: Stop BLE processing
E: using config cert
[E][ssl_client.cpp:36] _handle_error(): [start_ssl_client():216]: (-9984) X509 - Certificate verification failed, e.g. CRL, CA or signature check failed
[E][WiFiClientSecure.cpp:133] connect(): start_ssl_client: -9984
[E][zzHTTPUpdate.cpp:212] handleUpdate(): HTTP error: connection refused

E: HTTP_UPDATE_FAILED Error (-1): HTTP error: connection refused

N: Start BLE processing

Documentation that I found (github ticket) shows the cert being added but where do I get the certificate base64 from? Found here: System commands (ESP only) | OpenMQTTGateway v0.9.12

EDIT: Found user_config.h in github, copied the cert there and published to MQTT, same error:

{
  "version": "test",
  "password": "OTAPASSWORD",
  "url": "https://github.com/1technophile/OpenMQTTGateway/releases/download/v0.9.12/esp32-olimex-gtw-ble-wifi-firmware.bin",
  "server_cert": "-----BEGIN CERTIFICATE-----
MIIDxTCCAq2gAwIBAgIQAqxcJmoLQJuPC3nyrkYldzANBgkqhkiG9w0BAQUFADBs
MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
d3cuZGlnaWNlcnQuY29tMSswKQYDVQQDEyJEaWdpQ2VydCBIaWdoIEFzc3VyYW5j
ZSBFViBSb290IENBMB4XDTA2MTExMDAwMDAwMFoXDTMxMTExMDAwMDAwMFowbDEL
MAkGA1UEBhMCVVMxFTATBgNVBAoTDERpZ2lDZXJ0IEluYzEZMBcGA1UECxMQd3d3
LmRpZ2ljZXJ0LmNvbTErMCkGA1UEAxMiRGlnaUNlcnQgSGlnaCBBc3N1cmFuY2Ug
RVYgUm9vdCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMbM5XPm
+9S75S0tMqbf5YE/yc0lSbZxKsPVlDRnogocsF9ppkCxxLeyj9CYpKlBWTrT3JTW
PNt0OKRKzE0lgvdKpVMSOO7zSW1xkX5jtqumX8OkhPhPYlG++MXs2ziS4wblCJEM
xChBVfvLWokVfnHoNb9Ncgk9vjo4UFt3MRuNs8ckRZqnrG0AFFoEt7oT61EKmEFB
Ik5lYYeBQVCmeVyJ3hlKV9Uu5l0cUyx+mM0aBhakaHPQNAQTXKFx01p8VdteZOE3
hzBWBOURtCmAEvF5OYiiAhF8J2a3iLd48soKqDirCmTCv2ZdlYTBoSUeh10aUAsg
EsxBu24LUTi4S8sCAwEAAaNjMGEwDgYDVR0PAQH/BAQDAgGGMA8GA1UdEwEB/wQF
MAMBAf8wHQYDVR0OBBYEFLE+w2kD+L9HAdSYJhoIAu9jZCvDMB8GA1UdIwQYMBaA
FLE+w2kD+L9HAdSYJhoIAu9jZCvDMA0GCSqGSIb3DQEBBQUAA4IBAQAcGgaX3Nec
nzyIZgYIVyHbIUf4KmeqvxgydkAQV8GK83rZEWWONfqe/EW1ntlMMUu4kehDLI6z
eM7b41N5cdblIZQB2lWHmiRk9opmzN6cN82oNLFpmyPInngiK3BD41VHMWEZ71jF
hS9OMPagMRYjyOfiZRYzy78aG6A9+MpeizGLYAiJLQwGXFK3xPkKmNEVX58Svnw2
Yzi9RKR/5CYrCsSXaQ3pjOLAEFe4yHYSkVXySGnYvCoCWw9E1CAx2/S6cCZdkGCe
vEsXCS+0yx5DaMkHJ8HSXPfqIbloEpw8nL+e/IBcm2PN7EeqJSdnoDfzAIJ9VNep
+OkuE6N36B9K
-----END CERTIFICATE-----"
}

Can you try with the certificate from below:

1 Like

100% worked. I already had used the web-browser update w/o erasing flash to upgrade to 0.9.12 but used the cert above via MQTT and it updated to 0.9.12 and kept my configuration.

N: [ MQTT->OMG ]: {"version":"test","password":"OTAPASSWORD","url":"https://github.com/1technophile/OpenMQTTGateway/releases/download/v0.9.12/esp32-olimex-gtw-ble-wifi-firmware.bin","server_cert":"-----BEG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jcKChzUyImZOMkXDiqw8cvpOp/2PV5Adg\r\n06O/nVsJ8dWO41P0jmP6P6fbtGbfYmbW0W5BjfIttep3Sp+dWOIrWcBAI+0tKIJF\r\nPnlUkiaY4IBIqDfv8NZ5YBberOgOzW6sRBc4L0na4UU+Krk2U886UAb3LujEV0ls\r\nYSEY1QSteDwsOoBrp+uvFRTp2InBuThs4pFsiv9kuXclVzDAGySj4dzp30d8tbQk\r\nCAUw7C29C79Fv1C5qfPrmAESrciIxpg0X40KPMbp1ZWVbd4=\r\n-----END CERTIFICATE-----"}
W: Starting firmware update
N: Stop BLE processing
N: HTTP_UPDATE_OK
{
  "mqtt_server": "192.x.x.x",
  "mqtt_port": "1883",
  "mqtt_user": "username",
  "mqtt_pass": "password",
  "mqtt_topic": "home/",
  "gateway_name": "OpenMQTTGateway_ESP32_OLM_GTWW",
  "mqtt_broker_secure": false,
  "mqtt_broker_cert": "",
  "mqtt_ss_index": 0,
  "ota_server_cert": "-----BEGIN CERTIFICATE-----\r\nMIIDrzCCApegAwIBAgIQCDvgVpBCRrGhdWrJWZHHSjANBgkqhkiG9w0BAQUFADBh\r\nMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3\r\nd3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBD\r\nQTAeFw0wNjExMTAwMDAwMDBaFw0zMTExMTAwMDAwMDBaMGExCzAJBgNVBAYTAlVT\r\nMRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5j\r\nb20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IENBMIIBIjANBgkqhkiG\r\n9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4jvhEXLeqKTTo1eqUKKPC3eQyaKl7hLOllsB\r\nCSDMAZOnTjC3U/dDxGkAV53ijSLdhwZAAIEJzs4bg7/fzTtxRuLWZscFs3YnFo97\r\nnh6Vfe63SKMI2tavegw5BmV/Sl0fvBf4q77uKNd0f3p4mVmFaG5cIzJLv07A6Fpt\r\n43C/dxC//AH2hdmoRBBYMql1GNXRor5H4idq9Joz+EkIYIvUX7Q6hL+hqkpMfT7P\r\nT19sdl6gSzeRntwi5m3OFBqOasv+zbMUZBfHWymeMr/y7vrTC0LUq7dBMtoM1O/4\r\ngdW7jVg/tRvoSSiicNoxBN33shbyTApOB6jtSj1etX+jkMOvJwIDAQABo2MwYTAO\r\nBgNVHQ8BAf8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUA95QNVbR\r\nTLtm8KPiGxvDl7I90VUwHwYDVR0jBBgwFoAUA95QNVbRTLtm8KPiGxvDl7I90VUw\r\nDQYJKoZIhvcNAQEFBQADggEBAMucN6pIExIK+t1EnE9SsPTfrgT1eXkIoyQY/Esr\r\nhMAtudXH/vTBH1jLuG2cenTnmCmrEbXjcKChzUyImZOMkXDiqw8cvpOp/2PV5Adg\r\n06O/nVsJ8dWO41P0jmP6P6fbtGbfYmbW0W5BjfIttep3Sp+dWOIrWcBAI+0tKIJF\r\nPnlUkiaY4IBIqDfv8NZ5YBberOgOzW6sRBc4L0na4UU+Krk2U886UAb3LujEV0ls\r\nYSEY1QSteDwsOoBrp+uvFRTp2InBuThs4pFsiv9kuXclVzDAGySj4dzp30d8tbQk\r\nCAUw7C29C79Fv1C5qfPrmAESrciIxpg0X40KPMbp1ZWVbd4=\r\n-----END CERTIFICATE-----"
}ets Jun  8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x1b (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:1184
load:0x40078000,len:12812
load:0x40080400,len:3032
entry 0x400805e4
N: 
************* WELCOME TO OpenMQTTGateway **************
N: OpenMQTTGateway Version: v0.9.12
1 Like