Code Monkey home page Code Monkey logo

Comments (49)

dodas425 avatar dodas425 commented on June 21, 2024 1

Thank you for your help!

from piweatherrock.

dodas425 avatar dodas425 commented on June 21, 2024 1

Thank you so much for the great help. I will be happy to test it out after work tonight and will get in touch! I wish you a nice day!

from piweatherrock.

genebean avatar genebean commented on June 21, 2024

Happy to help! First off, you don’t need sudo for this... it should run as the current user. To use sudo would actually require more environment settings. Second, can you tell me what operating system you are running? If on a Debian based system, did you use the directions in the readme including installing the extra libraries?

Sent with GitHawk

from piweatherrock.

dodas425 avatar dodas425 commented on June 21, 2024

Hello!
I´m running:
Distributor ID: Raspbian
Description: Raspbian GNU/Linux 9.1 (stretch)
Release: 9.1
Codename: stretch

Furthermore I installed all dependencies and got and used an API key from https://darksky.net/dev. Unfortunately, the script still doesn't work properly.

from piweatherrock.

genebean avatar genebean commented on June 21, 2024

Are you running it locally from your raspberry pi or from an ssh connection?

Sent with GitHawk

from piweatherrock.

genebean avatar genebean commented on June 21, 2024

Also, what does env | sort return?

Sent with GitHawk

from piweatherrock.

dodas425 avatar dodas425 commented on June 21, 2024

I´m running it from an ssh connection. I usually put it in the startup, so that when the Raspberry Pi's was powered up it should start.

from piweatherrock.

dodas425 avatar dodas425 commented on June 21, 2024

Also, what does env | sort return?

<-- What do you mean by that?

from piweatherrock.

genebean avatar genebean commented on June 21, 2024

Please run that command. As for running this over ssh, you have to export your display for that to work. Am I correct in assuming you are running the full version of Raspnian, aka not “Raspian Lite?”

Sent with GitHawk

from piweatherrock.

dodas425 avatar dodas425 commented on June 21, 2024

DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
HOME=/home/pi
LANG=de_DE.UTF-8
LOGNAME=pi
MAIL=/var/mail/pi
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/gam es:/usr/games
PWD=/home/pi
SHELL=/bin/bash
SHLVL=1
SSH_CLIENT=192.168.178.93 63177 22
SSH_CONNECTION=192.168.178.93 63177 192.168.178.102 22
SSH_TTY=/dev/pts/0
TERM=xterm
USER=pi
_=/usr/bin/env
XDG_RUNTIME_DIR=/run/user/1000
XDG_SESSION_ID=c3

from piweatherrock.

genebean avatar genebean commented on June 21, 2024

That’s what I was expecting. Your DISPLAY environment variable is not set. Me doing #10 will document that process. I’ll see about doing that when I get home tonight.

Sent with GitHawk

from piweatherrock.

dodas425 avatar dodas425 commented on June 21, 2024

I don't know which Rasbian version is installed (Lite or Full) ...?

from piweatherrock.

dodas425 avatar dodas425 commented on June 21, 2024

Good evening! Do you still have time to show me how to set the DISPLAY environment variable? best regards

from piweatherrock.

genebean avatar genebean commented on June 21, 2024

I just got home a little while ago. It’ll be later tonight but it is on my to do list still.

Sent with GitHawk

from piweatherrock.

genebean avatar genebean commented on June 21, 2024

@dodas425 check out the updated readme. It should get you taken care of as I have made this able to run as a service. Please let me know if that works or if you need more help.

from piweatherrock.

genebean avatar genebean commented on June 21, 2024

Just wanted to see how things went

from piweatherrock.

dodas425 avatar dodas425 commented on June 21, 2024

from piweatherrock.

dodas425 avatar dodas425 commented on June 21, 2024

from piweatherrock.

dodas425 avatar dodas425 commented on June 21, 2024

IMG_6361

from piweatherrock.

dodas425 avatar dodas425 commented on June 21, 2024

320x240

from piweatherrock.

genebean avatar genebean commented on June 21, 2024

Do you have FULLSCREEN set to true? Also, what kind of startup problems are you having?

Sent with GitHawk

from piweatherrock.

genebean avatar genebean commented on June 21, 2024

Also, what’s wrong with the time? Regarding using sudo, if you back up your config, delete your copy of the code, reclone it without sudo like the docs say, put your config back, and run the new install.sh it should start automatically.

Sent with GitHawk

from piweatherrock.

dodas425 avatar dodas425 commented on June 21, 2024

No! I have set the fullscreen to false. I'm going to change it tonight and set it to true.

from piweatherrock.

dodas425 avatar dodas425 commented on June 21, 2024

Doesn't it matter how big the icons are and are automatically adjusted to the resolution 320/240 if FULLSCREEN = True?

from piweatherrock.

dodas425 avatar dodas425 commented on June 21, 2024

OK, I'll go through these steps again tonight. Maybe I made a mistake and will report to you directly! Thank you!

from piweatherrock.

dodas425 avatar dodas425 commented on June 21, 2024

Are the attached icons also intended for 320/240 resolution?

from piweatherrock.

genebean avatar genebean commented on June 21, 2024

So, there are two sets of icons in the code. The non-full screen set of code sets things up assuming you have 480x320 display. When fullscreen is used it detects your display size and scales accordingly. Anything with a width less than 1024 gets the small icons as the big ones just take up too much room. The logic for this is here:

PiWeatherRock/weather.py

Lines 252 to 262 in d5e0ac1

if config.FULLSCREEN:
self.xmax = pygame.display.Info().current_w - 35
self.ymax = pygame.display.Info().current_h - 5
if (self.xmax <= 1024):
self.icon_size = '64'
else:
self.icon_size = '256'
else:
self.xmax = 480 - 35
self.ymax = 320 - 5
self.icon_size = '64'

If your display would look better with the 128x128 icons you are welcome to open a separte issue for that but I am not sure how fast I can get to setting them up. As the code above shows, I currently just have 64x64 and 256x256 icons.

from piweatherrock.

dodas425 avatar dodas425 commented on June 21, 2024

I now understand your explanation about config.FULLSCREEN. At home I test whether the smaller icons look good and give feedback! If the icons should be 128x128, I'll get back to a new issue

from piweatherrock.

dodas425 avatar dodas425 commented on June 21, 2024

Hi there! I have followed your installation instructions. Unfortunately it didn't work, so I entered weather.py in a launcher.sh, which in turn is loaded via .bashrc when the Raspberry pi is restarted.

from piweatherrock.

dodas425 avatar dodas425 commented on June 21, 2024

Unfortunately the wind speed is not shown completely. Do you know how I can adjust the font for humidity and feels like? I was able to adjust the icons to 64x64 pixels, but it would be nice if they could be positioned a little higher ... Do you have an idea? I have added 2 photos. Thanks in advance!

IMG_6367
IMG_6369

from piweatherrock.

dodas425 avatar dodas425 commented on June 21, 2024

Here is my modified script attached...
weather.zip

from piweatherrock.

dodas425 avatar dodas425 commented on June 21, 2024

The text on the info screen also doesn't fit perfectly :-(
IMG_6371

from piweatherrock.

genebean avatar genebean commented on June 21, 2024

I will look into this some this weekend but I think the root cause is that this isn’t setup for that low of a resolution display. I’ll see if I can get it looking better though.

Sent with GitHawk

from piweatherrock.

dodas425 avatar dodas425 commented on June 21, 2024

Oh, that's very nice of you! I'm glad

from piweatherrock.

genebean avatar genebean commented on June 21, 2024

FYI: I started a Gitter for this project to facilitate real time chats too. I’ll be in there a little later. https://gitter.im/PiWeatherRock/community

Sent with GitHawk

from piweatherrock.

genebean avatar genebean commented on June 21, 2024

FYI, I added some new info to he readme tonight and fixed a few bugs. I haven’t forgotten about your issue and hope to work on it this week.

from piweatherrock.

dodas425 avatar dodas425 commented on June 21, 2024

Hi there! Gitter is a nice idea! Very interesting. The weather project deserved something :)

from piweatherrock.

dodas425 avatar dodas425 commented on June 21, 2024

Thanks for the info, my dear. I am happy for every optimization. Thank you so much for your help!

from piweatherrock.

dodas425 avatar dodas425 commented on June 21, 2024

I don't want to ask too much, but it would be nice to be able to create the days in another language!

from piweatherrock.

genebean avatar genebean commented on June 21, 2024

Thanks! Regarding the language stuff, feel free to open a feature request

from piweatherrock.

dodas425 avatar dodas425 commented on June 21, 2024

OK thanks! I made that already :-)

from piweatherrock.

dodas425 avatar dodas425 commented on June 21, 2024

Hi, Gene! Did you get around to looking for my Python display problem (resolution 320x240) yet? Changing that value in line 253 of weather.py to 58 has compressed the display even more.

My Python script at this point is a bit different, if it should not look compressed:

os.environ["SDL_FBDEV"] = "/dev/fb1"
os.environ["SDL_MOUSEDEV"] = "/dev/input/event0"
os.environ["SDL_MOUSEDRV"] = "TSLIB"

    pygame.init()
    pygame.display.init()
    screen = pygame.display.set_mode((320, 240), 0, 32)

    size = (pygame.display.Info().current_w, pygame.display.Info().current_h)
    # print "Framebuffer Size: %d x %d" % (size[0], size[1])
    
    self.screen = pygame.display.set_mode(size, pygame.FULLSCREEN)
    # Clear the screen to start
    self.screen.fill((0, 0, 0))        
    # Initialise font support
    pygame.font.init()
    # Render the screen
    pygame.mouse.set_visible(0)
    pygame.display.update()
    #for fontname in pygame.font.get_fonts():
    #        print fontname
    self.xmax = 320
    self.ymax = 240
    self.icon_size = '64'
    self.subwindow_text_height = 0.070
    self.time_date_text_height = 0.149
    self.time_date_small_text_height = 0.075
    self.time_date_y_position = 0
    self.time_date_small_y_position = 30

    self.last_update_check = 0

from piweatherrock.

genebean avatar genebean commented on June 21, 2024

I ordered a 320x240 screen tonight so that I can dig into this.

Sent with GitHawk

from piweatherrock.

dodas425 avatar dodas425 commented on June 21, 2024

from piweatherrock.

dodas425 avatar dodas425 commented on June 21, 2024

Hi, are you a little bit programming on the new 320/240 display? Best wishes

from piweatherrock.

genebean avatar genebean commented on June 21, 2024

I tried but a it turned out my spare Pi was dead. I just got another zero w that I’m going to use but it’s going to be a few days til I’m able to start

Sent with GitHawk

from piweatherrock.

dodas425 avatar dodas425 commented on June 21, 2024

OK, I'm glad to see you're moving on. Good luck.

from piweatherrock.

genebean avatar genebean commented on June 21, 2024

@dodas425 I got my display the other day but had to work with the manufacturer to get to actually use the 320x240 resolution. This morning I finally have it working at that resolution so I can now start trying to debug your issue.

from piweatherrock.

dodas425 avatar dodas425 commented on June 21, 2024

That's very nice! Good luck. Good luck.

from piweatherrock.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.