Helpdesk

Hallo.
Erstmal riesen lob an euer Project, der strompi 3 ist spitze.
nach längerem basteln habe ich bei meinem Pi3 schnittstellentechnisch alles hinbekommen.
neueste Firmware 1.41 ist drauf und läuft auch soweit ganz gut.
Jedoch musste ich alles von Hand eingeben da bei mir leider keines eurer Scripts fehlerfrei läuft.
glaube das da bei mir bestimmt ein Fehler im python3 ist.
nehmen wir mal das StromPi3_Status.py als Beispiel
gestartet mit python3 ./StromPi3_Status.py
Problem 1:
###################################################
raspberry@raspberry:~$ python3 ./StromPi3_Status.py
File "./StromPi3_Status.py", line 142
print ' '
^
SyntaxError: Missing parentheses in call to 'print'
raspberry@raspberry:~$
###################################################
dieses Problem konnte ich beheben
print ' '
print '---------------------------------'
print 'StromPi-Status:'
print '---------------------------------'
usw. ---->>> in
print (' ')
print ('---------------------------------')
print ('StromPi-Status:')
print ('---------------------------------')
so ist es auch in der strompi_config.py
###################################################
Problem 2:
###################################################
raspberry@raspberry:~$ python3 ./StromPi3_Status.py
Traceback (most recent call last):
File "./StromPi3_Status.py", line 85, in
serial_port.write('status-rpi')
File "/usr/lib/python3/dist-packages/serial/serialposix.py", line 518, in write
d = to_bytes(data)
File "/usr/lib/python3/dist-packages/serial/serialutil.py", line 58, in to_bytes
raise TypeError('unicode strings are not supported, please encode to bytes: %r' % (seq,))
TypeError: unicode strings are not supported, please encode to bytes: 'status-rpi'
raspberry@raspberry:~$
###################################################
dieses Problem konnte ich beheben
serial_port.write('status-rpi')
usw. ---->>> in
serial_port.write(str.encode("status-rpi"))
bei allen serial_port.write ein str.encode(     ……..      ) einfügen
so ist es auch in der strompi_config.py
###################################################
Problem 3:
###################################################
raspberry@raspberry:~$ python3 ./StromPi3_Status.py
Traceback (most recent call last):
File "./StromPi3_Status.py", line 109, in
sp3_ADC_Wide = float(serial_port.readline(9999))/1000;
ValueError: could not convert string to float:
raspberry@raspberry:~$
###################################################
dieses Problem konnte ich leider noch nicht beheben
pyhton ist nicht ganz meine programiersprache
###################################################
Problem 4:
###################################################
raspberry@raspberry:~$ python3 ./StromPi3_Status.py
Traceback (most recent call last):
File "./StromPi3_Status.py", line 115, in
date = int(sp3_date)
ValueError: invalid literal for int() with base 10: b"Command not recognised.  Enter 'help' to view a list of available commands.\r\n"
raspberry@raspberry:~$
###################################################
dieses Problem konnte ich leider noch nicht beheben
betrifft alle int() zeilen  zb. strompi_year = int(sp3_date) // 10000
###################################################
jetzt hoffe ich das es nur ein kleiner Fehler an meinem System lieg da die Skripts bei einigen Anderen zu funktionieren scheint.
getestet mit

  1. Raspbian Stretch with desktop and recommended Software

  2. Ubuntu MATE 16.04.2 (Xenial)




vielen Dank im voraus für eure Hilfe

Rico

06.01.19 23:51

Leider ist bei den anderen Scripts irgend einer der Fehler 3 und 4 vorhanden die ich noch nicht lösen konnte.

Rico

07.01.19 00:01

Hallo Rico,
tut mir leid für unsere etwas verspätete Antwort - die Scripts waren bislang (bis auf das Konfigurationsscript) alle noch in der Syntax von Python2 geschrieben und sollten mit dem Aufruf "sudo python xxx.py" problemlos funktionieren.
In den nächsten Tagen werden wir jedoch die Scripts an Python3 anpassen und neu hochladen.
Mit freundlichen Grüßen,
Jarek (Joy-IT)

Jens

11.01.19 11:47

Hallo,
das Problem 3 tritt leider auch bei mir auf und zwar sobald ich ein Firmware-Update ausführen möchte. Ausgegangen bin ich von python 2 und 3. Beide lösen den gleichen Fehler aus:
sp3_ADC_Wide = float(serial_port.readline(9999))/1000;
ValueError: could not convert string to float
Am Wide-Anschluss ist aktuell nichts angeschlossen, nur den Akku über GPIO hab ich an den Raspberry 3 angeschlossen.
Zugriff über die serielle Konsole habe ich leider auch keinen. minicom steht auf serial0 und die Baud-Rate ist ebenfalls auf den Wert 38400 eingestellt. Ich kann in minicom aber keine Eingaben machen bzw. blindlings kommt nach keine Reaktion.
Linux test 4.14.62-v7+ #1134 SMP Tue Aug 14 17:10:10 BST 2018 armv7l GNU/Linux

Lars

03.06.19 23:40

Hallo Lars,
um nochmal genauer auf deine Frage einzugehen: die Problematik taucht im Normalbetrieb auf oder wenn sich der StromPi 3 im Flash Modus (Flash Jumper umgesteckt) befindet?
In diesem nämlich ist keinerlei Kommunikation über die serielle Schnittstelle möglich und würde somit die Problematik erklären.
Mit freundlichen Grüßen,
Jaroslaw Ciszewski

Jens

04.06.19 17:34

Hi, I have the exact same problem with executing the python scripts. (could not convert string to float). I can communicate to the serial port because all else operates normal, and can start the strompiconsole as usual.
Trying to execute the script with sudo also does not work. Jumper and hardware configuration is correct. Is there an updated script available yet for python 3? Or a workaround?

Jamos

05.06.19 18:15

Hello Jamos,
First we recommend you to install the latest firmware and download the newest Scriptfolder, which got released today, from our homepage.
It is possible that you run into this error because the script is not made for your currently installed firmware version.
after the configuration you can start the script if you still run into errors remember that you  have to exit every existing serial connection before you run the script.
In minicom you can do this by typing "exit" in the strompi console and exit minicom by pressing "CTRL+X" then "A" and then "Yes".
If you dont exit minicom this way you will get the error "ValueError: could not convert string to float".
I hope this will help you.
Best regards
Jordan (Joy-IT)

Jordan

07.06.19 19:12

"In den nächsten Tagen werden wir jedoch die Scripts an Python3 anpassen und neu hochladen."
Wann sind diese "Tage" denn rum? Aktuell sind die Scripts noch auf python2

13.08.19 11:08