Go to advanced search

by joseplaselva
Mon Jan 13, 2020 5:46 am
Forum: Troubleshooting
Topic: Connect to a wifi network when main ethernet network lost internet connection
Replies: 2
Views: 149

Re: Connect to a wifi network when main ethernet network lost internet connection

Thanks for your early reply, lot of information founded in this post. Time now to test .
by joseplaselva
Sun Jan 12, 2020 7:26 am
Forum: Troubleshooting
Topic: Connect to a wifi network when main ethernet network lost internet connection
Replies: 2
Views: 149

Connect to a wifi network when main ethernet network lost internet connection

I have my rasperry sending data trought internet conectet by ethernet cable to a router, as I have many problems with my adsl and some times it losses my internet, I would like automaticaly stwich to a secondary wifi network. How can I do this in the two ways, conect to wifi when ninternet is no ava...
by joseplaselva
Thu Jan 02, 2020 10:32 am
Forum: Python
Topic: Running a function from outside the script
Replies: 6
Views: 294

Re: Running a function from outside the script

Thank a lot for your suggestions and comments
by joseplaselva
Thu Jan 02, 2020 9:22 am
Forum: Python
Topic: Running a function from outside the script
Replies: 6
Views: 294

Re: Running a function from outside the script

Thanks for your early reply, but I can't see the way to use module for what I want to obtain. I want to force to run a function inside the script as if I was pressing a button widget manually but made from a button placed on another script in the same raspberry device, interact between 2 differents ...
by joseplaselva
Thu Jan 02, 2020 5:21 am
Forum: Python
Topic: Running a function from outside the script
Replies: 6
Views: 294

Running a function from outside the script

Hi, I have a function in a running script(mainScript) that reads the values saved on a txt file in order to update the bg values of some tkinters labels. I would like to run this function from outside the script ( script2 ) without stoping the first script(mainScript) The function is this: def ledsU...
by joseplaselva
Wed Jan 01, 2020 8:15 pm
Forum: Python
Topic: How to know if a device is on or off from another device
Replies: 4
Views: 178

Re: How to know if a device is on or off from another device

Thaks for your sugestion, after some research I found one that help me :

Code: Select all

import os
hostname = "192.168.1.38"
response = os.system ("ping -c 5 " +hostname)

if response ==0:
    print(hostname, "is up")
else:
    print(hostname, "is down")
by joseplaselva
Wed Jan 01, 2020 6:27 pm
Forum: Python
Topic: How to know if a device is on or off from another device
Replies: 4
Views: 178

Re: How to know if a device is on or off from another device

How implement this on a script?

if device XXXXXX is running
do this
if not
do that
by joseplaselva
Wed Jan 01, 2020 5:52 pm
Forum: Python
Topic: How to know if a device is on or off from another device
Replies: 4
Views: 178

How to know if a device is on or off from another device

Hi , I need to know if it is possible with a script to check if a Raspberry device is avaiable or not from another raspberry in the same network ,
Thanks in advance for any help.
and I wish to all members the best for this YEAR 2020
by joseplaselva
Wed Jan 01, 2020 5:27 pm
Forum: Python
Topic: How to synchronize data on txt files between raspberrys
Replies: 16
Views: 508

Re: How to synchronize data on txt files between raspberrys

I need to add something more, because if you want that the comunication is in the two senses , you must repeat the procedure in all the devices : Generating public/private rsa key pair ssh-keygen -t rsa Send the public key to the other pi device (change your user name and the device IP in the networ...
by joseplaselva
Tue Dec 31, 2019 11:58 am
Forum: Python
Topic: How to synchronize data on txt files between raspberrys
Replies: 16
Views: 508

Re: How to synchronize data on txt files between raspberrys

WELL i found a solution, I don't know if it's correctly but it runs. I select the files in the hiden folder '.ssh' of the home/pi directory and copy into the same hiden folder in /root directory ... and EUREKA , runs perfectly finding now the keys and not asking for the password. Thaks to all answer...
by joseplaselva
Tue Dec 31, 2019 11:01 am
Forum: Python
Topic: How to synchronize data on txt files between raspberrys
Replies: 16
Views: 508

Re: How to synchronize data on txt files between raspberrys

HI , I don't understand well your question, I run python in raspberry pi : I open the terminal and I write 'sudo idle' to open the shell window and then I open the python file and run it....
by joseplaselva
Tue Dec 31, 2019 9:17 am
Forum: Python
Topic: How to synchronize data on txt files between raspberrys
Replies: 16
Views: 508

Re: How to synchronize data on txt files between raspberrys

yes I did , subprocess.call("scp -v /home/pi/Pi1-flags.txt pi@192.168.1.31:/home/pi/", shell=True) and the debug in terminal shows : Executing: program /usr/bin/ssh host 192.168.1.31, user pi, command scp -v -t /home/pi/ OpenSSH_7.4p1 Raspbian-10+deb9u7, OpenSSL 1.0.2t 10 Sep 2019 debug1: Reading co...
by joseplaselva
Tue Dec 31, 2019 6:29 am
Forum: Python
Topic: How to synchronize data on txt files between raspberrys
Replies: 16
Views: 508

Re: How to synchronize data on txt files between raspberrysroot

Thanks for your well explained answers. The thing that get me krazy is why writing the command line in python terminal read perfectly the ssh keys, but not when using the same command line in the python script trought the subproccess . Why in terminal search the keys file in home/pi directory and wh...
by joseplaselva
Mon Dec 30, 2019 5:13 pm
Forum: Python
Topic: How to synchronize data on txt files between raspberrys
Replies: 16
Views: 508

Re: How to synchronize data on txt files between raspberrys

running this : subprocess.call("scp -v /home/pi/Pi1-flags.txt pi@192.168.1.38:/home/pi/", shell=True) I get some lines that shows the problem : is looking the keys file in the 'root' insteat of the pi directory : debug1: Next authentication method: publickey debug1: Trying private key: /root/.ssh/id...
by joseplaselva
Mon Dec 30, 2019 2:54 pm
Forum: Python
Topic: How to synchronize data on txt files between raspberrys
Replies: 16
Views: 508

Re: How to synchronize data on txt files between raspberrys

Well ... I found an easy solution just copying the file to one device to the other with : scp /home/pi/Pi1-flags.txt pi@192.168.1.38:/home/pi/ The strange behaviour is that I can do it witouth problem from the terminal, but when I try do the same inside python script allways ask for password.... imp...
by joseplaselva
Fri Dec 27, 2019 4:29 pm
Forum: Python
Topic: How to synchronize data on txt files between raspberrys
Replies: 16
Views: 508

Re: How to synchronize data on txt files between raspberrys

Thanks for all the answers, Could you give me please practical example in python code to carry out this task, hereby I send part of the script that performs the process in one of the raspberry : the first def send the 433 Mhz signals to switch the remote after reading the switch status saved on the ...
by joseplaselva
Fri Dec 27, 2019 4:59 am
Forum: Python
Topic: How to synchronize data on txt files between raspberrys
Replies: 16
Views: 508

How to synchronize data on txt files between raspberrys

Hi, I have some raspberry devices connected to the same network that can send 433 Mhz codes to remote switches, The status ON/OFF of each remote devices are saved on a text file, for use by the scripts to know it. I would like to synchronize this text file between those raspberys in order that when ...
by joseplaselva
Mon Dec 02, 2019 8:09 pm
Forum: Python
Topic: TKINTER GUI and Thread problems
Replies: 2
Views: 163

Re: TKINTER GUI and Thread problems

Well , I found the solution adding a time.sleep(.5)at the end of the while True loop, this little stop let the buttons run free.
by joseplaselva
Sun Dec 01, 2019 6:13 pm
Forum: Python
Topic: TKINTER GUI and Thread problems
Replies: 2
Views: 163

TKINTER GUI and Thread problems

I have a script that shoot a camera in intervals of time trought a loop modul , but in the same GUI I have some buttons that make some actions ( check the IP of the network , send wol packets to my computers , send files by mail ....) the problem is that I don't get the buttons to work when I try to...
by joseplaselva
Tue Sep 17, 2019 4:11 pm
Forum: General discussion
Topic: New Raspbian Buster and Thonny idle, "hate at first sight"
Replies: 15
Views: 874

Re: New Raspbian Buster and Thonny idle, "hate at first sight"

Sorry I forget to ask why in the new Raspian Buster downloaded has the Thonny idle that just run in Python 3 , when this new raspian runs on 2,7 version :shock: :shock: :shock:

Code: Select all

pi@raspberrypi:~ $ python --version
Python 2.7.16
by joseplaselva
Tue Sep 17, 2019 4:00 pm
Forum: General discussion
Topic: New Raspbian Buster and Thonny idle, "hate at first sight"
Replies: 15
Views: 874

Re: New Raspbian Buster and Thonny idle, "hate at first sight"

Many thanks to all for help me to " see the light" :-) . I think I must start to migrate all my scripts to Python 3.
Have a nice evening all of you!!
by joseplaselva
Tue Sep 17, 2019 2:16 pm
Forum: General discussion
Topic: New Raspbian Buster and Thonny idle, "hate at first sight"
Replies: 15
Views: 874

Re: New Raspbian Buster and Thonny idle, "hate at first sight"

I use this in my script : from Tkinter import * from PIL import Image, ImageTk and in Thonny idle gives this error : Traceback (most recent call last): File "/home/pi/TK-snapshot.py", line 5, in <module> from Tkinter import * File "/usr/lib/python3/dist-packages/thonny/backend.py", line 305, in _cus...
by joseplaselva
Tue Sep 17, 2019 1:06 pm
Forum: General discussion
Topic: New Raspbian Buster and Thonny idle, "hate at first sight"
Replies: 15
Views: 874

Re: New Raspbian Buster and Thonny idle, "hate at first sight"

Thanks for give me back the Phyton idle !!!
Thonny's layout looks fine, but why doesn't work with Tkinter GUI ???
by joseplaselva
Tue Sep 17, 2019 11:20 am
Forum: General discussion
Topic: New Raspbian Buster and Thonny idle, "hate at first sight"
Replies: 15
Views: 874

New Raspbian Buster and Thonny idle, "hate at first sight"

I was so excited with the new Pi4 that I bought one to test, and what a great dissapoint, my beloved Python idle has been eliminated and now I can't run my scripts with tkinter in this Thonny idle, why this change, the new with the worst ... I hate. I am the only one suffering from this. Help my fri...
by joseplaselva
Sun May 19, 2019 5:30 pm
Forum: Python
Topic: Question about Tkinter text widged in scrolledtext
Replies: 6
Views: 408

Re: Question about Tkinter text widged in scrolledtext

Thanks a lot , now run perfectly.
Have a nice sunday evening... and thanks again for your kind help
Cheers

Go to advanced search