Go to advanced search

by Davies
Thu Nov 23, 2017 2:43 am
Forum: Automation, sensing and robotics
Topic: Automated drone security
Replies: 2
Views: 89

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: 1
Views: 44

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: 4
Views: 190

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: 4
Views: 190

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: 663

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: 90

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: 494

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: 167

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: 494

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: 4
Views: 190

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: 159

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: 159

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: 232

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: 202

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: 5
Views: 270

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...
by Davies
Mon Nov 13, 2017 4:04 pm
Forum: Beginners
Topic: 8 relay GPIO pins not working
Replies: 1
Views: 70

Re: 8 relay GPIO pins not working

when posting code use the code tags otherwise ur code looses its indentations. "test an 8 way 5v relay which has an external 5v power sourse, which I've grd onto GPIO grd pin." you put 5v power to GPIO ground? does the relay module have a pin labelled jd-vcc like this type?.. http://www.considerit.c...
by Davies
Sun Nov 12, 2017 8:30 pm
Forum: Beginners
Topic: GUI Fullscreen
Replies: 3
Views: 134

Re: GUI Fullscreen

root.geometry("{0}x{1}+0+0".format(root.winfo_screenwidth(), root.winfo_screenheight())) should gain fullscreen regardless of screen size perhaps the -pad you use could be cutting it short of ur screen root.overrideredirect(True) removes the top bar, close and minimise buttons root.resizable(width=...
by Davies
Sun Nov 12, 2017 8:17 pm
Forum: Automation, sensing and robotics
Topic: simple temperature monitor and relay activation GUI
Replies: 5
Views: 270

Re: simple temperature monitor and relay activation GUI

you need to choose a language you want to use, for me it was python but it would be best for you to look through examples of languages and see if you can digest any of it, if you can then use that language. if you dont want to put much effort in and decided to go for say python it would be worth goo...
by Davies
Sun Nov 12, 2017 7:24 pm
Forum: Python
Topic: Your python learning recommendations?
Replies: 5
Views: 287

Re: Your python learning recommendations?

a lot depends on where u want to go with things, for me i was interested in IO and how i could control them, starting with an LED and a button, i followed a guide on how to make the LED light up when the button was pressed. then i wanted to use a graphical button and a on screen box to interact with...
by Davies
Sat Oct 14, 2017 2:22 pm
Forum: Python
Topic: web.py webpage running at host location
Replies: 1
Views: 124

Re: web.py webpage running at host location

ive been able to use threading and webbrowser but now it opens 2 instances of the web page.. import web import threading import webbrowser import time def open_web(): time.sleep(2) webbrowser.open('http://localhost:8080') t1 = threading.Thread(target=open_web) t1.daemon = True t1.start() urls = ( '/...
by Davies
Sat Oct 14, 2017 1:36 pm
Forum: Python
Topic: web.py webpage running at host location
Replies: 1
Views: 124

web.py webpage running at host location

is it possible to have web.py open its own output? for example python script... import web urls = ( '/', 'Index' ) app = web.application(urls, globals()) render = web.template.render('static/') class Index(object): def GET(self): msg = "Hello World" return render.index(msg=msg) if __name__ == "__mai...
by Davies
Sun Oct 08, 2017 3:54 pm
Forum: Python
Topic: 7” Pi display screen overlay text.
Replies: 11
Views: 584

Re: 7” Pi display screen overlay text.

hey paddy, i was thinking more along the lines of a text overlay also suggested by the OP.. transparency effects and closing/opening of tkinter windows is possible and something i wanted to put into this example but i just dont have time right now, so if the OP is wanting to use tkinter theyll have ...
by Davies
Sat Oct 07, 2017 1:25 pm
Forum: Python
Topic: 7” Pi display screen overlay text.
Replies: 11
Views: 584

Re: 7” Pi display screen overlay text.

to get the keyboard info you could use pynput from pynput import keyboard def on_press(key): try: print('alphanumeric key {0} pressed'.format( key.char)) except AttributeError: print('special key {0} pressed'.format( key)) def on_release(key): print('{0} released'.format( key)) if key == keyboard.Ke...
by Davies
Mon Jul 03, 2017 10:19 pm
Forum: Python
Topic: Python script for Multiple DS18b20
Replies: 9
Views: 815

Re: Python script for Multiple DS18b20

it seems to gain the results twice as fast for me when checking 2 temp sensors with threading compared to without threading

post your code
by Davies
Mon Jul 03, 2017 1:13 pm
Forum: Python
Topic: looking for number in string
Replies: 2
Views: 289

Re: looking for number in string

Excellent, thank you elParaguayo

Go to advanced search