Go to advanced search

by Davies
Wed Dec 20, 2017 2:13 pm
Forum: Automation, sensing and robotics
Topic: IoT Data storing and graphing options (offline)
Replies: 4
Views: 506

Re: IoT Data storing and graphing options (offline)

dygraphs does look interesting, i was going to use matplotlib via web.py webserver to access my graphs but now i think ill be using dygraphs instead.
ive not been able to pass info straight from a python script to dygraphs but can post to file then read that with the javascript
by Davies
Tue Dec 19, 2017 8:18 pm
Forum: Automation, sensing and robotics
Topic: IoT Data storing and graphing options (offline)
Replies: 4
Views: 506

Re: IoT Data storing and graphing options (offline)

matplotlib in python is good for graphing https://matplotlib.org/gallery/index.html https://matplotlib.org/xkcd/users/pyplot_tutorial.html you can add a menu with zoom option, legend, multiple axis and have it plot from a file. import numpy as np import matplotlib.pyplot as plt import matplotlib.dat...
by Davies
Mon Dec 18, 2017 5:12 pm
Forum: Python
Topic: Sit and Stand Desk via Python
Replies: 1
Views: 252

Re: Sit and Stand Desk via Python

do you have the TiMotion Actuators?, gear motors?, columns? if not i think it would be better to design your own system, possibly using threaded bar connected to a stepper motor, with a bolt mounted to the desk which travels up and down the threaded bar as the bar turns. i cant see a way of using pr...
by Davies
Mon Dec 18, 2017 12:02 pm
Forum: Automation, sensing and robotics
Topic: Pressing a button to turn on a camera using RPi3 and motors
Replies: 4
Views: 582

Re: Pressing a button to turn on a camera using RPi3 and motors

no problem, hope it works for you. a couple points i didnt make, the code was written in python 2.7.13, if you set the pycharm interpreter to 3.5 it will highlight errors.. it may be worth sticking with the same version if you are using the code i posted. also its set up for bcm gpio, not board.. so...
by Davies
Mon Dec 18, 2017 11:29 am
Forum: Python
Topic: Email Notification
Replies: 3
Views: 604

Re: Email Notification

you could use email parser to pick up on a specific part of the email such as sender, subject etc then have your code run if the email is the actual email you want to use and not spam.. this example uses gmail and requires gmail settings to allow less secure apps and allow use of pop3. it sends an e...
by Davies
Sun Dec 17, 2017 1:15 pm
Forum: Automation, sensing and robotics
Topic: Pressing a button to turn on a camera using RPi3 and motors
Replies: 4
Views: 582

Re: Pressing a button to turn on a camera using RPi3 and motors

im surprised you cant turn the camera on through software, but a quick google didnt come back with anything.. maybe you could use a car door lock actuator to press the button? they are 12v but possibly better than rigging up a motor? https://www.ebay.co.uk/itm/Universal-Heavy-Duty-Power-Door-Lock-Ac...
by Davies
Mon Dec 11, 2017 1:59 pm
Forum: Automation, sensing and robotics
Topic: Advice: Whole Home Radiator Fan/Temperature Controller
Replies: 1
Views: 446

Re: Advice: Whole Home Radiator Fan/Temperature Controller

be careful with the 12-5v converter as the variable type can be totally under amp, the 1.5amp they have advertised may not be continuous and it could be rated with a 35v input not 12v, at 12v input you could be sub-optimal 200mA or so, i tend to look at car usb accessories when converting 12v to 5v ...
by Davies
Sun Nov 26, 2017 6:50 pm
Forum: Python
Topic: How to access the variable of function from one class to another belongs to one file to another in python?
Replies: 1
Views: 245

Re: How to access the variable of function from one class to another belongs to one file to another in python?

ive used a pickle in the past for sharing variables across scripts as well as putting a memory to the variables.. import pickle with open('objs.pickle') as f: aaa, bbb = pickle.load(f) def save(): with open('objs.pickle', 'w') as f: pickle.dump([aaa, bbb], f) this uses a separate file to save the va...
by Davies
Sun Nov 26, 2017 6:20 pm
Forum: Python
Topic: Reed contact starts omxplayer several times
Replies: 6
Views: 452

Re: Reed contact starts omxplayer several times

can you open the file in the current manner, using

Code: Select all

myprocess = subprocess.Popen(['omxplayer', file])
rather than using

Code: Select all

os.system ('omxplayer ' + file)
?
by Davies
Sun Nov 26, 2017 10:52 am
Forum: Python
Topic: Reed contact starts omxplayer several times
Replies: 6
Views: 452

Re: Reed contact starts omxplayer several times

import time import RPi.GPIO as io import subprocess import os ## set GPIO mode to BCM io.setmode(io.BCM) ## enter the number of whatever GPIO pin you're using door_pin = 23 ## use the built-in pull-up resistor io.setup(door_pin, io.IN, pull_up_down=io.PUD_UP) # activate input with PullUp ## initial...
by Davies
Thu Nov 23, 2017 2:43 am
Forum: Automation, sensing and robotics
Topic: Automated drone security
Replies: 2
Views: 456

Re: Automated drone security

this sounds awesome and i want one. i think its possible, you could even have alexa or some kind of speaking system built into it but it would be a lot of work. would be good for it to return to a docking station and charge itself. someone has a facial recognition project here https://www.hackster.i...
by Davies
Thu Nov 23, 2017 1:17 am
Forum: Python
Topic: Reed contact starts omxplayer several times
Replies: 6
Views: 452

Re: Reed contact starts omxplayer several times

you have a few lines missing to protect the code from running time and time again while True: means while the unit is switched on so at the moment your saying while the raspberry is switched on, if door input is live print door open and run this mp3, that happens and the while script goes back to be...
by Davies
Mon Nov 20, 2017 10:21 am
Forum: Automation, sensing and robotics
Topic: power management, crash = reboot, power fail = shutdown, power on = boot, script = Python
Replies: 5
Views: 804

Re: power management, crash = reboot, power fail = shutdown, power on = boot, script = Python

i had presumed when the raspberry crashed that would be the whole unit paused in its current process, the watchdog option seems like a much better idea than an hardwired interface and makes running with a UPS possible for my scenario without use of extra parts. Thank you for your input on this, you ...
by Davies
Sun Nov 19, 2017 4:01 pm
Forum: Automation, sensing and robotics
Topic: power management, crash = reboot, power fail = shutdown, power on = boot, script = Python
Replies: 5
Views: 804

Re: power management, crash = reboot, power fail = shutdown, power on = boot, script = Python

thanks for the reply, im aware of uninterruptible power supplies and use an old APC BX 1400 for my PC but non of these offer an auto reboot should the RPi crash (though some circuitry and a script could offer this). i did try to send myself an email when the power fails but the 4.5F cap didnt have e...
by Davies
Sun Nov 19, 2017 3:28 pm
Forum: Python
Topic: RISING & FALLING
Replies: 28
Views: 1922

Re: RISING & FALLING

i had a similar issue with the bounce time and used a capacitor accross the GPIO to smooth the input, (maybe a 0.33uf capacitor but dont remember exactly) for me the issue was opening and closing relays on the 5v line was causing a voltage drop across the entire raspberry, i put a 4.5F cap on my 5v ...
by Davies
Sat Nov 18, 2017 4:39 pm
Forum: Beginners
Topic: Using pi for pwm remotely
Replies: 2
Views: 245

Re: Using pi for pwm remotely

you would need to find a programming language and build a script doing what your wanting. to use the potentiometer with the Pi you would need to use an analog to digital converter so you can feed the digital signal to the Pi though this would be wired and performed through the GPIO inputs not remote...
by Davies
Sat Nov 18, 2017 3:10 pm
Forum: Beginners
Topic: while loop question
Replies: 16
Views: 1144

Re: while loop question

The if statement inside the loop, is what i am trying to avoid, because i need many, for different situations. I seem to observe that inside a loop, response to button-presses is not so snappy. The "break" idea is something that i am going to follow-up on, because i can get the different events to ...
by Davies
Sat Nov 18, 2017 1:44 pm
Forum: Beginners
Topic: Laptop connectivity and linux installation.
Replies: 5
Views: 382

Re: Laptop connectivity and linux installation.

i use Putty to access the raspberry command line and WinSCP for file transfer
im using a windows 10 PC

you can get putty on ubuntu, not sure about SCP..
How to install putty (SSH and telnet client) in ubuntu Linux: https://www.youtube.com/watch?v=cAMTHwrw9X4
by Davies
Wed Nov 15, 2017 6:50 pm
Forum: Beginners
Topic: while loop question
Replies: 16
Views: 1144

Re: while loop question

sure, i presume you using While True or while 1 or something like that at mo, you just say while the gpio is off/on: instead
eg.

Code: Select all

while not GPIO.input(27):
    Do_stuff()
    count += 1
    time.sleep(1)
.
if you need more help post an example of your current code in the Python section of this forum
by Davies
Wed Nov 15, 2017 5:38 pm
Forum: Automation, sensing and robotics
Topic: power management, crash = reboot, power fail = shutdown, power on = boot, script = Python
Replies: 5
Views: 804

power management, crash = reboot, power fail = shutdown, power on = boot, script = Python

hi all, ive had a couple instances where after a few days of running my raspberry has crashed (possibly my script was the issue but no error just an unresponsive raspberry often 48hour+ of running, i know an update may also resolve it), also the girlfriend likes to unplug things for her phone charge...
by Davies
Wed Nov 15, 2017 12:38 pm
Forum: Python
Topic: GUI with different interfaces
Replies: 3
Views: 347

Re: GUI with different interfaces

perhaps your wanting multiple pages within 1 GUI? this code has multiple pages that can be access by pressing "+" on the UI it also uses threading, if your using tkinter and want background processing you may need to use threading, basically tkinter will run its own thread and without threading your...
by Davies
Wed Nov 15, 2017 10:48 am
Forum: Python
Topic: GUI with different interfaces
Replies: 3
Views: 347

Re: GUI with different interfaces

im unsure what ur wanting, you used an arrangement of buttons on your other forum post you had 2 buttons top right and one in middle of page, are you wanting buttons within their own window, or circle buttons instead of square?
by Davies
Wed Nov 15, 2017 12:51 am
Forum: Python
Topic: Tkinter in while loop
Replies: 6
Views: 856

Re: Tkinter in while loop

in your other post you use root, import tkinter as tk root=tk.Tk() root.attributes('-fullscreen', True) root.wm_title("Glashaus") # Fenster Titel root.config(background = "#FFFFFF") # Hintergrundfarbe des Fenster root.mainloop() call root what you want but youll need to call the same name throughout...
by Davies
Tue Nov 14, 2017 6:39 pm
Forum: Python
Topic: Problems with the code (while-loop)
Replies: 6
Views: 455

Re: Problems with the code (while-loop)

import tkinter as tk Seite = 0 x = 4 # maximale Seiten i = 1 def Seiteplus(): global Seite Seite += 1 if Seite > x: Seite = 0 while True: if i == 1: root = tk.Tk() root.attributes('-fullscreen', True) root.wm_title("Glashaus") # Fenster Titel root.config(background="#FFFFFF") # Hintergrundfarbe des...
by Davies
Tue Nov 14, 2017 12:44 pm
Forum: Automation, sensing and robotics
Topic: simple temperature monitor and relay activation GUI
Replies: 8
Views: 1410

Re: simple temperature monitor and relay activation GUI

as btidey posted theres also web.py, i asked a question on here which i ended up answering myself but the post could be a good example of another option you have available (it was written in python 2.7 not tested on python 3+) https://www.raspberrypi.org/forums/viewtopic.php?f=32&t=195379 the websit...

Go to advanced search