Hi,

So if I understood correctly you want to use microcontroller to connect Django web-app periodically.

One "easy" option would be using HTTP protocol to talk to Django and then use simple RESTful calls to push your data.

Of course that all depends what kind of libraries your microcontroller does have for communication.

If you do not have HTTP protocol luxury but something more primitive, you need to build some kind of middleware server that can understand incoming data from your microcontroller and then push it to Django server.

But there is no easy way to push arbitrary data through TCP socket to Django server directly - Django is mainly build around HTTP request - response cycle.

On 28.03.2015 16:11, bobdxcool wrote:

it's a bit hard to understand what you exactly want to achieve. How can you communicate with the microcontroller? Do you connect to one of its TCP ports, and send it data, I assume. Is it done with a well-known protocol, like HTTP, or some custom one?


*Yes, one of the TCP port on the micro-controller is connected to and data is sent via this to the server.*

You say that it opens a port every 5 seconds to a server. Where is that server? Is it on the same machine as you Django based application? How does the microcontroller and the server communicate with each other?

The server is django based one. I still need to implement the communication part on the server side. Need suggestion on how to do this using TCP sockets.




On Sat, Mar 28, 2015 at 7:20 PM, Gergely Polonkai [via Python] <[hidden email] </user/SendEmail.jtp?type=node&node=5090851&i=0>> wrote:

    Hello,

    it's a bit hard to understand what you exactly want to achieve.
    How can you communicate with the microcontroller? Do you connect
    to one of its TCP ports, and send it data, I assume. Is it done
    with a well-known protocol, like HTTP, or some custom one?

    You say that it opens a port every 5 seconds to a server. Where is
    that server? Is it on the same machine as you Django based
    application? How does the microcontroller and the server
    communicate with each other?

    There are so many architectural questions here before you get to a
    web application, and I'm afraid you original question cannot be
    answered before we see the whole picture.

    Best,
    Gergely

    On 28 Mar 2015 11:06, "bobdxcool" <[hidden email]
    <http:///user/SendEmail.jtp?type=node&node=5090849&i=0>> wrote:

        But is that compatible with django ?

        On Sat, Mar 28, 2015 at 1:24 AM, François Schiettecatte [via
        Python] <[hidden email]
        <http:///user/SendEmail.jtp?type=node&node=5090801&i=0>> wrote:

            Have you looked at the ‘socket’ python library ?

            François

            > On Mar 27, 2015, at 3:05 PM, bobdxcool <[hidden email]
            <http:///user/SendEmail.jtp?type=node&node=5090799&i=0>>
            wrote:
            >
            > I am new to TCP socket programming. I have a django
            based server
            > communicating with a microcontroller. Now, I want to
            implement TCP based
            > socket on the server side in order to communicate with
            the TCP socket on the
            > microcontroller. Can anyone give me an idea on how to do
            this ? What
            > libraries should I use on my django server The
            microprocessor basically
            > opens the socket every 5 seconds and sends a
            notification to the server. I
            > on the server side should be able to read this and pump
            data back to the
            > microprocessor using this socket which was opened by the
            microprocessor.
            >
            >
            >
            > --
            > View this message in context:
            
http://python.6.x6.nabble.com/Django-TCP-Socket-Communication-tp5090792.html
            > Sent from the django-users mailing list archive at
            Nabble.com.
            >
            > --
            > You received this message because you are subscribed to
            the Google Groups "Django users" group.
            > To unsubscribe from this group and stop receiving emails
            from it, send an email to [hidden email]
            <http:///user/SendEmail.jtp?type=node&node=5090799&i=1>.
            > To post to this group, send email to [hidden email]
            <http:///user/SendEmail.jtp?type=node&node=5090799&i=2>.
            > Visit this group at
            http://groups.google.com/group/django-users.
            > To view this discussion on the web visit
            
https://groups.google.com/d/msgid/django-users/1427483125637-5090792.post%40n6.nabble.com.

            > For more options, visit https://groups.google.com/d/optout.
-- You received this message because you are subscribed to
            the Google Groups "Django users" group.
            To unsubscribe from this group and stop receiving emails
            from it, send an email to [hidden email]
            <http:///user/SendEmail.jtp?type=node&node=5090799&i=3>.
            To post to this group, send email to [hidden email]
            <http:///user/SendEmail.jtp?type=node&node=5090799&i=4>.
            Visit this group at
            http://groups.google.com/group/django-users.
            To view this discussion on the web visit
            
https://groups.google.com/d/msgid/django-users/DAE16363-2EEE-4E0F-A230-A31BB270E2F9%40gmail.com.

            For more options, visit https://groups.google.com/d/optout.


            
------------------------------------------------------------------------
            If you reply to this email, your message will be added to
            the discussion below:
            
http://python.6.x6.nabble.com/Django-TCP-Socket-Communication-tp5090792p5090799.html

            To unsubscribe from Django TCP Socket Communication, click
            here.
            NAML
            
<http://python.6.x6.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>




        ------------------------------------------------------------------------
        View this message in context: Re: Django TCP Socket
        Communication
        
<http://python.6.x6.nabble.com/Django-TCP-Socket-Communication-tp5090792p5090801.html>
        Sent from the django-users mailing list archive
        <http://python.6.x6.nabble.com/django-users-f58536.html> at
        Nabble.com.
-- You received this message because you are subscribed to the
        Google Groups "Django users" group.
        To unsubscribe from this group and stop receiving emails from
        it, send an email to [hidden email]
        <http:///user/SendEmail.jtp?type=node&node=5090849&i=1>.
        To post to this group, send email to [hidden email]
        <http:///user/SendEmail.jtp?type=node&node=5090849&i=2>.
        Visit this group at http://groups.google.com/group/django-users.
        To view this discussion on the web visit
        
https://groups.google.com/d/msgid/django-users/CAGpTunuCPXJZo82m1nefz_tvbQJ9Y3-S3en1GZj3aFHsMx7fHg%40mail.gmail.com
        
<https://groups.google.com/d/msgid/django-users/CAGpTunuCPXJZo82m1nefz_tvbQJ9Y3-S3en1GZj3aFHsMx7fHg%40mail.gmail.com?utm_medium=email&utm_source=footer>.
        For more options, visit https://groups.google.com/d/optout.

-- You received this message because you are subscribed to the Google
    Groups "Django users" group.
    To unsubscribe from this group and stop receiving emails from it,
    send an email to [hidden email]
    <http:///user/SendEmail.jtp?type=node&node=5090849&i=3>.
    To post to this group, send email to [hidden email]
    <http:///user/SendEmail.jtp?type=node&node=5090849&i=4>.
    Visit this group at http://groups.google.com/group/django-users.
    To view this discussion on the web visit
    
https://groups.google.com/d/msgid/django-users/CACczBUKgmHjkucnSM4yE2apmFFZOPV6-YdA_R1EgVQybRsvusA%40mail.gmail.com
    
<https://groups.google.com/d/msgid/django-users/CACczBUKgmHjkucnSM4yE2apmFFZOPV6-YdA_R1EgVQybRsvusA%40mail.gmail.com?utm_medium=email&utm_source=footer>.
    For more options, visit https://groups.google.com/d/optout.


    ------------------------------------------------------------------------
    If you reply to this email, your message will be added to the
    discussion below:
    
http://python.6.x6.nabble.com/Django-TCP-Socket-Communication-tp5090792p5090849.html

    To unsubscribe from Django TCP Socket Communication, click here.
    NAML
    
<http://python.6.x6.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>




------------------------------------------------------------------------
View this message in context: Re: Django TCP Socket Communication <http://python.6.x6.nabble.com/Django-TCP-Socket-Communication-tp5090792p5090851.html> Sent from the django-users mailing list archive <http://python.6.x6.nabble.com/django-users-f58536.html> at Nabble.com.
--
You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com <mailto:django-users+unsubscr...@googlegroups.com>. To post to this group, send email to django-users@googlegroups.com <mailto:django-users@googlegroups.com>.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAGpTuntzqwVFUfouUT%2BEvxL1AFvap25KNocQrL5o0xK1EBcJWg%40mail.gmail.com <https://groups.google.com/d/msgid/django-users/CAGpTuntzqwVFUfouUT%2BEvxL1AFvap25KNocQrL5o0xK1EBcJWg%40mail.gmail.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.

--

Jani Tiainen

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/57628EE1.9060001%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to