This morning I have been reading code from meteostation and I think at some moment I ran meteoRRD_updater with no crash (Ubuntu, py3).
In which conditions you got Out of memory. I see 'sshd' not sure what this means.

Read More...

As promised, a refurbished, shiny sounding.py (in a zip. The system doesnt allow me to attach a .py file)
Now everything works as I understood was expected.
File has been documented up to a level and code reformatted for robustness and efficiency.
I also ran a static code analysis (pylint):
The original file produced a global score of -8.93/10 :ohmy:
The refurbished file scored 9.85/10 :woohoo:

Read More...

I forgot:
I commented the tidy import because I do not have the tidy lib in my system, so I also nodified for example:

document = tidy.parseString(o)

to

document = o

This should be reverted in the code

Read More...

I got you code and had a look at it.
The code is not excellent and has some design and gramatical problems.
The "Fail to retrieve internet data" comes from sounding.py.
First, urllib library has changed a lot. You had to modify the imports to this:

#import tidy
import datetime
import time
import locale
from string import *
from urllib.error import HTTPError
from urllib.parse import urlencode
from urllib.request import urlopen, urlretrieve, Request

and then substitute in the code correspondingly.

There are also some problems with opening the URLs. For example the uwyoClass class method should read:

def get_sounding_skewt(self):
data = {"region": "europe", "TYPE": "GIF:SKEWT", "YEAR": self.YEAR,
"MONTH": self.MONTH, "FROM": self.FROM, "TO": self.FROM, "STNM": SOUNDINGSTATION}

params = urlencode(data)
req = Request(url=' weather.uwyo.edu/cgi-bin/sounding?%s ' % params)
s = urlopen(req)
o = s.read()
s.close()
document = o
urlretrieve(" weather.uwyo.edu/upperair/images/ " + self.YEAR +
self.MONTH + self.FROM + ".08221.skewt.gif", CHARTPATH + "skewt.gif")


Then, here there is another problem I has stopped on because I have to go for launch :)
The problem is that the URL build to retrieve the weather picture (for example " weather.uwyo.edu/upperair/images/2020091412.08221.skewt.gif " points to a document that simply doesnt exists...
So the URL must be changed, but now I am not sure what the program is looking for. I need some time to learn about the objective of this section of the code.
Due to other duties (like going to work) I can not continue reviewing the code right now but I could do it in two days if you can wait for so long.
I like to review python code, so I do it willingly.

Read More...

if attrs.has_key('message'):

In Python 3, dictionaries changed a lot. Now is easier, change the line above to:

if 'message' in attrs:

Read More...

Not sure, but Queue (the first one in Queue.Queue) could be a module name (check in imports). In py3 module names should be always in lowercase.
So wherever you see
import Queue

change it for:
import queue

and then:
self.receive_event_queue = queue.Queue()

Read More...

Joaquin replied to the topic 'Wifi Issues' in the forum. 1 week ago

Hi Mohamed,
I am just trying to get it clear because I plan to extent the coverage of my raspi wifi and I am very lost when it comes to network settings:

- Your router is connected to the Raspi via ethernet cable. Is that right ?
- Is the raspi in hotspot mode?. Or maybe when communicating via ethernet cable->router, this concept does not exist ?
- I understand your raspi is communicating through two different windows: its own network and the home wifi network, So you have access to internet while also communicating through its private network, at the same time. Is this correct ?

thanks

Read More...

Gonzothegreat wrote: One that I cannot fix (yet)...

<code> File "/home/heidenrod/meteostationWEB/indiclient.py", line 1986, in __init__
self.socket.send("<getProperties version='1.5'/>")
TypeError: a bytes-like object is required, not 'str'
Starting MinMax</code>


You are sending a string through the socket. In py3 you must send bytes.
Try (just add a ‘b’):

self.socket.send(b"<getProperties version='1.5'/>")

This works for literals, for other objects you need to .encode() them.

Read More...

module level string functions were eliminated in python 3. Just eliminate the import and use:
my_string_uppercase = my_string.upper()

Read More...