×

INDI Library v2.0.6 is Released (02 Feb 2024)

Bi-monthly release with minor bug fixes and improvements

meteostationWEB no longer working due to python 3.8 on Ubuntu 20.04

  • Posts: 2247
  • Thank you received: 223
I was able to change all the "print" commands to "print()" but there are a few things I do not know how to fix, for example:

Traceback (most recent call last):
File "./meteoRRD_updater.py", line 12, in <module>
from indiclient import *
File "/home/heidenrod/meteostationWEB/indiclient.py", line 1002
raise Exception, "INDILigths are read only"
^
SyntaxError: invalid syntax
Starting GRAPHER
2020-09-13T13:24:56: Driver indi_duino: Indiduino driver start...
2020-09-13T13:24:56: Driver indi_duino: Building from /usr/share/indi/meteostation_sk.xml skeleton
2020-09-13T13:24:56: Driver indi_duino: Using INDISKEL /usr/share/indi/meteostation_sk.xml
2020-09-13T13:24:56: Driver indi_duino: No ISwitch 'ENABLED' in MeteoStation.DEVICE_AUTO_SEARCH
2020-09-13T13:24:56: Driver indi_duino: No ISwitch 'ENABLED' in MeteoStation.DEVICE_AUTO_SEARCH
Starting MinMax
('HR', 'Thr', 'IR', 'Tir', 'P', 'Tp', 'Dew', 'Light', 'T', 'clouds', 'skyT', 'cloudFlag', 'dewFlag', 'frezzingFlag')
(None, None, None, None, None, None, None, None, None, None, None, None, None, None)
('HR', 'Thr', 'IR', 'Tir', 'P', 'Tp', 'Dew', 'Light', 'T', 'clouds', 'skyT', 'cloudFlag', 'dewFlag', 'frezzingFlag')
(None, None, None, None, None, None, None, None, None, None, None, None, None, None)
('HR', 'Thr', 'IR', 'Tir', 'P', 'Tp', 'Dew', 'Light', 'T', 'clouds', 'skyT', 'cloudFlag', 'dewFlag', 'frezzingFlag')
(None, None, None, None, None, None, None, None, None, None, None, None, None, None)
Traceback (most recent call last):
File "./sounding.py", line 13, in <module>
from string import upper
ImportError: cannot import name 'upper' from 'string' (/usr/lib/python3.8/string.py)

Generating 3 hours graph
3 years 6 months ago #59857

Please Log in or Create an account to join the conversation.

  • Posts: 2247
  • Thank you received: 223
One that I cannot fix (yet)...
2020-09-13T14:36:10: Driver indi_duino: No ISwitch 'ENABLED' in MeteoStation.DEVICE_AUTO_SEARCH
Starting UPDATER
Traceback (most recent call last):
  File "./meteoRRD_updater.py", line 96, in <module>
    indi = indiclient(INDISERVER, INDIPORT)
  File "/home/heidenrod/meteostationWEB/indiclient.py", line 2569, in __init__
    bigindiclient.__init__(self,host,port)
  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
3 years 6 months ago #59863

Please Log in or Create an account to join the conversation.

  • Posts: 180
  • Thank you received: 30
module level string functions were eliminated in python 3. Just eliminate the import and use:
my_string_uppercase = my_string.upper()
3 years 6 months ago #59889

Please Log in or Create an account to join the conversation.

  • Posts: 2247
  • Thank you received: 223

thanks for the input, I was able to fix the upper one earlier today but not the one from my second message :(
3 years 6 months ago #59890

Please Log in or Create an account to join the conversation.

  • Posts: 180
  • Thank you received: 30

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.
The following user(s) said Thank You: Gonzothegreat
3 years 6 months ago #59893

Please Log in or Create an account to join the conversation.

  • Posts: 2247
  • Thank you received: 223
Thanks, now I'm getting the following


Traceback (most recent call last):
File "./meteoRRD_updater.py", line 100, in <module>
indi = indiclient("localhost", int(7625))
File "/home/heidenrod/meteostationWEB/indiclient.py", line 2569, in __init__
bigindiclient.__init__(self,host,port)
File "/home/heidenrod/meteostationWEB/indiclient.py", line 1987, in __init__
self.receive_event_queue=Queue.Queue()
NameError: name 'Queue' is not defined
3 years 6 months ago #59896

Please Log in or Create an account to join the conversation.

  • Posts: 180
  • Thank you received: 30
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()

If this does not work, I would need to give a look at the code. I need at least the module giving the error (indi client.py) or the url to the code.
Last edit: 3 years 6 months ago by Joaquin. Reason: Complete info
3 years 6 months ago #59900

Please Log in or Create an account to join the conversation.

  • Posts: 2247
  • Thank you received: 223
I've done as you said, now moving on to the next error...

<indiclient.indiclient object at 0xb6caeb80>
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
self.run()
File "/usr/lib/python3.8/threading.py", line 1254, in run
self.function(*self.args, **self.kwargs)
File "/home/heidenrod/meteostationWEB/indiclient.py", line 2138, in _receiver
self._receive()
File "/home/heidenrod/meteostationWEB/indiclient.py", line 2463, in _receive
self.expat.Parse( self.data,0)
File "../Modules/pyexpat.c", line 407, in StartElement
File "/home/heidenrod/meteostationWEB/indiclient.py", line 2532, in _start_element
obj=self._factory.create(name,attrs)
File "/home/heidenrod/meteostationWEB/indiclient.py", line 550, in create
return self.vectorclasses(attrs,inditag)
File "/home/heidenrod/meteostationWEB/indiclient.py", line 1213, in __init__
if attrs.has_key('message'):
AttributeError: 'dict' object has no attribute 'has_key'
Timeout MeteoStation DEVICE_PORT
Timeout MeteoStation DEVICE_PORT
Timeout MeteoStation DEVICE_PORT
Timeout MeteoStation DEVICE_PORT
Timeout MeteoStation DEVICE_PORT
Timeout MeteoStation DEVICE_PORT
Timeout MeteoStation DEVICE_PORT


the "Timeout MeteoStation DEVICE_PORT" is now scrolling quite fast...
3 years 6 months ago #59906

Please Log in or Create an account to join the conversation.

  • Posts: 2247
  • Thank you received: 223
If someone wants to have a go, the code is on my github repo github.com/Trigger-broom-289/indi-meteostation
3 years 6 months ago #59908

Please Log in or Create an account to join the conversation.

  • Posts: 2247
  • Thank you received: 223
Potentially solved !!!!
heidenrod@heidenrod-obs:~/meteostationWEB$ indi_weather: no process found
2020-09-14T08:03:29: startup: indi_weather -f /tmp/indi_weatherFIFO -p 7625 
2020-09-14T08:03:29: Driver indi_duino: Indiduino driver start...
2020-09-14T08:03:29: Driver indi_duino: Building from /usr/share/indi/meteostation_sk.xml skeleton
2020-09-14T08:03:29: Driver indi_duino: Using INDISKEL /usr/share/indi/meteostation_sk.xml
2020-09-14T08:03:29: Driver indi_duino: No ISwitch 'ENABLED' in MeteoStation.DEVICE_AUTO_SEARCH
2020-09-14T08:03:29: Driver indi_duino: No ISwitch 'ENABLED' in MeteoStation.DEVICE_AUTO_SEARCH
Starting internet data downloader
Retriving SKEW-T diagrams from: 10548
2020 09 1400
Fail to retrive internet data
Starting GRAPHER
Starting MinMax
('HR', 'Thr', 'IR', 'Tir', 'P', 'Tp', 'Dew', 'Light', 'T', 'clouds', 'skyT', 'cloudFlag', 'dewFlag', 'frezzingFlag')
(None, None, None, None, None, None, None, None, None, None, None, None, None, None)
MinMax FAIL
Starting UPDATER
Altitude= 310
Indi port= 7625
Indi server= localhost
<indiclient.indiclient object at 0xb6c0cb80>
CONNECT INDI Server host:localhost port:7625 device:MeteoStation
Generating 3 hours graph
Generating day graph
Generating weekly graph
Generating monthly graph
('HR', 'Thr', 'IR', 'Tir', 'P', 'Tp', 'Dew', 'Light', 'T', 'clouds', 'skyT', 'cloudFlag', 'dewFlag', 'frezzingFlag')
(None, None, None, None, None, None, None, None, None, None, None, None, None, None)
MinMax FAIL



Don't pay attention to the following lines as I had added them a long time ago for debugging

('HR', 'Thr', 'IR', 'Tir', 'P', 'Tp', 'Dew', 'Light', 'T', 'clouds', 'skyT', 'cloudFlag', 'dewFlag', 'frezzingFlag')
(None, None, None, None, None, None, None, None, None, None, None, None, None, None)
3 years 6 months ago #59910

Please Log in or Create an account to join the conversation.

  • Posts: 2247
  • Thank you received: 223
I need to find out what's going on with "Fail to retrive internet data" as I cannot get the new satellite image.
3 years 6 months ago #59911

Please Log in or Create an account to join the conversation.

  • Posts: 2247
  • Thank you received: 223
I am going to say that it's now working on Python 3.x
Will sort out the "Fail to retrive internet data" later on as it's not essential right now.
3 years 6 months ago #59914

Please Log in or Create an account to join the conversation.

Time to create page: 0.651 seconds