WeatherFlow PiConsole - Archive

Weird! Sounds like some glitch on the server. Glad you are up and running now though.

2 Likes

Yeah working like a “champ”

Another small request… Could you provide instructions on the best way to auto start main.py in the installation instructions as an optional feature?

I’ve tried several ways suggested from a Google search without success. ?? (rc.local, .bashrc etc…)

Didn’t try crond yet…

I’m sure most users will have their Rpi dedicated to this task once it’s up and running smoothly.

Crontab is probably the best. It will restart it on reboot.

You could also install PM2 and let it keep it running.

I will have a look into this. It is not something I have done before, so will take some experimenting. I am away next week but will update the instructions as soon as I can.

I was able to get an auto start upon ‘boot’ using cron.

But it is abit of a kuldge … sorta. I was always told if it works it’s perfect!

created a shell script “wx.sh” in /home/pi
#!/bin/bash
cd WeatherFlow
python3 main.py
exit

then used crontab -e
and added this line at the end.

@reboot sudo /home/pi/wx.sh

EDIT:

the only trouble I’ve got with this is trying to end the program… the normal Ctrl-C doesn’t work, nor does the touchscreen respond - to touch. like trying to get the credits pop-up active.

my only way to stop it is to SSH in and kill the process - (without pulling the plug! always a no no)

EDIT2:

Slight change “removed sudo” from the Cron entry ; now the touchscreen responds, but still can’t exit with Ctrl-C.

Use ctrl/break or ctrl/pause

That makes sense. If you use sudo to run the code, Kivy (the GUI python module) will use a config file belonging to the root user. This config file will not have been modified to make the touchscreen work.

Also, are you sure you need the bash script? Wouldn’t something like

@reboot python3 /home/pi/WeatherFlow/main.py

work quite happily?

2 Likes

Running the bash script won’t work because when you ctrl-c it is telling it to stop the bash script, not they py code.

1 Like

I’ll give it a try thanks!

Linux is not from my planet. :see_no_evil:

2 Likes

Thanks for the update.
Installed and running again.

1 Like

tried … @reboot python3 /home/pi/WeatherFlow/main.py

didn’t work ???

I like the dimming ideas, once I get things running will see what others came up for a dimming solution.

1 Like

Hmmmm not sure then I’m afraid… I can have a look into this when I am back, but if you are keen to experiment sooner, perhaps try something like this: https://www.raspberrypi.org/documentation/linux/usage/systemd.md

Thanks Peter …

it’s really not a big deal - I have it auto starting working fine using my sh script. It’s just interrupting execution that is an issue. Which is really NOT an issue once this project has been finalized.

Perhaps at some point there will be a ‘pop-up screen’ option to shutdown or reboot the Rpi from the touchscreen.

Ideally there won’t be a need to have a mouse/keyboard plugged in. Doing a power ‘off’ shutdown on a Rpi, is never recommended - having an option to shutdown/reboot would be nice in the future

And if this is not possible that’s OK too. :grin:

.EDIT: (Thanks for the info link) I followed the information on setting up a Service and it works … fine. (stopping execution remains an issue - without SSH’ing in)

EDIT2: I have a solution for my immediate needs… I’m using an iOS app called ‘SimplePi’ allows reboot/shutdown remotely via a SSH - GUI app interface. Works rather nicely!

@peter why did i get this error when running “Step 2: Upgrade the Python 3 version of Pip”?

/usr/bin/python3: No module named pip

I have install the latest stretch-lite version and i’m connect to the rpi with ssh

You probably didn’t install the python3 variant of pip initially…

I think on raspbian you want “apt-get install python3-pip” to get that, unless there’s a particular reason the os version isn’t good enough.

Hi @patrick.mussner, I’m afraid it’s because you have installed the lite version of Rasbian rather than the full version. The lite version is missing many of the packages (like pip) required to install the PiConsole, and also does not include a desktop environment. For this reason the instructions assume you have the full version of Rasbian.

Unless you know what you are doing, and are happy to install the desktop environment (GUIDE: Raspbian Lite with RPD/LXDE/XFCE/MATE/i3/Openbox/X11 GUI - Raspberry Pi Forums), I highly encourage you to use the full version of Rasbian.

Edit: just looked at the instructions on the Github page and apologies for not making it completely clear you need the full version of Rasbian. I’ll update the instructions accordingly.

1 Like

@peter

Just an update.
Ordered a Pi and 7" Monitor, look forward to trying out PyConsole.

Mark.

1 Like

Thanks @peter i have follow step by step your instructions, but i have the follow error:

pi@raspberrypi:~/WeatherFlow $ python3 main.py
[INFO ] [Logger ] Record log in /home/pi/.kivy/logs/kivy_18-09-11_6.txt
[INFO ] [Kivy ] v1.11.0.dev0, git-038acbf, 20180911
[INFO ] [Python ] v3.5.3 (default, Jan 19 2017, 14:11:04)
[GCC 6.3.0 20170124]
[INFO ] [Factory ] 195 symbols loaded
[INFO ] [Image ] Providers: img_tex, img_dds, img_sdl2, img_pil, img_gif (img_ffpyplayer ignored)
[INFO ] [Window ] Provider: egl_rpi
[INFO ] [GL ] Using the “OpenGL ES 2” graphics system
[INFO ] [GL ] Backend used
[INFO ] [GL ] OpenGL version <b’OpenGL ES 2.0’>
[INFO ] [GL ] OpenGL vendor <b’Broadcom’>
[INFO ] [GL ] OpenGL renderer <b’VideoCore IV HW’>
[INFO ] [GL ] OpenGL parsed version: 2, 0
[INFO ] [GL ] Shading version <b’OpenGL ES GLSL ES 1.00’>
[INFO ] [GL ] Texture max size <2048>
[INFO ] [GL ] Texture max units <8>
[INFO ] [Window ] virtual keyboard not allowed, single mode, not docked
[INFO ] [Text ] Provider: sdl2
2018-09-11 21:34:23+0200 [-] Log opened.
2018-09-11 21:34:24+0200 [-] Traceback (most recent call last):
2018-09-11 21:34:24+0200 [-] File “main.py”, line 1712, in
2018-09-11 21:34:24+0200 [-] WeatherFlowPyConsole().run()
2018-09-11 21:34:24+0200 [-] File “main.py”, line 180, in init
2018-09-11 21:34:24+0200 [-] Type = Dev[‘device_type’]
2018-09-11 21:34:24+0200 [-] KeyError: ‘device_type’

where is the error?

What firmware revision do you have everywhere ?