René's URL Explorer Experiment


Title: Client subscribing in on_connect,but messages sent on config not received · Issue #2033 · GoogleCloudPlatform/python-docs-samples · GitHub

Open Graph Title: Client subscribing in on_connect,but messages sent on config not received · Issue #2033 · GoogleCloudPlatform/python-docs-samples

X Title: Client subscribing in on_connect,but messages sent on config not received · Issue #2033 · GoogleCloudPlatform/python-docs-samples

Description: Describe the issue In on_connect I'm trying to subscribe to the config topic, but it's not happening for some reason. When I do it in the main() in client.loop_forever() it works but then I'm not able to retreive the persisted messages w...

Open Graph Description: Describe the issue In on_connect I'm trying to subscribe to the config topic, but it's not happening for some reason. When I do it in the main() in client.loop_forever() it works but then I'm not a...

X Description: Describe the issue In on_connect I'm trying to subscribe to the config topic, but it's not happening for some reason. When I do it in the main() in client.loop_forever() it works but then I...

Opengraph URL: https://github.com/GoogleCloudPlatform/python-docs-samples/issues/2033

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Client subscribing in on_connect,but messages sent on config not received ","articleBody":"## Describe the issue\r\nIn on_connect I'm trying to subscribe to the config topic, but it's not happening for some reason. When I do it in the main() in client.loop_forever() it works but then I'm not able to retreive the persisted messages when device re connects. \r\n\r\nBasic code is as given below:\r\n```\r\ndef on_connect(unused_client, unused_userdata, unused_flags, rc):\r\n\t\"\"\"Callback for when a device connects.\"\"\"\r\n\tdevice_id=unused_userdata\r\n\tprint('on_connect', error_str(rc))\r\n\tmqtt_config_topic = '/devices/{}/config'.format(args.device_id)\r\n\tprint('Subscribing to {}'.format(mqtt_config_topic))\r\n\tclient.subscribe(mqtt_config_topic, qos=1)\r\n\r\ndef main():\r\n\tglobal minimum_backoff_time\r\n\targs = parse_command_line_args()\r\n\trun_get(args)\r\n\t# Create our MQTT client. The client_id is a unique string that identifies\r\n\t# this device. For Google Cloud IoT Core, it must be in the format below.\r\n\tclient = mqtt.Client(client_id=(\t'projects/{}/locations/{}/registries/{}/devices/{}'\r\n\t\t\t\t\t.format(args.project_id, args.cloud_region,args.registry_id, args.device_id)), \r\n                                        clean_session=False)\r\n\r\n\t# With Google Cloud IoT Core, the username field is ignored, and the\r\n\t# password field is used to transmit a JWT to authorize the device.\r\n\tclient.username_pw_set(\r\n\t\t\tusername='unused',\r\n\t\t\tpassword=create_jwt(\r\n\t\t\t\t\targs.project_id, args.private_key_file, args.algorithm))\r\n\r\n\t# Enable SSL/TLS support.\r\n\tclient.tls_set(ca_certs=args.ca_certs, tls_version=ssl.PROTOCOL_TLSv1_2)\r\n\r\n\tclient.on_connect = on_connect\r\n\tclient.on_publish = on_publish\r\n\tclient.on_message=on_message\r\n\tclient.on_disconnect = on_disconnect\r\n\r\n\tclient.user_data_set(args.device_id)\r\n\r\n\tclient.connect(args.mqtt_bridge_hostname, args.mqtt_bridge_port)\r\n\ttime.sleep(5)\r\n        client.loop_forever()\r\n\r\n\r\n\r\n```","author":{"url":"https://github.com/ishitar","@type":"Person","name":"ishitar"},"datePublished":"2019-03-07T06:25:11Z","url":"https://github.com/GoogleCloudPlatform/python-docs-samples/issues/2033"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:b8da61f1-75c1-9419-47ca-4ddccd9a1658
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id8592:7F6CC:292D72:37E8B0:6AFE1A49
html-safe-nonced8550d869cef3f756730aef44df8fe96b30bdddaff54993ab5d328d64269873e
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NTkyOjdGNkNDOjI5MkQ3MjozN0U4QjA6NkFGRTFBNDkiLCJ2aXNpdG9yX2lkIjoiOTY4ODE2MTk1NjYwNTUyNzc3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac084823625d2673e9bfe38f9a2bd6f778b31afd955382f21085365c7183265ad7
hovercard-subject-tagissue:418149113
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/GoogleCloudPlatform/python-docs-samples/2033/issue_layout
twitter:imagehttps://opengraph.githubassets.com/243e4c9fa6961a5ae0c7e6c926920674a1196a5b6dbd4e2e14003eb2dfdb440d/GoogleCloudPlatform/python-docs-samples/issues/2033
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/243e4c9fa6961a5ae0c7e6c926920674a1196a5b6dbd4e2e14003eb2dfdb440d/GoogleCloudPlatform/python-docs-samples/issues/2033
og:image:altDescribe the issue In on_connect I'm trying to subscribe to the config topic, but it's not happening for some reason. When I do it in the main() in client.loop_forever() it works but then I'm not a...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameishitar
hostnamegithub.com
expected-hostnamegithub.com
Noned0525ab1464526bf4532a5551aa348cf100dff75ef808a96fc67a08b1d946aa9
turbo-cache-controlno-preview
go-importgithub.com/GoogleCloudPlatform/python-docs-samples git https://github.com/GoogleCloudPlatform/python-docs-samples.git
octolytics-dimension-user_id2810941
octolytics-dimension-user_loginGoogleCloudPlatform
octolytics-dimension-repository_id35065876
octolytics-dimension-repository_nwoGoogleCloudPlatform/python-docs-samples
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id35065876
octolytics-dimension-repository_network_root_nwoGoogleCloudPlatform/python-docs-samples
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasefef3993a71fa20f7be8e167132fbf9619bc66e12
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/GoogleCloudPlatform/python-docs-samples/issues/2033#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FGoogleCloudPlatform%2Fpython-docs-samples%2Fissues%2F2033
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FGoogleCloudPlatform%2Fpython-docs-samples%2Fissues%2F2033
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=GoogleCloudPlatform%2Fpython-docs-samples
Reloadhttps://github.com/GoogleCloudPlatform/python-docs-samples/issues/2033
Reloadhttps://github.com/GoogleCloudPlatform/python-docs-samples/issues/2033
Reloadhttps://github.com/GoogleCloudPlatform/python-docs-samples/issues/2033
GoogleCloudPlatformhttps://github.com/GoogleCloudPlatform
python-docs-sampleshttps://github.com/GoogleCloudPlatform/python-docs-samples
Codehttps://github.com/GoogleCloudPlatform/python-docs-samples
Issues48 (48)https://github.com/GoogleCloudPlatform/python-docs-samples/issues
Pull requests199 (199)https://github.com/GoogleCloudPlatform/python-docs-samples/pulls
Actionshttps://github.com/GoogleCloudPlatform/python-docs-samples/actions
Wikihttps://github.com/GoogleCloudPlatform/python-docs-samples/wiki
Security and qualityhttps://github.com/GoogleCloudPlatform/python-docs-samples/security
Insightshttps://github.com/GoogleCloudPlatform/python-docs-samples/insights
https://github.com/GoogleCloudPlatform/python-docs-samples
New issuehttps://github.com/login?return_to=https://github.com/GoogleCloudPlatform/python-docs-samples/issues/2033
New issuehttps://github.com/login?return_to=https://github.com/GoogleCloudPlatform/python-docs-samples/issues/2033
Client subscribing in on_connect,but messages sent on config not received https://github.com/GoogleCloudPlatform/python-docs-samples/issues/2033#top
https://github.com/ishitar
ishitarhttps://github.com/ishitar
on Mar 7, 2019https://github.com/GoogleCloudPlatform/python-docs-samples/issues/2033#issue-418149113
ishitarhttps://github.com/ishitar
on Mar 7, 2019https://github.com/GoogleCloudPlatform/python-docs-samples/issues/2033#event-2186251173
ishitarhttps://github.com/ishitar
completedhttps://github.com/GoogleCloudPlatform/python-docs-samples/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Mar 7, 2019https://github.com/GoogleCloudPlatform/python-docs-samples/issues/2033#event-2186251568
https://github.com/ishitar
ishitarhttps://github.com/ishitar
on Mar 7, 2019https://github.com/GoogleCloudPlatform/python-docs-samples/issues/2033#issuecomment-470405027
ishitarhttps://github.com/ishitar
on Mar 7, 2019https://github.com/GoogleCloudPlatform/python-docs-samples/issues/2033#event-2186255832
https://github.com/ishitar
ishitarhttps://github.com/ishitar
on Mar 8, 2019https://github.com/GoogleCloudPlatform/python-docs-samples/issues/2033#issuecomment-470814935
ishitarhttps://github.com/ishitar
completedhttps://github.com/GoogleCloudPlatform/python-docs-samples/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Mar 8, 2019https://github.com/GoogleCloudPlatform/python-docs-samples/issues/2033#event-2189249384
Sign up for freehttps://github.com/signup?return_to=https://github.com/GoogleCloudPlatform/python-docs-samples/issues/2033
Sign in to commenthttps://github.com/login?return_to=https://github.com/GoogleCloudPlatform/python-docs-samples/issues/2033
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.