Own network protocol
Hello! I am just about setting up a project with an Raspberry Pi that is connected to some hardware via its GPIO pins. Reading the data already works perfectly but now I want to distribute it to clients running in the network. Hence, I have to setup a server in Python. I do not want to reinvent the wheel, so I am asking myself whether there is a good practice solution. It should basically work such that once value (can be either binary or an analog value) has changed on the server, it should send the update to the connected clients. At the same time, it should be possible for the client to send a particular request to the server as well, i.e., switch on LED X. What kind of protocol do you recommend for this? UDP or TCP? Do you recommend the use of frameworks such as twisted? Thanks for your input! -- https://mail.python.org/mailman/listinfo/python-list
Re: Own network protocol
pfranke...@gmail.com wrote: > What kind of protocol do you recommend for this? UDP or TCP? Do you > recommend the use of frameworks such as twisted? I don't recommend something as low-level as inventing your own protocol, or as heavy-weight as Twisted. Have you considered a remote-procedure call library like rpyc or pyro? http://rpyc.readthedocs.org/ https://pypi.python.org/pypi/Pyro4 -- Steven -- https://mail.python.org/mailman/listinfo/python-list
Re: Own network protocol
On 2014-12-27 01:56, pfranke...@gmail.com wrote: > I am just about setting up a project with an Raspberry Pi that is > connected to some hardware via its GPIO pins. Reading the data > already works perfectly but now I want to distribute it to clients > running in the network. Hence, I have to setup a server in Python. > > I do not want to reinvent the wheel, so I am asking myself whether > there is a good practice solution. It should basically work such > that once value (can be either binary or an analog value) has > changed on the server, it should send the update to the connected > clients. At the same time, it should be possible for the client to > send a particular request to the server as well, i.e., switch on > LED X. > > What kind of protocol do you recommend for this? UDP or TCP? Do you > recommend the use of frameworks such as twisted? The eventual solution would depend on a variety of factors: - how critical is synchronization? - do clients need to know if they missed a message? (somebody disconnected from the LAN for a moment) - do clients need a way to receive historical messages in the event they were offline during the broadcast? (a power outage knocked out Client #18 at the time of the last update) - are all your clients on the same IP subnet? (you could use a broadcast packet) - would you rather push data as it changes, or have clients poll for the current state? (you write "it should send the update to the connected clients" which suggests a push architecture, yet you also want to have clients able to send updates: "should be possible for the client to send a particular request to the server…i.e., switch on LEX X") - are you concerned about security/authentication? Can a rogue device send a message pretending to be the server? What would/should happen if an unintended client snoops the traffic? Does it matter? The suggestions would look very different if you were just building a hobby notification system as a demo in a contained home/lab/office, vs. if you were building an industrial control system for monitoring a remote location and conveying security info. -tkc -- https://mail.python.org/mailman/listinfo/python-list
Re: smtplib not working as expected
On Sat Dec 27 2014 at 1:23:12 AM Vincent Vande Vyvre < vincent.vande.vy...@telenet.be> wrote: Try with the TLS: Many thanks, working like a charm, code: server = smtplib.SMTP('smtp.mail.ru') server.starttls() server.ehlo() server.login('SENDER EMAIL GOES HERE', 'PASSWD GOES HERE') server.sendmail(fromaddr, toaddrs, msg) server.quit() -- https://mail.python.org/mailman/listinfo/python-list
Re: smtplib not working as expected
On Sat, 27 Dec 2014 02:52:39 +, Juan Christian wrote: > So, I changed the code how you said, but still not working. > Traceback: > > reply: b'550 SMTP is available only with SSL or TLS connection > enabled.\r\n' > reply: retcode (550); Msg: b'SMTP is available only with SSL or TLS > connection enabled.' ^^ have a guess what these messages in the traceback mean. -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list
Re: smtplib not working as expected
On 2014-12-27 14:28, Denis McMahon wrote: > On Sat, 27 Dec 2014 02:52:39 +, Juan Christian wrote: > > reply: b'550 SMTP is available only with SSL or TLS connection > > enabled.\r\n' > > reply: retcode (550); Msg: b'SMTP is available only with SSL or > > TLS connection enabled.' > > ^^ have a guess what these messages in the traceback mean. It means that your SMTP server bytes? ;-) -tkc -- https://mail.python.org/mailman/listinfo/python-list
Re: smtplib not working as expected
Denis it was already resolved, check my message above. ^^ -- https://mail.python.org/mailman/listinfo/python-list
New to PSF
Hey, I'm new to PSF. Can someone please help me in getting started. -- https://mail.python.org/mailman/listinfo/python-list
Re: New to PSF
prateek pandey wrote: > Hey, I'm new to PSF. Can someone please help me in getting started. Can we have some context? What do you mean by PSF? The Python Software Foundation? Something else? -- Steven -- https://mail.python.org/mailman/listinfo/python-list