Closed simeoncapy closed 11 months ago
No there is no reason I could think of why this should not work, so I assume this has something to do with the host OS. When run in a container (as root) this works just fine.
Ok, thanks, it removes one side of the problem then! So, I'll check the configuration of my RPi, python and so on.
I would not recommend to run scripts as root, but I am sure you are aware of that.
Sorry for the late reply! I know it's not good. But I have some scripts/libraries that need to be used with sudo on my Raspberry pi. I try to avoid it as much as possible.
I realised another stranger behaviour:
I run my code WITHOUT sudo, I cannot use the function update
:
AttributeError: 'WeatherStationData' object has no attribute 'update'
If I remove the update function, I can get my data.
If I run WITH sudo, I have to use the update function. If I don't use it, the station list is empty
defaultdict(<class 'dict'>, {})
Why the update
function behaves like that?
Please try with the latest version.
There has not been any update for over a year. I'm closing this now. Pleas reopen if this persists to be an issue or open a new issue.
Hello, I don't know if this problem is linked to pyatmo or my raspberry pi configuration. But when I try to access my weather station data, if I'm running the script without sudo, I get them. If I use sudo, I get an empty table. I installed pyatmo with and without sudo:
(sudo) pip3 install pyatmo
.When I call this line
print("\tWS-OBJ**** STATIONS " + str(self.weatherData.stations))
(weatherData
is apyatmo.WeatherStationData
object), I get the result below:Is there a reason the station is not responding in sudo mode?
Thanks in advance