Dreambox newbie: building a very simple UDP plugin

  • Hi.


    I own 2 DM800HD PVR for quite some time. I am trying to develop a simple plugin to interact with my house's main server to receive various types of notifications.
    I am currently using the message command of the WebInterface but I am starting to need something more personalized and complex.


    I am a very basic programmer and python is surely not my language. I've managed to write a XBMC plugin to suite my needs and I am now trying to do the same for the DM. Unfortunately, I am having a lot of difficulty in finding examples online and most forum discussions are in German :frowning_face:


    I've found this small little doc that teaches the very basics (https://sites.google.com/site/…s/enigma2-plugin-tutorial) which I am sure will help me but it gives a very basic overview.


    So... I am asking for a little push in the right direction. What I would like to do is a simple plugin to receive UDP packets. I'll then parse the packet to my needs.
    I've done this little sketch that should print YES when receives any UDP packet on that port:


    Python
    from Plugins.Plugin import PluginDescriptorfrom Screens.Screen import Screenfrom  ???           import socketdef main(session, **kwargs):	UDP_IP = "127.0.0.1"	UDP_PORT = 7010	UDPsock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)	UDPsock.bind((UDP_IP, UDP_PORT))	while True:		data, addr = UDPsock.recvfrom(1024)		print "\n+++YES!!!+++\n"def Plugins(**kwargs):	return PluginDescriptor(		name="UDP Test",		description="Simple UDP Tester",		where = PluginDescriptor.WHERE_PLUGINMENU,		icon="../app.png",		fnc=main)


    that I haven't even tested because I am most certain it will throw an exception. :loudly_crying_face:
    Is the socket class available?
    How can I make this work?


    Can someone point me to any online examples or tutorials in english?


    Thanks.


    Regards,
    Mike


    P.S. - The code became unformatted, so I am sending ti as an attachment