Library xmlrpc.client

Discussion about programs, libraries and tools that work with MicroPython. Mostly these are provided by a third party.
Target audience: All users and developers of MicroPython.
Post Reply
Speedy
Posts: 1
Joined: Sat Feb 27, 2021 7:56 pm

Library xmlrpc.client

Post by Speedy » Sat Feb 27, 2021 8:10 pm

Hello everybody,

in one of my IoT projects, the xmlrpc API is required to query the status of one of the devices. This works wonderfully under python:

import xmlrpc.client as xc
server = xc.Server(url)

However, I cannot find the xmlrpc library under micropython. Does anyone have any idea how I could get on here? I use the esp32.

SpotlightKid
Posts: 463
Joined: Wed Apr 08, 2015 5:19 am

Re: Library xmlrpc.client

Post by SpotlightKid » Thu May 20, 2021 10:48 pm

To my knowledge, nobody has written an xmlrpc client library for MicroPython. So you would have to write one yourself. This should be possible, since MicroPython provides all the necessary ingredients, most importantly network sockets. But it doesn't have an XML generation or parsing library, because that could potentially grow very complex and big, so it's not an easy task.

It would be much easier if you would be able to use another RPC mechanism, e.g. JSON-RPC or just simple REST HTTP calls.

A workaround would be to write a short protocol translation server, which runs a machine, which can run CPython. This would talk xmlrpc to the device you want to query and provide the queried data in some other form, e.g. publishing it to a MQTT broker or via a web server.

Post Reply