Go to advanced search

by Dangermoth
Mon Jun 22, 2020 3:15 pm
Forum: Beginners
Topic: Autostart issues
Replies: 27
Views: 1190

Re: Autostart issues

I tried

Code: Select all

nano /home/pi/.config/lxsession/LXDE-pi/autostart
earlier but came up with a new window which looked like it was ready to accept a new file so it did not recongnise the presence of my file,

Code: Select all

sudo nano /etc/xdg/lxsession/LXDE-pi/autostart
Just opened an empty editor.
by Dangermoth
Mon Jun 22, 2020 2:46 pm
Forum: Beginners
Topic: Autostart issues
Replies: 27
Views: 1190

Re: Autostart issues

So assuming I'm using an older version of stretch

Code: Select all

nano /home/pi/.config/lxsession/LXDE-pi/autostart
Somewhere in the above I would need to insert my new file 'weather_api.py'????

but surely first I would need to remove my old file 'truck_display.py' to stop that booting which I'm trying to find
by Dangermoth
Mon Jun 22, 2020 2:11 pm
Forum: Beginners
Topic: Autostart issues
Replies: 27
Views: 1190

Re: Autostart issues

I think I'm getting closer, if I type sudo nano truck_display.py /boot/config.txt The actual python code for my old application pops up in the window, so at least the file name is right. Why did you add /boot/config.txt after sudo nano truck_display.py? Not sure why you even mentioned config.txt ab...
by Dangermoth
Mon Jun 22, 2020 2:07 pm
Forum: Beginners
Topic: Autostart issues
Replies: 27
Views: 1190

Re: Autostart issues

Am I overcomplicating this or missing something? Surely the most common reason for buying an RPI is to run some sort of application at start-up such as in a headless configuration, should this not be the easiest thing in the world to do even for a simpleton like me :? I admit I'm an Arduino / pic gu...
by Dangermoth
Mon Jun 22, 2020 1:44 pm
Forum: Beginners
Topic: Autostart issues
Replies: 27
Views: 1190

Re: Autostart issues

I think I'm getting closer, if I type

Code: Select all

sudo nano truck_display.py /boot/config.txt
The actual python code for my old application pops up in the window, so at least the file name is right.
by Dangermoth
Mon Jun 22, 2020 1:29 pm
Forum: Beginners
Topic: Autostart issues
Replies: 27
Views: 1190

Re: Autostart issues

if I type sudo /home/pi/.config/lxsession/LXDE-pi/autostart I'm getting 'command not found' What am I missing?? What does the "/etc" mean that I keep seeing when using the text editor? I guess I'm hoping for some sort of list so I can find that last application that I so wish that I had no...
by Dangermoth
Mon Jun 22, 2020 12:42 pm
Forum: Beginners
Topic: Autostart issues
Replies: 27
Views: 1190

Re: Autostart issues

Older versions of Stretch used the local autostart here: /home/pi/.config/lxsession/LXDE-pi/autostart Shortly before the Buster release it was changed to the global autostart located here: /etc/xdg/lxsession/LXDE-pi/autostart Note that if the local autostart exists then the global autostart is igno...
by Dangermoth
Mon Jun 22, 2020 11:40 am
Forum: Beginners
Topic: Autostart issues
Replies: 27
Views: 1190

Re: Autostart issues

Ok thanks, so it looks like I'm running Stretch. So with that information any idea how I can get a list of autostart routines so that I can locate the no longer required python application that loads when the Pi is booted and remove it? EDIT, I have made a note of how to gain the operating info for...
by Dangermoth
Mon Jun 22, 2020 11:15 am
Forum: Beginners
Topic: Autostart issues
Replies: 27
Views: 1190

Re: Autostart issues

You are definitely not a disappointment, your help is greatly appreciated but I've generally found that after 90 odd people have read a thread and haven't replied then the chances are that no one knows the answer (unlikely) or I've posted my question in the wrong section. I recently posted a questio...
by Dangermoth
Mon Jun 22, 2020 10:35 am
Forum: Beginners
Topic: Autostart issues
Replies: 27
Views: 1190

Re: Autostart issues

Maybe I'm asking this in the wrong section?
by Dangermoth
Mon Jun 22, 2020 10:11 am
Forum: Beginners
Topic: Autostart issues
Replies: 27
Views: 1190

Re: Autostart issues

Ok thanks, so it looks like I'm running Stretch. So with that information any idea how I can get a list of autostart routines so that I can locate the no longer required python application that loads when the Pi is booted and remove it? EDIT, I have made a note of how to gain the operating info for ...
by Dangermoth
Mon Jun 22, 2020 9:47 am
Forum: Beginners
Topic: Autostart issues
Replies: 27
Views: 1190

Re: Autostart issues

OK that makes sense, I wanted to include the operating system to aid anyone helping.

Any idea how I can find this from the desktop? it doesn't appear very obvious.
by Dangermoth
Mon Jun 22, 2020 9:25 am
Forum: Beginners
Topic: Autostart issues
Replies: 27
Views: 1190

Autostart issues

Morning all, Just hoping someone can help with a hopefully simple issue. I wrote a pygame display application a year or so back and set it to autostart when the pi was booted, that particular application was abandoned as there was no way of doing a quite boot however the application would start and ...
by Dangermoth
Mon Nov 18, 2019 1:34 pm
Forum: Python
Topic: API request crashes if no internet
Replies: 2
Views: 308

Re: API request crashes if no internet

Thanks, that gives me a direction to pursue, I will investigate some sort of try-except routine, I've done this in the past with simple serial reading, not quite sure where to start with this one though.
by Dangermoth
Mon Nov 18, 2019 11:44 am
Forum: Python
Topic: API request crashes if no internet
Replies: 2
Views: 308

API request crashes if no internet

Morning all, I have a realy cool weather station running based on a Raspberry Pi and 7 inch touch screen, this programmed in Python 2 and displayed via Pygame. Details including code here: https://www.raspberrypi.org/forums/viewtopic.php?f=32&t=255791&p=1560189#p1560189 It works an absolute ...
by Dangermoth
Fri Nov 01, 2019 4:52 pm
Forum: Python
Topic: Python weather station storing min and max values
Replies: 18
Views: 1277

Re: Python weather station storing min and max values

Wow that appears to be working, is it because I needed to set the variables to -1000 and 1000? I can't see any other difference from what I've tried. I need to wait for the temperature to change to see if the values are being stored, Will give you an update on Monday. Thank you so much for your help
by Dangermoth
Fri Nov 01, 2019 4:13 pm
Forum: Python
Topic: Python weather station storing min and max values
Replies: 18
Views: 1277

Re: Python weather station storing min and max values

Currently working code but without min and max temp import forecastio import requests import pygame import math from pygame.locals import* pygame.init() pygame.font.init() #gameDisplay=pygame.display.set_mode ((795,445)) gameDisplay=pygame.display.set_mode ((800,450)) pygame.display.set_caption(&quo...
by Dangermoth
Fri Nov 01, 2019 3:45 pm
Forum: Python
Topic: Python weather station storing min and max values
Replies: 18
Views: 1277

Re: Python weather station storing min and max values

As per this? import forecastio import requests import pygame import math from pygame.locals import* pygame.init() pygame.font.init() gameDisplay=pygame.display.set_mode ((800,450)) pygame.display.set_caption("Paulas new weather station") clock = pygame.time.Clock() darkblue = (0,0,200) blu...
by Dangermoth
Fri Nov 01, 2019 3:30 pm
Forum: Python
Topic: Python weather station storing min and max values
Replies: 18
Views: 1277

Re: Python weather station storing min and max values

This is what I'm struggling with, what ever I set them to within the function will get set to that value every time the code loops, I have never managed to sucsessfully define a global value outside of a function as one can easily do in C. In this case python insists that I have not assigned the var...
by Dangermoth
Fri Nov 01, 2019 3:11 pm
Forum: Python
Topic: Python weather station storing min and max values
Replies: 18
Views: 1277

Re: Python weather station storing min and max values

I put bold tags around the bit of code I added so it would stand out in the post, its not actually part of my code. There is no code that access the variables outside of this function. I cut the code a bit short when I posed it so I missed the bit that's sets the min and max; def forcast(): api_key ...
by Dangermoth
Fri Nov 01, 2019 2:37 pm
Forum: Python
Topic: Python weather station storing min and max values
Replies: 18
Views: 1277

Re: Python weather station storing min and max values

def forcast(): api_key = "-----------------------------f" lat = 53.38 #lattidue lng = -1.22 #longditue forecast = forecastio.load_forecast(api_key,lat,lng) # send request current = forecast.currently() minutely = forecast.minutely() daily = forecast.daily() [b]global temp_max,temp_min[/b]...
by Dangermoth
Fri Nov 01, 2019 2:13 pm
Forum: Python
Topic: Python weather station storing min and max values
Replies: 18
Views: 1277

Re: Python weather station storing min and max values

Or to put it another way, how do I declare a global value within a function?

If I type' temp_max = 0' within the function this doesn't give a traceback error but the value is set to 0 every time the code loops.
by Dangermoth
Fri Nov 01, 2019 2:09 pm
Forum: Python
Topic: Python weather station storing min and max values
Replies: 18
Views: 1277

Re: Python weather station storing min and max values

Do I need to assign a value to the variable i.e 'temp_max = 0' if I declare the variable within the function?
by Dangermoth
Fri Nov 01, 2019 1:49 pm
Forum: Python
Topic: Python weather station storing min and max values
Replies: 18
Views: 1277

Python weather station storing min and max values

Afternoon chaps, a really basic question here. api weather station small.png I'm building a really cool weather station around a Raspberry Pi and getting data from Darksky by sending out an api call every 5 minutes and displaying the results using pygame. This is working really well however I would ...
by Dangermoth
Mon Dec 17, 2018 7:55 pm
Forum: Troubleshooting
Topic: [solved] touch very inaccurate under rc.local
Replies: 6
Views: 683

Re: [solved] touch very inaccurate under rc.local

Hey guys, the autostart thing works a treat, mouse calibration now spot on, many thanks for you help. :P

Go to advanced search