Become a leader in the IoT community!

New DevHeads get a 320-point leaderboard boost when joining the DevHeads IoT Integration Community. In addition to learning and advising, active community leaders are rewarded with community recognition and free tech stuff. Start your Legendary Collaboration now!

Step 1 of 5

CREATE YOUR PROFILE *Required

Change Email
OR
Step 2 of 5

WHAT BRINGS YOU TO DEVHEADS? *Choose 1 or more

Collaboration & Work 🤝
Learn & Grow 📚
Contribute Experience & Expertise 🔧
Step 3 of 5

WHAT'S YOUR INTEREST OR EXPERTISE? *Choose 1 or more

Hardware & Design 💡
Embedded Software 💻
Edge Networking
Step 4 of 5

Personalize your profile

Step 5 of 5

Read & agree to our COMMUNITY RULES

  1. We want this server to be a welcoming space! Treat everyone with respect. Absolutely no harassment, witch hunting, sexism, racism, or hate speech will be tolerated.
  2. If you see something against the rules or something that makes you feel unsafe, let staff know by messaging @admin in the "support-tickets" tab in the Live DevChat menu.
  3. No age-restricted, obscene or NSFW content. This includes text, images, or links featuring nudity, sex, hard violence, or other graphically disturbing content.
  4. No spam. This includes DMing fellow members.
  5. You must be over the age of 18 years old to participate in our community.
  6. Our community uses Answer Overflow to index content on the web. By posting in this channel your messages will be indexed on the worldwide web to help others find answers.
  7. You agree to our Terms of Service (https://www.devheads.io/terms-of-service/) and Privacy Policy (https://www.devheads.io/privacy-policy)
By clicking "Finish", you have read and agreed to the our Terms of Service and Privacy Policy.

How can I make video streaming and robot control work smoothly together in my Flask project?

i am doing project using Flask where I’m streaming video to a website and also have a buttons iicons to control a robot (left and right up and down ..). Both the video streaming and the button works on their own, but I’m struggling to get them to run smoothly together. I need the video stream to stay continuous and responsive while still being able to control the robot without any hiccups , any body have ideas how to do that ?

  1. undefined2001#0000

    you can make a system with esp32 which can talk with the Pc via uart then you can send the degrees of angle for the arm and you can interface with pyserial and flask

  2. wafa_ath#0000

    i already did the streaming and controling , i used pi 3 , but am looking for way to do both in the same time ,

  3. undefined2001#0000

    what was the unusual behaviour if you can be a bit more specific?

  4. wafa_ath#0000

    i don’t want the streaming to stop when i control the robot , i mean i want to do both at the same time , also am controling weels not arm

  5. wafa_ath#0000

    i will share my code

  6. undefined2001#0000

    do you have any idea about `ajax`?

  7. undefined2001#0000

    with ajax you can make http requests without loading the website

  8. undefined2001#0000

    maybe your issue is when you try to control your url changes?

  9. undefined2001#0000

    something like that happens and your stream got interrupted if i’m not wrong?

  10. wafa_ath#0000

    no i didn’t try it before

  11. wafa_ath#0000

    mm no , so it’s like if i run the streaming i can’t control the robot and if i control the robot i can’t run the streaming , am looking to add maybe a library or a code ollow me to do both

  12. wafa_ath#0000

    my code is a bit long to share it here , i will lookfor a way to share it

  13. undefined2001#0000

    can I see your code also how you were sending the data to the wheel

  14. undefined2001#0000

    you can use github gist

  15. wafa_ath#0000

    the vedio over HTTP using Flask and control over HTTP POST requests

  16. wafa_ath#0000

    yes , give me a minute

  17. wafa_ath#0000
  18. undefined2001#0000

    i think I figured out your issue

  19. undefined2001#0000

    so when we make a http request our webpage reloads

  20. undefined2001#0000

    to avoid that please look about ajax

  21. undefined2001#0000
  22. undefined2001#0000

    it is

  23. undefined2001#0000

    ajax just work with html

  24. undefined2001#0000

    so that you can make post requests without reloading the page

  25. undefined2001#0000

    so you just have to add it into your html

  26. wafa_ath#0000

    ow okay i got it

  27. undefined2001#0000

    it’s a Jquery library

  28. wafa_ath#0000

    i was looking for it and i underdtand your idea , i will try it

  29. undefined2001#0000

    let me know if it fixes your problem or we have to look for any other solutions

  30. wafa_ath#0000

    yes , i will thanx

  31. 32bitwidesaviour#0000
  32. wafa_ath#0000

    I found a library call ‘schedule’, for running tasks at specific intervals without blocking other parts of the program , so that means they can run in parallel, what do you think

  33. superbike_z#0000

    That’s just time slicing, to run two things in parallel you would need more than once processor

  34. superbike_z#0000

    Read about parallelism vs concurrency

  35. superbike_z#0000
  36. wafa_ath#0000

    Yes i understand the difference but I’m trying to run both tasks (control and streaming) in a way that feels as simultaneous as possible.

  37. superbike_z#0000

    Ah well then you would run them concurrently not parallel. If you know what your deadlines are you can basically do everything in time and that should satisfy the simultaneous nature of your need.

  38. wafa_ath#0000

    this is the my code after the edit .
    raspberry-pi-camera-control-.py

CONTRIBUTE TO THIS THREAD

Browse other questions tagged