Weighing Scale & TCP IP connectivity

226 views
Skip to first unread message

ERICK OMONDI AYARA

unread,
Jul 12, 2018, 7:22:33 AM7/12/18
to Django users
Hello, I would like to capture weight from a weighing scale using TCP/Ethernet cable into a django app. If anyone can advice on how to use sockets or any other means to make this work, will be appreciated. Regards

Thomas G Lockhart

unread,
Jul 12, 2018, 3:10:09 PM7/12/18
to django...@googlegroups.com
You can use Django REST framework to get data into Django and a separate Python (or other) program to feed it in. Have the Python program connect to the scale and use whatever mechanisms are required there to get your data.

If the scale has a browser interface, then use urllib to read a page and then use BeautifulSoup to rummage through it and pick out the weight etc. Then push it using json into your REST endpoint.

hth

- Tom


On Jul 11, 2018, at 11:26 PM, ERICK OMONDI AYARA <ayara...@gmail.com> wrote:

Hello, I would like to capture weight from a weighing scale using TCP/Ethernet cable into a django app. If anyone can advice on how to use sockets or any other means to make this work, will be appreciated. Regards

--
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...@googlegroups.com.
To post to this group, send email to django...@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/ee33e49e-67d5-491a-a113-09fbd5290d56%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

mottaz hejaze

unread,
Jul 13, 2018, 7:29:57 AM7/13/18
to django...@googlegroups.com

On Fri, 13 Jul 2018, 11:08 mottaz hejaze, <trapp...@gmail.com> wrote:
you dont need sockets , you can make the weight program scan inputs every n seconds .. or you can program it to be an event hundler to any  change in unputs 

start with weight program , design it the code it . test untill you satisfied .. now you can do the connection with backend in many ways ..

you can make your program connect to the same database that your django has access to it

you can record in csv or json files and send them to django as Tom mentioned maybe try to use django rest for hundling json requests and responses

also you can make the program embedded in your backend django as a module or a script



mottaz hejaze

unread,
Jul 13, 2018, 7:30:05 AM7/13/18
to django...@googlegroups.com
you dont need sockets , you can make the weight program scan inputs every n seconds .. or you can program it to be an event hundler to any  change in unputs 

start with weight program , design it the code it . test untill you satisfied .. now you can do the connection with backend in many ways ..

you can make your program connect to the same database that your django has access to it

you can record in csv or json files and send them to django as Tom mentioned maybe try to use django rest for hundling json requests and responses

also you can make the program embedded in your backend django as a module or a script



On Thu, 12 Jul 2018, 21:09 Thomas G Lockhart, <tlockh...@gmail.com> wrote:
Reply all
Reply to author
Forward
0 new messages