Go to advanced search

by mesand
Tue May 05, 2020 7:56 pm
Forum: General discussion
Topic: Time lapse/live stream with remote webserver
Replies: 0
Views: 49

Time lapse/live stream with remote webserver

Hi all, I am new to this topic. I have a remote flask webserver connected to a raspberry pi that communicates via mqtt. I would like to incorporate sending time lapse (every day or week) to the app to be seen by me the user. I am wondering how I would go about doing this. So far I am thinking of sen...
by mesand
Mon May 04, 2020 5:54 pm
Forum: General discussion
Topic: Tips on Soldering Pi Breakout Board/nano to Perfboard
Replies: 0
Views: 63

Tips on Soldering Pi Breakout Board/nano to Perfboard

Hi all, I am relatively new to working with electronics. I have a breadboarded circuit. The circuit is very basic. It has a breakout board for a Raspberry Pi 3b+ attached to a breadboard and an arduino nano. The Nano reads data from some sensors and has a couple resistors. The Pi breakout board cont...
by mesand
Tue Apr 21, 2020 3:08 pm
Forum: General discussion
Topic: How to run concurrent long(not longer than a couple minutes) running tasks flask/raspberry pi/mqtt
Replies: 5
Views: 217

Re: How to run concurrent long(not longer than a couple minutes) running tasks flask/raspberry pi/mqtt

Ok perfect. Yes. I have cookies and a login authentication system in place. Where only logged in users (Just me for now) can visit the site to turn on the hardware

Thank you for the advice
by mesand
Tue Apr 21, 2020 8:39 am
Forum: General discussion
Topic: How to run concurrent long(not longer than a couple minutes) running tasks flask/raspberry pi/mqtt
Replies: 5
Views: 217

Re: How to run concurrent long(not longer than a couple minutes) running tasks flask/raspberry pi/mqtt

Very good, thanks for the input. https://www.youtube.com/watch?v=6ApFx-0Fmvk&t=76s This is APscheduler and it has a flask extension. It has the ability to pool in the background of the flask application to check some internal state or something. I may utilize your suggestions and use this as the sol...
by mesand
Tue Apr 21, 2020 7:46 am
Forum: General discussion
Topic: How to run concurrent long(not longer than a couple minutes) running tasks flask/raspberry pi/mqtt
Replies: 5
Views: 217

How to run concurrent long(not longer than a couple minutes) running tasks flask/raspberry pi/mqtt

Hi all, Here is my dilemma. I have a flask webserver and I have a user input where they enter the number of seconds to turn a piece of hardware on for. Currently, I send an ajax request to a route in flask where i send a message to turn on the hardware via mqtt... then in flask I time.sleep(user inp...
by mesand
Mon Apr 13, 2020 2:52 am
Forum: General discussion
Topic: Best way to get sqlite data from Raspberry pi to a remote server
Replies: 3
Views: 162

Re: Best way to get sqlite data from Raspberry pi to a remote server

Thank you. Currently I am on port 1883 and not using any ssl. I havent found much information on mqtt security. I'm using the paho library to send and receive data. I didnt think using ssl or tcp was too necessary since I am just sending testing phase sensor data, but I will harden it. Is it possibl...
by mesand
Mon Apr 13, 2020 1:19 am
Forum: General discussion
Topic: Best way to get sqlite data from Raspberry pi to a remote server
Replies: 3
Views: 162

Best way to get sqlite data from Raspberry pi to a remote server

Hi all, I am writing data from an arduino nano to my raspberry pi. I have a remote server on linode and I typically communicate with the pi using mqtt. This communication usually consists of turning pumps on and getting sensor data. Now I am wondering how I can get more data from the pi. I want to b...
by mesand
Thu Apr 09, 2020 4:01 am
Forum: General discussion
Topic: Poor practice to read from .txt file multiple times a minute?
Replies: 25
Views: 1113

Re: Poor practice to read from .txt file multiple times a minute?

so do you know what I would do to remedy this problem
by mesand
Thu Apr 09, 2020 3:19 am
Forum: General discussion
Topic: Poor practice to read from .txt file multiple times a minute?
Replies: 25
Views: 1113

Re: Poor practice to read from .txt file multiple times a minute?

hmmm no I didnt do that. But i havent experienced a problem when changing the text file with different values...the code still updates accordingly
by mesand
Wed Apr 08, 2020 9:28 pm
Forum: General discussion
Topic: Poor practice to read from .txt file multiple times a minute?
Replies: 25
Views: 1113

Re: Poor practice to read from .txt file multiple times a minute?

Hi all. Thanks for all your input. I solved this problem and put my solution with code and thorough explanation in another thread. Here is the link This code uses a loop that implements a lighting cycle and checks for updates the cycle if values in a text file change at any point... it should work w...
by mesand
Wed Apr 08, 2020 9:26 pm
Forum: General discussion
Topic: On/Off Timer With Cron
Replies: 5
Views: 295

Re: On/Off Timer With Cron

Hi all. I solved this problem and put my solution with code and thorough explanation in another thread. Here is the link

viewtopic.php?f=63&t=269246&p=1639963#p1639963
by mesand
Wed Apr 08, 2020 9:22 pm
Forum: General discussion
Topic: Turn Lights on and off based off schedule
Replies: 11
Views: 519

Re: Turn Lights on and off based off schedule

Hi all, Here is the code I used to solve this problem. This code works for me and it should work for you as well given proper adjustment of the text file you are using. Scenario : I have a flask app on a remote server communicating with a raspberry pi (via mqtt communication) that controls a light (...
by mesand
Wed Apr 08, 2020 8:50 pm
Forum: General discussion
Topic: Poor practice to read from .txt file multiple times a minute?
Replies: 25
Views: 1113

Re: Poor practice to read from .txt file multiple times a minute?

ok cool, yea I am new to the pi and computing so I didnt know.. but it seems having something like this running constantly in the background is common
by mesand
Wed Apr 08, 2020 3:09 pm
Forum: General discussion
Topic: Poor practice to read from .txt file multiple times a minute?
Replies: 25
Views: 1113

Re: Poor practice to read from .txt file multiple times a minute?

Lots of good info ha come about from this thread. Thanks because I’m a newbie. I’ll post code here once it’s completely working What I am doing is running the script forever in the background. It’s simply checking if the file has been changed and if it has...then I grab the new values if not I conti...
by mesand
Tue Apr 07, 2020 3:29 am
Forum: General discussion
Topic: Poor practice to read from .txt file multiple times a minute?
Replies: 25
Views: 1113

Re: Poor practice to read from .txt file multiple times a minute?

What is the opinion on if I set the current ranges as environment variables and access the environment variables from the cronjob loop everytime? Instead of reading and writing to the text file?
by mesand
Tue Apr 07, 2020 2:54 am
Forum: General discussion
Topic: Poor practice to read from .txt file multiple times a minute?
Replies: 25
Views: 1113

Re: Poor practice to read from .txt file multiple times a minute?

I am setting sensor values to be within a given range from a flask app hosted on a remote webserver I am sending the current set ranges to the pi via mqtt from the server. I set a cron job to run every minute that reads sensor data 10 times in one minute. So, I am writing the current sensor ranges t...
by mesand
Tue Apr 07, 2020 1:29 am
Forum: General discussion
Topic: Poor practice to read from .txt file multiple times a minute?
Replies: 25
Views: 1113

Re: Poor practice to read from .txt file multiple times a minute?

ok, currently the files im reading/writing too are all inside the directory I am using for my project. Should they be somewhere else in the file system?
by mesand
Tue Apr 07, 2020 12:46 am
Forum: General discussion
Topic: Poor practice to read from .txt file multiple times a minute?
Replies: 25
Views: 1113

Poor practice to read from .txt file multiple times a minute?

Hi all,

I am wondering if it is poor practice to continuously open and close a .txt file on my pi. I want to set a crontab that opens and checks a file 10 times once every minute or two. Maybe this could be bad from a RAM persepctive, i dont know. I am relatively new to the pi and hardware.
by mesand
Sun Mar 29, 2020 5:21 pm
Forum: General discussion
Topic: On/Off Timer With Cron
Replies: 5
Views: 295

Re: On/Off Timer With Cron

Same concept but I decided I should make a question more centered around using cron for this approach for people searching in the future. Should I delete?
by mesand
Sun Mar 29, 2020 4:11 pm
Forum: General discussion
Topic: Turn Lights on and off based off schedule
Replies: 11
Views: 519

Re: Turn Lights on and off based off schedule

Great, thanks Dougie for the response. I should have thought to write to a database thanks for bringing it up, Im still a newbie. The problem is that I am not setting a specific datetime for it to be turned on and off at. Its an interval. For ex, 4 hours on 5 hours off. Whenever I try running these ...
by mesand
Sun Mar 29, 2020 5:24 am
Forum: General discussion
Topic: On/Off Timer With Cron
Replies: 5
Views: 295

On/Off Timer With Cron

Hi All, I am using APScheduler module in python with flask. A POST request gives the amount of time to turn a light on and off for. Lets say the POST says turn it on for 6 hours and turn it off for 6 hours. How can I do this in cron? I would want the cron to be run without delay as soon as possible ...
by mesand
Sun Mar 29, 2020 3:44 am
Forum: General discussion
Topic: Turn Lights on and off based off schedule
Replies: 11
Views: 519

Re: Turn Lights on and off based off schedule

hahahaha I know I tried using cron and the on switch and off switch was still overlapping the same way. Do you know how I would use cron to do this? The goal is to run the cron immediately after the command is send and leave it on for the specified time. Then turn it off for the specified time. In a...
by mesand
Sun Mar 29, 2020 3:12 am
Forum: General discussion
Topic: Turn Lights on and off based off schedule
Replies: 11
Views: 519

Re: Turn Lights on and off based off schedule

hmmm I cant get this to work... What this code does is the on switch runs immediately on a 10 second interval. The Off switch turns the switch off at a 20 second interval. They keep cancelling eachother out eventually. I just want them to run one after the other on an interval. Does anyone have an p...
by mesand
Sat Mar 28, 2020 10:18 pm
Forum: General discussion
Topic: Turn Lights on and off based off schedule
Replies: 11
Views: 519

Re: Turn Lights on and off based off schedule

Thank you! Yes I thought of that, but I still dont get how id do it in flask. for example, if I wanted to run it every 6 hours from as soon as the post arrives how would I achieve that? Below is some sample/fake syntax to demonstrate. @FLASK ROUTE def a(): on = 6 off = 24-6 now = datetime.now() apsc...

Go to advanced search