Closed unupingu closed 6 years ago
Hi Unupingu.
The following command should install the tkinter module in your raspberry
apt-get install python-tk python3-tk
Let me know,
Guido
Thanks for your quik response but when i run sudo python MultiPage. py i get the same error When i run sudo python3 Multiple.py i get the error no module ptvsd
Hi again. Three points:
# print("ptvsd.enable_attach('my_secret')")
# import ptvsd
# ptvsd.enable_attach('my_secret')
2) run:
python3 Multiple.py
Of course, let me know your progress 👍 Bye
no its not working.i get this error.
pi@raspberrypi:~/MyThermostat/Raspberry $ sudo apt-get install python-tk python3-tk Reading package lists... Done Building dependency tree Reading state information... Done python-tk is already the newest version (2.7.13-1). python3-tk is already the newest version (3.5.3-1). 0 upgraded, 0 newly installed, 0 to remove and 53 not upgraded. pi@raspberrypi:~/MyThermostat/Raspberry $ python3 MultiPage.py File "MultiPage.py", line 13 from tkinter import Tk, Button, PhotoImage, messagebox ^ IndentationError: expected an indented block
Ok, two more points:
Because you commented the three lines above, you have to comment the "if" statement also. So modify MultiPage.py in such a way:
# if os.name == 'posix':
# # on raspberry
# print("ptvsd.enable_attach('my_secret')")
# import ptvsd
# ptvsd.enable_attach('my_secret')
I forgot to place AnimatedGIF.py on github, but now it's present and you can download it.
Go now!
now i have this error
pi@raspberrypi:~/Downloads/MyThermostat/Raspberry $ sudo python3 MultiPage.py
Starting server, use
do you have a image builded of this project that you can send me.
Hi. Well, I think you are just a millimeter far from the finish line!
python3 MultiPage.py
from a remote shell, haven't you?The error "no display name and no $DISPLAY environment variable" comes out when there's no X11 (Unix/Linux standard graphic interface) configured or when Raspbian doesn't know which display to use. For this reason, even if I send you a working Raspberry image, you have to solve this problem all the same so:
sudo raspi-config
and connect to it with any "VNC client": this generated an X11 server automatically In any case, if you run from a remote shell, enter:
export DISPLAY=:0.0
just once
Bye
IT WORKS!!! (:(: THE FILE THAT I HAVE TO UPLOAD (thermo. lua)TO THE ESP8266 ,I HAVE TO CHANGE SOMETHING ?LIKE SSID/ PASSWORD.
I'm very happy to know that. To connect your ESP8266 (with NodeMCU installed) to your local WIFI network simply do this, changing SSID and PWD with yours.
-- Connect to Wi-Fi network wifi.setmode(wifi.STATION) wifi.sta.config(SSID, PWD)
-- Wait for a few seconds and then check your ESP8266 obtained an IP address print("Connected to network " .. SSID) print("IP: " .. wifi.sta.getip())
After that, ESP8266 NodeMCU will retain these setting and automatically connect to your WIFI after any reset. Just to be safe, simply do: wifi.sta.autoconnect()
where do i put this wifi.setmode(wifi.STATION) wifi.sta.config(SSID, PWD) i dont find them nowere
Well, to answer your question I need to know the environment you're using to program your ESP8266 NodeMCU device. I'd suggest ESPlorer for Windows. You need to execute those commands only once, so you can:
I use ESPlorer After lunching wifi.setmode(wifi.STATION) wifi.sta.config(SSID, PWD) Then i have to lunch thermo.lua and init.lua. ?
Yes. Launch:
wifi.setmode(wifi.STATION)
wifi.sta.config(SSID, PWD)
To be sure ESP is connected to the wifi, check the obtained IP Address for the ESP with:
wifi.sta.getip()
If everything is ok you'll have something like:
192.168.1.111 255.255.255.0 192.168.1.1
Now go to the Raspberry and take note of its IP Address, i.e. 192.168.1.69
Change line 84 of thermo.lua with
url = "http://192.168.1.69:2048"
Now, for testing, simply launch, using ESPlorer: thermo.lua Raspberry should receive the measured temperature and show it on the screen once.
I'd suggest to configure your router to reserve always the same IP to your Raspberry
hy. how can fix the error "no module named tkinter" thanks.