ESPNOW2MQTT
ESPNOW2MQTT copied to clipboard
Adding an ESP-NOW module to the bridge
Hi, I am asking for your help. I have the ESPNOW2MQTT bridge working in platformIO using the latest Arduino 2.4.3 and espressif32 v3.2. It compiled and runs fine, I am also using ArduinoJson v7 and after a few tweaks everything seems to work fine. However, for the life of me I cannot get the 'bridge' to respond to any ESP-NOW input. Whilst the MQTT side of things is explained very well, I am not clear on how a 'sending' device using ESP-NOW should be coded. Do you have any example code you could share please? If I may make a suggestion i think an example code for an ESP-NOW device using, say, a sensor (BME280 maybe) could be coded to send the data to the bridge and then onward by MQTT.
I do hope you can help
Bob
Hi Bob, first of all very sorry for the late reply, I did not get email from Github for some reason. There is no coding required on Sender side. The gateway can pretty much catch any ESP Now message (JSON or Binary) and send it to MQTT. For the humidity sensor for example just construct a Json message and it will be passed as is on as is. Example: {"encoding":"JSON","data":"{'humidity':59.26}","device_mac":"b4:e6:2d:97:f6:51","protocol":"ESPNOW"}
Hi Subrata, I will have to go back to the project and check it out. Thank you for the example. Is the example code you shared contained in a ESP-Now message? The code example seems to include all information needed but the part on how it is actually sent is the bit I am unclear about.
Bob
From: Subrata Dey @.> Sent: 20 March 2025 13:37 To: insane2subro/ESPNOW2MQTT @.> Cc: bobcroft @.>; Author @.> Subject: Re: [insane2subro/ESPNOW2MQTT] Adding an ESP-NOW module to the bridge (Issue #1)
Hi Bob, first of all very sorry for the late reply. There is no coding required on Sender side. The gateway can pretty much catch any ESP Now message (JSON or Binary) and send it to MQTT. I have about 10 devices and all in different formats sending messages to my homeassistant MQTT Server.
— Reply to this email directly, view it on GitHubhttps://github.com/insane2subro/ESPNOW2MQTT/issues/1#issuecomment-2740485790, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAVDXIUW6PDKCPRHXZHJQZT2VLABFAVCNFSM6AAAAABUI7C536VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDONBQGQ4DKNZZGA. You are receiving this because you authored the thread.Message ID: @.***> [Image removed by sender. insane2subro]insane2subro left a comment (insane2subro/ESPNOW2MQTT#1)https://github.com/insane2subro/ESPNOW2MQTT/issues/1#issuecomment-2740485790
Hi Bob, first of all very sorry for the late reply. There is no coding required on Sender side. The gateway can pretty much catch any ESP Now message (JSON or Binary) and send it to MQTT. I have about 10 devices and all in different formats sending messages to my homeassistant MQTT Server.
— Reply to this email directly, view it on GitHubhttps://github.com/insane2subro/ESPNOW2MQTT/issues/1#issuecomment-2740485790, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAVDXIUW6PDKCPRHXZHJQZT2VLABFAVCNFSM6AAAAABUI7C536VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDONBQGQ4DKNZZGA. You are receiving this because you authored the thread.Message ID: @.***>
Hi Bob, agnostic of any format you send, raw, binary or json the gateway will format is and send it via MQTT. Say I send this via ESPNow: {"b":90,"a":1}, the gateway will catch it and send it to MQTT on espnow/incoming/ channel as {"b":90,"a":1,"encoding":"json","device_mac":"a8:c9:a3:38:07:81","protocol":"ESPNOW"}. Hope this clarifies.
Hi,
Thank you for the update. I’ll try it out.
Bob
From: Subrata Dey @.> Sent: 29 March 2025 02:37 To: insane2subro/ESPNOW2MQTT @.> Cc: bobcroft @.>; Author @.> Subject: Re: [insane2subro/ESPNOW2MQTT] Adding an ESP-NOW module to the bridge (Issue #1)
Hi Bob, agnostic of any format you send, raw, binary or json the gateway will format is and send it via MQTT. Say I send this via ESPNow: {"b":90,"a":1}, the gateway will catch it and send it to MQTT on espnow/incoming/ channel as {"b":90,"a":1,"encoding":"json","device_mac":"a8:c9:a3:38:07:81","protocol":"ESPNOW"}. Hope this clarifies.
— Reply to this email directly, view it on GitHub https://github.com/insane2subro/ESPNOW2MQTT/issues/1#issuecomment-2763035915 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AAVDXIU7QRC5VFF4FHBGV432WYBNTAVCNFSM6AAAAABUI7C536VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDONRTGAZTKOJRGU . You are receiving this because you authored the thread. https://github.com/notifications/beacon/AAVDXIQ7AWWLUQJJJGPVWG32WYBNTA5CNFSM6AAAAABUI7C536WGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTVEWCKQW.gif Message ID: @.*** @.***> >
https://avatars.githubusercontent.com/u/1000735?s=20&v=4 insane2subro left a comment (insane2subro/ESPNOW2MQTT#1) https://github.com/insane2subro/ESPNOW2MQTT/issues/1#issuecomment-2763035915
Hi Bob, agnostic of any format you send, raw, binary or json the gateway will format is and send it via MQTT. Say I send this via ESPNow: {"b":90,"a":1}, the gateway will catch it and send it to MQTT on espnow/incoming/ channel as {"b":90,"a":1,"encoding":"json","device_mac":"a8:c9:a3:38:07:81","protocol":"ESPNOW"}. Hope this clarifies.
— Reply to this email directly, view it on GitHub https://github.com/insane2subro/ESPNOW2MQTT/issues/1#issuecomment-2763035915 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AAVDXIU7QRC5VFF4FHBGV432WYBNTAVCNFSM6AAAAABUI7C536VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDONRTGAZTKOJRGU . You are receiving this because you authored the thread. https://github.com/notifications/beacon/AAVDXIQ7AWWLUQJJJGPVWG32WYBNTA5CNFSM6AAAAABUI7C536WGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTVEWCKQW.gif Message ID: @.*** @.***> >