-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pull the most current samples with the READ command? #11
Comments
Great question, the short answer is that I don't know of a better way
currently.
As far as I can tell the way modlet designed their plugs is that they
expect their dongle to always be around and reading data (not how I would
have done this). Due to that architecture I don't believe there is a
command or if there is one it was used in the software that they provided
which means I don't have an example of how it might be used.
It might be worth reaching out to the company and see if they are able to
share more technical details of their product.
|
Actually, this prompts another question. The way that the USB dongle is being used, it would not be able to be added to the gateways on my "mymodlet" account, correct? I haven't used that account in years, so I would need to poke around to remember how to add a gateway (I had only used the ethernet gateway before), but if it COULD be added, maybe that would keep the data offloaded? Perhaps that functionality was what you stripped away when you created this lightweight client? |
I haven't used the gateways either, but I think the short answer is that this client doesn't work with their cloud platform. I think the way that this worked was that their client would upload the data to the cloud and since their client isn't running that wouldn't work with hacklet. If you want to store the data the best approach is to try running hacklet with cron to continually fetch the data. |
No problem - I have checked the usage, so I have an idea of the max power that the printer is using, and that is good enough. When I get some more time to play with this, I might take a shot at the cron option. The longer I wait, the bigger the queue gets, though! I recommissioned things yesterday, and I am at 9000-odd records now. |
Would love to find a way to clear out the old store samples.
The only hack way I can figure is to create a loop to run through all the remaining samples. The issue I find is if you run it too fast that the program sometimes hangs. |
This is the only way that I found to do it - I'm not sure that there is another way as the original application was designed to poll the outlets frequently and the buffer behavior was only there in case the outlet was disconnected for a period of time. |
Posting on an old comment, but if I get some time I might try playing around with cron and see if i can come up with a simple way to do this. I haven't looked at this in a long time, and I am just reconfiguring a second raspberry pi to use octoprint for a second 3d printer, and this forced me to think about this again. |
If I recall, there might be a way to call the command repeatedly until it exhausts it’s buffer and comes back with less than 20 data points. If you come up with a patch for it, I’d consider including it. |
It's been a while, but I have settled (for now) on creating a pair of cron jobs that basically runs the read command for the top outlet on even minutes, and bottom outlet on odd minutes. Since these devices appear to read the power data every 10 seconds, running the read command every 2 minutes effectively keeps the buffers empty. I have the jobs sending their outputs to a log file so I can see the data there, or i can just run the command to read the data manually from a command line (if I get no results, waiting for 10 seconds and re-running will give a new result). The hardest part right now is "purging" 100000+ entries. I ran a watch command at 1 second intervals and just let it run until it returned a result that showed the buffer was empty. I wish there was a way to just delete the buffer, but this gets the job done - and hopefully the cron jobs keep them clear! |
I have had the same issue in the past with the buffer too full. If you can, you can unplug the device and plug it back in and it will clear the buffer. Not sure if that is an option for you or not. |
I wasn't aware that would clear the buffer. If I hadn't just started a 3D print (utilizing the bottom outlet), I would try it right now! |
Hello,
I have your hacklet installed on my Raspberry Pi (running OctoPi for my 3D printer). So far it is very slick!
I just have a question, and I am not sure where to ask...
It appears that the READ command grabs the oldest 20 datapoints for power usage, and to get to the most recent, the command would need to be run many, many times to clear out the buffer of the Modlet. Is there a way to specify that you want the most RECENT data points? Or a way to specify the number of data points you want to pull?
Thanks!
The text was updated successfully, but these errors were encountered: