{"id":6376,"date":"2023-01-10T14:02:21","date_gmt":"2023-01-10T14:02:21","guid":{"rendered":"https:\/\/profen.com\/?p=6376"},"modified":"2026-04-06T10:00:32","modified_gmt":"2026-04-06T10:00:32","slug":"convert-ocpp-payloads-to-mqtt","status":"publish","type":"post","link":"https:\/\/profen.com\/en\/convert-ocpp-payloads-to-mqtt\/","title":{"rendered":"Convert OCPP Payloads To MQTT"},"content":{"rendered":"<div class=\"wpb-content-wrapper\"><p>[vc_row][vc_column][vc_column_text]<\/p>\n<h1>Most of the IOT platforms do not support OCPP protocol unfortunately. But you can still implement IOT connectivity for those devices with the power of python. As seen in the example below a small python gateway implement to convert OCPP message payload to MQTT.<\/h1>\n<p>`import paho.mqtt.client as mqtt<\/p>\n<h3>Define a function to handle incoming OCPP messages<\/h3>\n<p>def handle_ocpp_message(message):<br \/>\n# Extract the OCPP message payload<br \/>\npayload = message[\u2018payload\u2019]<\/p>\n<p># Convert the OCPP message to a MQTT message<br \/>\nmqtt_message = {<br \/>\n\u2018topic\u2019: \u2018ocpp\/message\u2019,<br \/>\n\u2018payload\u2019: payload,<br \/>\n\u2018qos\u2019: 0,<br \/>\n\u2018retain\u2019: False<br \/>\n}<\/p>\n<p># Publish the MQTT message<br \/>\nmqtt_client.publish(mqtt_message)<\/p>\n<h3>Create an MQTT client<\/h3>\n<p>mqtt_client = mqtt.Client()<\/p>\n<h3>Connect the MQTT client to the MQTT broker<\/h3>\n<p>mqtt_client.connect(\u2018localhost\u2019, 1883)<\/p>\n<h3>Start listening for OCPP messages<\/h3>\n<p>ocpp_client.on_message = handle_ocpp_message<br \/>\nocpp_client.listen()`[\/vc_column_text][vc_single_image image=&#8221;6377&#8243; img_size=&#8221;full&#8221;][\/vc_column][\/vc_row]<\/p>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>[vc_row][vc_column][vc_column_text] Most of the IOT platforms do not support OCPP protocol unfortunately. But you can still implement IOT connectivity for [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":6379,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_vp_format_video_url":"","_vp_image_focal_point":[],"footnotes":""},"categories":[28,72],"tags":[],"class_list":["post-6376","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog","category-rd-corner"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Profen Group - Convert OCPP Payloads To MQTT<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/profen.com\/en\/convert-ocpp-payloads-to-mqtt\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Profen Group - Convert OCPP Payloads To MQTT\" \/>\n<meta property=\"og:description\" content=\"[vc_row][vc_column][vc_column_text] Most of the IOT platforms do not support OCPP protocol unfortunately. But you can still implement IOT connectivity for [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/profen.com\/en\/convert-ocpp-payloads-to-mqtt\/\" \/>\n<meta property=\"og:site_name\" content=\"Profen Group\" \/>\n<meta property=\"article:published_time\" content=\"2023-01-10T14:02:21+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-04-06T10:00:32+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/profen.com\/wp-content\/uploads\/2023\/01\/OCPP-768x524-1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"768\" \/>\n\t<meta property=\"og:image:height\" content=\"524\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"sadmin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"sadmin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/profen.com\\\/en\\\/convert-ocpp-payloads-to-mqtt\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/profen.com\\\/en\\\/convert-ocpp-payloads-to-mqtt\\\/\"},\"author\":{\"name\":\"sadmin\",\"@id\":\"https:\\\/\\\/profen.com\\\/#\\\/schema\\\/person\\\/86dbf5f3ab018ab588aaaa7d3edba0c3\"},\"headline\":\"Convert OCPP Payloads To MQTT\",\"datePublished\":\"2023-01-10T14:02:21+00:00\",\"dateModified\":\"2026-04-06T10:00:32+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/profen.com\\\/en\\\/convert-ocpp-payloads-to-mqtt\\\/\"},\"wordCount\":159,\"image\":{\"@id\":\"https:\\\/\\\/profen.com\\\/en\\\/convert-ocpp-payloads-to-mqtt\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/profen.com\\\/wp-content\\\/uploads\\\/2023\\\/01\\\/OCPP-768x524-1.png\",\"articleSection\":[\"Blog\",\"R&amp;D Corner\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/profen.com\\\/en\\\/convert-ocpp-payloads-to-mqtt\\\/\",\"url\":\"https:\\\/\\\/profen.com\\\/en\\\/convert-ocpp-payloads-to-mqtt\\\/\",\"name\":\"Profen Group - Convert OCPP Payloads To MQTT\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/profen.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/profen.com\\\/en\\\/convert-ocpp-payloads-to-mqtt\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/profen.com\\\/en\\\/convert-ocpp-payloads-to-mqtt\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/profen.com\\\/wp-content\\\/uploads\\\/2023\\\/01\\\/OCPP-768x524-1.png\",\"datePublished\":\"2023-01-10T14:02:21+00:00\",\"dateModified\":\"2026-04-06T10:00:32+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/profen.com\\\/#\\\/schema\\\/person\\\/86dbf5f3ab018ab588aaaa7d3edba0c3\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/profen.com\\\/en\\\/convert-ocpp-payloads-to-mqtt\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/profen.com\\\/en\\\/convert-ocpp-payloads-to-mqtt\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/profen.com\\\/en\\\/convert-ocpp-payloads-to-mqtt\\\/#primaryimage\",\"url\":\"https:\\\/\\\/profen.com\\\/wp-content\\\/uploads\\\/2023\\\/01\\\/OCPP-768x524-1.png\",\"contentUrl\":\"https:\\\/\\\/profen.com\\\/wp-content\\\/uploads\\\/2023\\\/01\\\/OCPP-768x524-1.png\",\"width\":768,\"height\":524},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/profen.com\\\/en\\\/convert-ocpp-payloads-to-mqtt\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Ana sayfa\",\"item\":\"https:\\\/\\\/profen.com\\\/en\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Convert OCPP Payloads To MQTT\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/profen.com\\\/#website\",\"url\":\"https:\\\/\\\/profen.com\\\/\",\"name\":\"Profen Group\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/profen.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/profen.com\\\/#\\\/schema\\\/person\\\/86dbf5f3ab018ab588aaaa7d3edba0c3\",\"name\":\"sadmin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/00c64138ebc26cf37194efae2aec1547784f5a0a83d6adb10a4f29caff9372ea?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/00c64138ebc26cf37194efae2aec1547784f5a0a83d6adb10a4f29caff9372ea?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/00c64138ebc26cf37194efae2aec1547784f5a0a83d6adb10a4f29caff9372ea?s=96&d=mm&r=g\",\"caption\":\"sadmin\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Profen Group - Convert OCPP Payloads To MQTT","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/profen.com\/en\/convert-ocpp-payloads-to-mqtt\/","og_locale":"en_US","og_type":"article","og_title":"Profen Group - Convert OCPP Payloads To MQTT","og_description":"[vc_row][vc_column][vc_column_text] Most of the IOT platforms do not support OCPP protocol unfortunately. But you can still implement IOT connectivity for [&hellip;]","og_url":"https:\/\/profen.com\/en\/convert-ocpp-payloads-to-mqtt\/","og_site_name":"Profen Group","article_published_time":"2023-01-10T14:02:21+00:00","article_modified_time":"2026-04-06T10:00:32+00:00","og_image":[{"width":768,"height":524,"url":"https:\/\/profen.com\/wp-content\/uploads\/2023\/01\/OCPP-768x524-1.png","type":"image\/png"}],"author":"sadmin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"sadmin","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/profen.com\/en\/convert-ocpp-payloads-to-mqtt\/#article","isPartOf":{"@id":"https:\/\/profen.com\/en\/convert-ocpp-payloads-to-mqtt\/"},"author":{"name":"sadmin","@id":"https:\/\/profen.com\/#\/schema\/person\/86dbf5f3ab018ab588aaaa7d3edba0c3"},"headline":"Convert OCPP Payloads To MQTT","datePublished":"2023-01-10T14:02:21+00:00","dateModified":"2026-04-06T10:00:32+00:00","mainEntityOfPage":{"@id":"https:\/\/profen.com\/en\/convert-ocpp-payloads-to-mqtt\/"},"wordCount":159,"image":{"@id":"https:\/\/profen.com\/en\/convert-ocpp-payloads-to-mqtt\/#primaryimage"},"thumbnailUrl":"https:\/\/profen.com\/wp-content\/uploads\/2023\/01\/OCPP-768x524-1.png","articleSection":["Blog","R&amp;D Corner"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/profen.com\/en\/convert-ocpp-payloads-to-mqtt\/","url":"https:\/\/profen.com\/en\/convert-ocpp-payloads-to-mqtt\/","name":"Profen Group - Convert OCPP Payloads To MQTT","isPartOf":{"@id":"https:\/\/profen.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/profen.com\/en\/convert-ocpp-payloads-to-mqtt\/#primaryimage"},"image":{"@id":"https:\/\/profen.com\/en\/convert-ocpp-payloads-to-mqtt\/#primaryimage"},"thumbnailUrl":"https:\/\/profen.com\/wp-content\/uploads\/2023\/01\/OCPP-768x524-1.png","datePublished":"2023-01-10T14:02:21+00:00","dateModified":"2026-04-06T10:00:32+00:00","author":{"@id":"https:\/\/profen.com\/#\/schema\/person\/86dbf5f3ab018ab588aaaa7d3edba0c3"},"breadcrumb":{"@id":"https:\/\/profen.com\/en\/convert-ocpp-payloads-to-mqtt\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/profen.com\/en\/convert-ocpp-payloads-to-mqtt\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/profen.com\/en\/convert-ocpp-payloads-to-mqtt\/#primaryimage","url":"https:\/\/profen.com\/wp-content\/uploads\/2023\/01\/OCPP-768x524-1.png","contentUrl":"https:\/\/profen.com\/wp-content\/uploads\/2023\/01\/OCPP-768x524-1.png","width":768,"height":524},{"@type":"BreadcrumbList","@id":"https:\/\/profen.com\/en\/convert-ocpp-payloads-to-mqtt\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Ana sayfa","item":"https:\/\/profen.com\/en\/"},{"@type":"ListItem","position":2,"name":"Convert OCPP Payloads To MQTT"}]},{"@type":"WebSite","@id":"https:\/\/profen.com\/#website","url":"https:\/\/profen.com\/","name":"Profen Group","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/profen.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/profen.com\/#\/schema\/person\/86dbf5f3ab018ab588aaaa7d3edba0c3","name":"sadmin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/00c64138ebc26cf37194efae2aec1547784f5a0a83d6adb10a4f29caff9372ea?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/00c64138ebc26cf37194efae2aec1547784f5a0a83d6adb10a4f29caff9372ea?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/00c64138ebc26cf37194efae2aec1547784f5a0a83d6adb10a4f29caff9372ea?s=96&d=mm&r=g","caption":"sadmin"}}]}},"_links":{"self":[{"href":"https:\/\/profen.com\/en\/wp-json\/wp\/v2\/posts\/6376","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/profen.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/profen.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/profen.com\/en\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/profen.com\/en\/wp-json\/wp\/v2\/comments?post=6376"}],"version-history":[{"count":4,"href":"https:\/\/profen.com\/en\/wp-json\/wp\/v2\/posts\/6376\/revisions"}],"predecessor-version":[{"id":6404,"href":"https:\/\/profen.com\/en\/wp-json\/wp\/v2\/posts\/6376\/revisions\/6404"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/profen.com\/en\/wp-json\/wp\/v2\/media\/6379"}],"wp:attachment":[{"href":"https:\/\/profen.com\/en\/wp-json\/wp\/v2\/media?parent=6376"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/profen.com\/en\/wp-json\/wp\/v2\/categories?post=6376"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/profen.com\/en\/wp-json\/wp\/v2\/tags?post=6376"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}