Go to advanced search

by scotty101
Mon Dec 10, 2018 4:51 pm
Forum: General discussion
Topic: telnet to Pi
Replies: 8
Views: 121

Re: telnet to Pi

Have you installed a telnetd on to your Pi? I don't think it installed by default since for most applications, people will use SSH.

SSH != Telnet.

What is your use case for using telnet rather than SSH?
by scotty101
Mon Dec 10, 2018 12:31 pm
Forum: Python
Topic: turn on led for period of time with a button
Replies: 7
Views: 144

Re: turn on led for period of time with a button

could you help me in embedding the 2 scripts together please Have you run though the tutorial that someone shared above? https://projects.raspberrypi.org/en/projects/physical-computing Once you've taken that tutorial and tried to complete your project yourself, come back if you are stuck. Copying a...
by scotty101
Mon Dec 10, 2018 12:17 pm
Forum: Python
Topic: Keypad Passcode
Replies: 5
Views: 71

Re: Keypad Passcode

Andyroo wrote:
Mon Dec 10, 2018 12:02 pm
@scotty101 - I hope your indents match his as that could be part of his problem :lol: :mrgreen:
Not sure what you mean.
by scotty101
Mon Dec 10, 2018 12:01 pm
Forum: General discussion
Topic: sending alerts to many one or more people
Replies: 17
Views: 358

Re: sending alerts to many one or more people

Why not just test your code and find your own bugs? Try something like this instead (Most of the code removed so you actually have to understand what I've done) .............. def sendSMS(apikey, numbers, sender, message): data = urllib.parse.urlencode({'apikey': apikey, 'numbers': numbers, 'message...
by scotty101
Mon Dec 10, 2018 11:57 am
Forum: Python
Topic: Keypad Passcode
Replies: 5
Views: 71

Re: Keypad Passcode

import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BOARD) GPIO.setwarnings(False) MATRIX = [ [1,2,3,'A'], [4,5,6,'B'], [7,8,9,'C'], ['*',0,'#','D'] ] ROW = [3,5,8,10] COL = [19,21,23,24] for j in range(4): GPIO.setup(COL[j], GPIO.OUT) GPIO.output(COL[j], 1) for i in range(4): GPIO.setup(ROW[i], ...
by scotty101
Mon Dec 10, 2018 11:02 am
Forum: General discussion
Topic: sending alerts to many one or more people
Replies: 17
Views: 358

Re: sending alerts to many one or more people

If you want something to happen (send an SMS) based on the GPIO pin, you'd need to add code to the "FAULTbuttonPressed" function which is called by the GPIO callback. You don't need an "if" when you are using the "add_event_detect" method of the GPIO library. At the moment your code just sends the S...
by scotty101
Sun Dec 09, 2018 10:01 pm
Forum: General discussion
Topic: sending alerts to many one or more people
Replies: 17
Views: 358

Re: sending alerts to many one or more people

Can't help with that. Looks like something wrong with the call to the website to send the text.
As I don't have an API key, I can't help you.
by scotty101
Fri Dec 07, 2018 3:33 pm
Forum: Advanced users
Topic: Help with Flask
Replies: 7
Views: 126

Re: Help with Flask

I'll repeat what I said above. file.close should be file.close() but it is better to do what I've done above and use the "with" context manager to automatically close the file once it has been used. Also speakFile Should be speakFile() Also the current file plays the Audio before rendering the page ...
by scotty101
Fri Dec 07, 2018 2:10 pm
Forum: General discussion
Topic: Christmas Gift Vouchers
Replies: 4
Views: 98

Re: Christmas Gift Vouchers

Where in the world are you? I think some of the UK resellers do.
by scotty101
Fri Dec 07, 2018 12:01 pm
Forum: Python
Topic: tkinter memory Leak.
Replies: 1
Views: 66

Re: tkinter memory Leak.

There are two simple rules for a responsive tkinter GUI 1. Avoid infinite loops or functions that will take a long time to execute 2. Update widgets rather than redrawing them. You've met rule 2 but have broken rule 1. Your whole main body of code is inside one large while loop and the only time tha...
by scotty101
Thu Dec 06, 2018 5:36 pm
Forum: General discussion
Topic: sending alerts to many one or more people
Replies: 17
Views: 358

Re: sending alerts to many one or more people

Ok. I'd still rewrite it to improve the code but this does at least show how it might work. I've added an extra button and function to simulate the GPIO falling edge but you can comment these out. Code has been modified to update the labels that contain the SensorHigh and TOTAL counts rather than cr...
by scotty101
Thu Dec 06, 2018 5:31 pm
Forum: General discussion
Topic: sending alerts to many one or more people
Replies: 17
Views: 358

Re: sending alerts to many one or more people

I'm not a fan of what you are doing here def FAULTbuttonPressed(channel): global SensorHigh , TOTAL SensorHigh = SensorHigh + 1 Label(text= SensorHigh , relief=RIDGE,width=10).grid(row=1,column=1) TOTAL = TOTAL + 1 Label(text=TOTAL, relief=RIDGE,width=10 ).grid(row=2,column=1) You'll create new labe...
by scotty101
Thu Dec 06, 2018 4:48 pm
Forum: General discussion
Topic: sending alerts to many one or more people
Replies: 17
Views: 358

Re: sending alerts to many one or more people

Does this work? I've tested as much as i can without actually making the urllib request. #!/usr/bin/env python #https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=228355 from tkinter import * import urllib.request import urllib.parse def sendSMS(apikey, number, sender, message): data = urllib.p...
by scotty101
Thu Dec 06, 2018 1:11 pm
Forum: Advanced users
Topic: Raspberry pi connects app
Replies: 4
Views: 122

Re: Raspberry pi connects app

Tjank you for the respone, i will look at some tutorials. Is there any way i can use firebase because i saw some people using it and app inventor One more thing. I dont want to monitor it when i am hot home because i think it is hard. If it is easyer just for it to be on the same wifi as the raspbe...
by scotty101
Thu Dec 06, 2018 9:54 am
Forum: General discussion
Topic: How to connect BNC to Raspberry Pi 3 B+?
Replies: 7
Views: 231

Re: How to connect BNC to Raspberry Pi 3 B+?

What are you struggling with? The actual mechanical connected to a BNC connector or the fact that the device outputs an analogue signal between 0 and 5v? For the BNC connection, I'd just buy a BNC cable and cut it in half and solder wires on to the cut end so that you can connect it to a breadboard ...
by scotty101
Thu Dec 06, 2018 9:42 am
Forum: General discussion
Topic: sending alerts to many one or more people
Replies: 17
Views: 358

Re: sending alerts to many one or more people

Fan174 wrote:
Thu Dec 06, 2018 5:48 am
NameError: name '***********' is not defined
If that is exactly the error you are getting, its because ************** isn't valid. If *********** is supposed to be your API key try putting it inside quotes like '*****************' e.g. '123456789'
by scotty101
Thu Dec 06, 2018 9:37 am
Forum: General discussion
Topic: sending alerts to many one or more people
Replies: 17
Views: 358

Re: sending alerts to many one or more people

Change

Code: Select all

def sendSMS(apikey, numbers, sender, message):
to

Code: Select all

def sendSMS(apikey, number, sender, message):
by scotty101
Thu Dec 06, 2018 9:35 am
Forum: Python
Topic: TKinter loop
Replies: 5
Views: 117

Re: TKinter loop

epkeati wrote:
Thu Dec 06, 2018 2:03 am
So the code would look like this?

Code: Select all

def function()
	if on
		Do something
	self.after(100, function)
	
root = tk
root.after(100,function)


Yeah pretty much. Just don't forget you still need the root.mainloop()
by scotty101
Wed Dec 05, 2018 11:32 pm
Forum: Python
Topic: TKinter loop
Replies: 5
Views: 117

Re: TKinter loop

Put a .after call inside the function that you want to be called periodically.
Then it will call itself
by scotty101
Wed Dec 05, 2018 10:00 pm
Forum: Python
Topic: TKinter loop
Replies: 5
Views: 117

Re: TKinter loop

Tkinter and "while True" loops should never mix. If you want something to happen periodically with tkinter you should use the .after method to schedule a function to be called after a period of time. For example root.after(100, updateGUI) Will call a function called updateGUI after 100milliseconds. ...
by scotty101
Wed Dec 05, 2018 9:46 pm
Forum: General discussion
Topic: Mother-Daughter Pi's?
Replies: 9
Views: 296

Re: Mother-Daughter Pi's?

In MicroPython froum I read that Wifi drops are a real problem, and that ESP32 is affected by that. They stated that software needs to be able to deal with small Wifi drops. So for your scenario I would not use Wifi between the mother and daughters, instead any sort of wire protocol. If the OP uses...
by scotty101
Wed Dec 05, 2018 5:14 pm
Forum: HATs and other add-ons
Topic: GPIO pins 22-27 and LCD display
Replies: 6
Views: 140

Re: GPIO pins 22-27 and LCD display

The adafruit website has instruction for using that LCD with the raspberry pi.
https://learn.adafruit.com/character-lc ... cuitpython

The guide does pick some specific GPIO pins but you can choose any of the other free GPIO pins.
by scotty101
Wed Dec 05, 2018 4:42 pm
Forum: Automation, sensing and robotics
Topic: Help: Automation Using GPS
Replies: 9
Views: 170

Re: Help: Automation Using GPS

I am using a robopi hat. I have written a bunch of messy code that doesn't work, so I decided to restart writing it. I do have a compass that I can implement. I am trying to get it done as soon as possible, because I am in a bit of a rush to get it done for my engineering class (10 days). Robot wit...
by scotty101
Wed Dec 05, 2018 4:36 pm
Forum: Advanced users
Topic: Help with Flask
Replies: 7
Views: 126

Re: Help with Flask

You'll need modify the Audio.py file so that it contains a function that can be called from the flask script. An import will only occur once. Audio.py from subprocess import call def speakFile(): with open('Audio.txt','r') as file: text = file.read().strip() call(["espeak",text]) Then in the flask p...

Go to advanced search