iSpindel - Lokaler Server - iSpindle.py

Midyr
Posting Klettermax
Posting Klettermax
Beiträge: 134
Registriert: Donnerstag 7. März 2019, 13:01

Re: iSpindel - Lokaler Server - iSpindle.py

#651

Beitrag von Midyr »

JackFrost hat geschrieben: Samstag 21. März 2020, 17:44
Midyr hat geschrieben: Samstag 21. März 2020, 17:32
JackFrost hat geschrieben: Mittwoch 18. März 2020, 23:03 Ich hab den Server auf Debain Buster auf einer virtuellen x64 Maschine getestet.
Es braucht drei dev libs. Aber der Server läuft dann.

Die Config ist ein einer Datei und kann aktuell über die Webseite nicht geändert werden.
Auch ein start/stop script hab ich noch nicht. Aktuell läuft der Server bei mir in einem Screen.

Hat jemand interesse die C++ Variante zu testen ?

Gruß JackFrost
Hallo Jack,

gibt's deinen Server irgendwo als Repo?

Da ich keinen Raspi, sondern einen normalen Gentoo-Server nutze, passt dein weiter unten gepostete Paktel leider nicht, bekomme es aber vll mit selbst kompilieren hin.

Gruß

Midyr
Ich hab auch Gentoo :)

Ich hab den Server noch nicht im Repo, will noch ein paar Sachen verbessern und dann wird er auf Git sein.

Da sind das folgende Pakete :

Code: Alles auswählen

dev-cpp/yaml-cpp
net-misc/curl
dev-db/mariadb-connector-c
Ich hab das Projekt als VS Comunity 2019 und schreibe unter Windows und compiliere direkt auf der Zielarchitektur.
Hast du das VS installiert, dann kann ich dir den Projektorder schicken.
Ansonsten kann ich für arm, arm64 und x64 compilieren.

Gruß JackFrost
Leider klappts nicht. Scheinbar passt die libcurl-gnutls und/oder die Config nicht.

Naja, ich warte mal aufs git.

Midyr
JackFrost
Posting Freak
Posting Freak
Beiträge: 2983
Registriert: Dienstag 15. Mai 2018, 18:10

Re: iSpindel - Lokaler Server - iSpindle.py

#652

Beitrag von JackFrost »

Midyr hat geschrieben: Sonntag 22. März 2020, 11:57
Leider klappts nicht. Scheinbar passt die libcurl-gnutls und/oder die Config nicht.

Naja, ich warte mal aufs git.

Midyr
Ich werd es die nächsten Tage auf get hochladen. Ich teste es gerade mal an einer virtuellen Gentoo x64 Maschine.

Ich hab den Tooltip von meiner neuen Seite noch überarbeitet und werde das dann auf meinen Repo laden und dann
eine Pull Request starten.
Tooltip.png
Tooltip.png (5.69 KiB) 112874 mal betrachtet
Gruß JackFrost
Meine Hardware:
eManometer
IDS2 ohne CBPi
Magnetrührer
Ss-Brewtech 10 Gal Topf
IDS2 Induktionsplatte
JackFrost
Posting Freak
Posting Freak
Beiträge: 2983
Registriert: Dienstag 15. Mai 2018, 18:10

Re: iSpindel - Lokaler Server - iSpindle.py

#653

Beitrag von JackFrost »

Ich hab die C++ Version auf Github geladen.

https://github.com/JackFrost80/Brewserver/tree/Beta

Gruß JackFrost
Meine Hardware:
eManometer
IDS2 ohne CBPi
Magnetrührer
Ss-Brewtech 10 Gal Topf
IDS2 Induktionsplatte
Benutzeravatar
panpat
Posting Junior
Posting Junior
Beiträge: 38
Registriert: Samstag 7. März 2020, 13:55
Wohnort: Spreitenbach
Kontaktdaten:

Re: iSpindel - Lokaler Server - iSpindle.py

#654

Beitrag von panpat »

JackFrost hat geschrieben: Samstag 21. März 2020, 17:20 Auf der Webseite steht das wenn kein Prozess gefunden wird.
Hast du nochmal per SSH geschaut ob was auf dem Port läuft ?

Du kannst mit

Code: Alles auswählen

cat /etc/os-release
Die Version vom Rasperian auslesen.
Wenn du möchtest kannst du die C++ Version mal testen, da müsstest du ein paar Pakete installieren und derzeit geht nur MySQL und Ubidots.
Ich brauch dazu dann die OS Version, damit ich dir die richtige Version geben kann

Gruß JackFrost
Danke,
Ich versuche das nächste Woche mal rauszukriegen.
Hast du denn auch eine Readme wo alles drin steht?
Wer kein Bier hat, hat nichts zu trinken. Martin Luther
Benutzeravatar
panpat
Posting Junior
Posting Junior
Beiträge: 38
Registriert: Samstag 7. März 2020, 13:55
Wohnort: Spreitenbach
Kontaktdaten:

Re: iSpindel - Lokaler Server - iSpindle.py

#655

Beitrag von panpat »

es zeigt mir Version 10 an
Wer kein Bier hat, hat nichts zu trinken. Martin Luther
Benutzeravatar
panpat
Posting Junior
Posting Junior
Beiträge: 38
Registriert: Samstag 7. März 2020, 13:55
Wohnort: Spreitenbach
Kontaktdaten:

Re: iSpindel - Lokaler Server - iSpindle.py

#656

Beitrag von panpat »

also das mit deine Post #615 habe ich nun auch probiert, hat nichts gebracht. Auch der Befehl fuser -v 9501/tcp resp. dann 9502/tcp hat keinen Output gebracht.
Ich kappiers wirklich nicht.
Ist die Installation deines C++ Server schwierig? Für so Diletanten wie mich?
Wer kein Bier hat, hat nichts zu trinken. Martin Luther
JackFrost
Posting Freak
Posting Freak
Beiträge: 2983
Registriert: Dienstag 15. Mai 2018, 18:10

Re: iSpindel - Lokaler Server - iSpindle.py

#657

Beitrag von JackFrost »

panpat hat geschrieben: Montag 23. März 2020, 21:50 also das mit deine Post #615 habe ich nun auch probiert, hat nichts gebracht. Auch der Befehl fuser -v 9501/tcp resp. dann 9502/tcp hat keinen Output gebracht.
Ich kappiers wirklich nicht.
Ist die Installation deines C++ Server schwierig? Für so Diletanten wie mich?
Es ist eigentlich ganz einfach :Smile
Der Server an sich ist nich in der Beta phase.

Ich muss noch wissen ob du ein 32 oder 64 Bit Linux auf dem Raspi hast.

Dazu bitte am Raspi

Code: Alles auswählen

uname -a
eingeben und den Text hier posten.

Bei meinem Gentoo 64 Bit lautet der Text :

Code: Alles auswählen

Linux ThePlant_V2 4.19.76-v8-da7190d00893-p4+ #1 SMP PREEMPT Tue Oct 8 13:35:46 GMT 2019 aarch64 GNU/Linux
Du musst die folgenden Pakete installieren

Code: Alles auswählen

sudo apt-get install libcurl4-gnutls-dev
sudo apt-get install libyaml-cpp-dev
sudo apt-get install libmariadb-dev
sudo apt-get install screen
Die ersten drei sind für die Libs die das Programm braucht. Das vierte ist damit der Server auch läuft wenn das Terminal geschlossen ist.

Dann musst du die Verzeichnisse für die Config Datei anlegen :

Code: Alles auswählen

sudo mkdir /etc/conf.d
sudo mkdir /etc/conf.d/brewserver
Danach müssen die beiden Dateien die ich dann Poste per SFTP auf den Raspi gebracht werden. Der Filezilla sollte das können, als kostenloses Programm.

Dann muss die config kopiert und so abgeändert werden das sie auf die Datenbank passt :

Code: Alles auswählen

cd ~
sudo cp config.yaml /etc/conf.d/brewserver
sudo nano -w /etc/conf.d/brewserver/config.yaml
Wenn die nötigen Änderungen erfolgt sind, dann mit CTRL+x den Editor beenden und mit j oder y das speichern bestätigen.

Dann wieder in das home Verzeichnis vom user gehen und den Server im Screen starten :

Code: Alles auswählen

cd~
screen
./Brewserver.out
Danach sollte der Server laufen wenn der Port der in der Configdatei genannt wurde frei ist.

Bei Fragen kannst du auch gerne auf meinen Discord kommen, ich kann dir da den link geben.

Gruß JackFrost
Meine Hardware:
eManometer
IDS2 ohne CBPi
Magnetrührer
Ss-Brewtech 10 Gal Topf
IDS2 Induktionsplatte
Benutzeravatar
panpat
Posting Junior
Posting Junior
Beiträge: 38
Registriert: Samstag 7. März 2020, 13:55
Wohnort: Spreitenbach
Kontaktdaten:

Re: iSpindel - Lokaler Server - iSpindle.py

#658

Beitrag von panpat »

Output zu uname -a:
Linux raspberrypi 4.19.50-v7+ #896 SMP Thu Jun 20 16:11:44 BST 2019 armv7l GNU/Linux
Wer kein Bier hat, hat nichts zu trinken. Martin Luther
Benutzeravatar
panpat
Posting Junior
Posting Junior
Beiträge: 38
Registriert: Samstag 7. März 2020, 13:55
Wohnort: Spreitenbach
Kontaktdaten:

Re: iSpindel - Lokaler Server - iSpindle.py

#659

Beitrag von panpat »

ich habe noch folgendes bemerkt als ich mich imphpMyAdmin eingeloggt habe. Unten steht in einem roten Feld folgendes:

Der phpMyAdmin-Konfigurationsspeicher ist nicht vollständig konfiguriert, einige erweiterte Funktionen wurden deaktiviert. Finden Sie heraus warum.
Oder wechseln Sie in einer beliebigen Datenbank zum Tab „Operationen“, um die Einstellung dort vorzunehmen.

Könnte das auch das Problem sein?
Wer kein Bier hat, hat nichts zu trinken. Martin Luther
Benutzeravatar
panpat
Posting Junior
Posting Junior
Beiträge: 38
Registriert: Samstag 7. März 2020, 13:55
Wohnort: Spreitenbach
Kontaktdaten:

Re: iSpindel - Lokaler Server - iSpindle.py

#660

Beitrag von panpat »

doofe Frage, da der Server nun wieder läuft auch nach dem reboot und shutdown: beim IP Bereich habe ich jetzt wieder auf 0.0.0.0 gewechselt. Vorher hatte 255.255.255.0
Wer kein Bier hat, hat nichts zu trinken. Martin Luther
JackFrost
Posting Freak
Posting Freak
Beiträge: 2983
Registriert: Dienstag 15. Mai 2018, 18:10

Re: iSpindel - Lokaler Server - iSpindle.py

#661

Beitrag von JackFrost »

panpat hat geschrieben: Donnerstag 26. März 2020, 23:18 doofe Frage, da der Server nun wieder läuft auch nach dem reboot und shutdown: beim IP Bereich habe ich jetzt wieder auf 0.0.0.0 gewechselt. Vorher hatte 255.255.255.0
DIe muss auf 0.0.0.0 stehen, damit reagiert der Server auf alle IPs die ihn anfragen. Bei 255.255.255.0 dürften nur Anfragen aus dem Netz 255.255.255.0/24 beantwortet haben. Das ist aber keine Adresse aus deinem Netzwerk.

Dies darf nicht mit der Subnetzmaske verwechselt werden die bei dem Netz 255.255.255.0 sein muss, aber nichts mit dem Server zu tun hat.

Gruß Jackfrost
Meine Hardware:
eManometer
IDS2 ohne CBPi
Magnetrührer
Ss-Brewtech 10 Gal Topf
IDS2 Induktionsplatte
Benutzeravatar
panpat
Posting Junior
Posting Junior
Beiträge: 38
Registriert: Samstag 7. März 2020, 13:55
Wohnort: Spreitenbach
Kontaktdaten:

Re: iSpindel - Lokaler Server - iSpindle.py

#662

Beitrag von panpat »

Dann war das das Problem?
In der Tat habe ich das mit der Subnetmaske interpretiert
Wer kein Bier hat, hat nichts zu trinken. Martin Luther
JackFrost
Posting Freak
Posting Freak
Beiträge: 2983
Registriert: Dienstag 15. Mai 2018, 18:10

Re: iSpindel - Lokaler Server - iSpindle.py

#663

Beitrag von JackFrost »

panpat hat geschrieben: Freitag 27. März 2020, 14:51 Dann war das das Problem?
In der Tat habe ich das mit der Subnetmaske interpretiert
Vermutlich, der Server hat keine Verbindung von deinem Netzwerk akzeptiert.

Gruß JackFrost
Meine Hardware:
eManometer
IDS2 ohne CBPi
Magnetrührer
Ss-Brewtech 10 Gal Topf
IDS2 Induktionsplatte
Benutzeravatar
panpat
Posting Junior
Posting Junior
Beiträge: 38
Registriert: Samstag 7. März 2020, 13:55
Wohnort: Spreitenbach
Kontaktdaten:

Re: iSpindel - Lokaler Server - iSpindle.py

#664

Beitrag von panpat »

dann wäre das ein Punkt für deinen Leitfaden, wenn etwas nicht läuft
Wer kein Bier hat, hat nichts zu trinken. Martin Luther
mrhyde
Posting Senior
Posting Senior
Beiträge: 468
Registriert: Mittwoch 7. Juni 2017, 14:16

Re: iSpindel - Lokaler Server - iSpindle.py

#665

Beitrag von mrhyde »

Hallo,

ich arbeite gerade an einer Funktion, um auch alte Sude im TCP Server darstellen zu können. Man kann dann die Sude auswählen und sie werden aus der Datenbank geladen. Derzeit sind hier mal die im Server berechneten Plato Werte dargestellt. Oben links im Diagramm kann man den entsprechendne Sud auswählen.
Archive_Diagram.PNG
Dazu wird in der Daten Tabelle eine Spalte mit Recipe_ID angelegt. Hier habe ich die Migration der Tabelle als script in die index.php integriert. Es wird nachgesehen, ob die Tabelle die entsprechenden Spalten hat und falls nicht, wir der migrationsbbutton angezeigt. Die Tabelle wird dann automatisch migriert und die Werte für reicpe_id hineingeschrieben. Der Wert wird erhöht, wenn ein Reset erfolgt ist
data_table_new.PNG
Parallel wir eine Archiv Tabelle mit einem angelegt. Darüber kann man im Diagramm dann die sude auswählen. Hier werden auch die aktuellen kalibrierdaten des Sudes reingeschrieben.
Archive_table.PNG
das Ispindle.py script habe ich angepasst, so dass der aktuelle Index für die SPindel mitgeschrieben wird. Die resetfunktion legt jeweils einen neinen Eintrag im Archive Table an.

Das ganze ist jetzt im Anfangsstadium und ich kann nicht sagen, wie das für andere Devices aussehen wird. Sobald ich was brauchbares habe, lade ich das in mein Repo.
Braumeister 20 | Gärung: SS Brewtech 7 Gal BME | Speidel 30 Liter (Konus)
https://github.com/PiBrewing
https://openbrewing.gitbook.io/craftbeerpi4_support/
Benutzeravatar
McMelloW
Posting Junior
Posting Junior
Beiträge: 60
Registriert: Montag 30. Dezember 2019, 20:36
Wohnort: Harderwijk, Nederland

Re: iSpindel - Lokaler Server - iSpindle.py

#666

Beitrag von McMelloW »

Das klingt sehr schön, ich bin neugierig auf das Endergebnis. Viel Glück bei der weiteren Programmierung
Regards McMelloW
JackFrost
Posting Freak
Posting Freak
Beiträge: 2983
Registriert: Dienstag 15. Mai 2018, 18:10

Re: iSpindel - Lokaler Server - iSpindle.py

#667

Beitrag von JackFrost »

mrhyde hat geschrieben: Sonntag 5. April 2020, 17:15 Hallo,

ich arbeite gerade an einer Funktion, um auch alte Sude im TCP Server darstellen zu können. Man kann dann die Sude auswählen und sie werden aus der Datenbank geladen. Derzeit sind hier mal die im Server berechneten Plato Werte dargestellt. Oben links im Diagramm kann man den entsprechendne Sud auswählen.
Archive_Diagram.PNG

Dazu wird in der Daten Tabelle eine Spalte mit Recipe_ID angelegt. Hier habe ich die Migration der Tabelle als script in die index.php integriert. Es wird nachgesehen, ob die Tabelle die entsprechenden Spalten hat und falls nicht, wir der migrationsbbutton angezeigt. Die Tabelle wird dann automatisch migriert und die Werte für reicpe_id hineingeschrieben. Der Wert wird erhöht, wenn ein Reset erfolgt ist
data_table_new.PNG
Parallel wir eine Archiv Tabelle mit einem angelegt. Darüber kann man im Diagramm dann die sude auswählen. Hier werden auch die aktuellen kalibrierdaten des Sudes reingeschrieben.
Archive_table.PNG

das Ispindle.py script habe ich angepasst, so dass der aktuelle Index für die SPindel mitgeschrieben wird. Die resetfunktion legt jeweils einen neinen Eintrag im Archive Table an.

Das ganze ist jetzt im Anfangsstadium und ich kann nicht sagen, wie das für andere Devices aussehen wird. Sobald ich was brauchbares habe, lade ich das in mein Repo.
Ich würde Ostern die Änderungen für das eManometer einpflegen und dann einen Pull request stellen.

Gruß JackFrost
Meine Hardware:
eManometer
IDS2 ohne CBPi
Magnetrührer
Ss-Brewtech 10 Gal Topf
IDS2 Induktionsplatte
mrhyde
Posting Senior
Posting Senior
Beiträge: 468
Registriert: Mittwoch 7. Juni 2017, 14:16

Re: iSpindel - Lokaler Server - iSpindle.py

#668

Beitrag von mrhyde »

JackFrost hat geschrieben: Sonntag 5. April 2020, 20:31

Ich würde Ostern die Änderungen für das eManometer einpflegen und dann einen Pull request stellen.

Gruß JackFrost
Hi,
die Datenbankänderungen sind eigentlich soweit fertig. Ich muss nur noch einen link auf die Indexseite bringen, um die Archivseite zu laden. Diese muss ich dann noch optimieren und ein paar weitere Abfragen für das Archiv einbauen.

Eine solche Version kann ich morgen oder übermorgen mal in mein Repo hochladen. Ich habe halt noch kein emanometer. Somit kann ich dass nicht testen.

Gruß,
Alex
Braumeister 20 | Gärung: SS Brewtech 7 Gal BME | Speidel 30 Liter (Konus)
https://github.com/PiBrewing
https://openbrewing.gitbook.io/craftbeerpi4_support/
Benutzeravatar
Tozzi
Moderator
Moderator
Beiträge: 4768
Registriert: Montag 22. Februar 2016, 23:17
Wohnort: Fasano (BR) - Puglia - IT

Re: iSpindel - Lokaler Server - iSpindle.py

#669

Beitrag von Tozzi »

Hi Alex,

ich verweise in meinem README jetzt offiziell auf Deinen Fork.
Ich hoffe, das geht OK so. Ich kann leider aktuell nichts mehr beitragen.

Auf dieses Projekt hier möchte ich nochmal hinweisen:
https://github.com/DottoreTozzi/TiltPySpindel

Das ist sozusagen ein "Plugin" für die TILT Hydrometer (die ja per Bluetooth funken) und läuft separat.
Es bedient sich derselben TCP Schnittstelle wie die iSpindel, sollte also auch mit JackFrost's C++ Variante funktionieren.
Ich schau mal ob ich das noch auf Python3 umstelle demnächst.
Viele Grüße aus Fasano
Stephan
mrhyde
Posting Senior
Posting Senior
Beiträge: 468
Registriert: Mittwoch 7. Juni 2017, 14:16

Re: iSpindel - Lokaler Server - iSpindle.py

#670

Beitrag von mrhyde »

So,

ich habe noch eine weitere Spalte in den Data table eingefügt, der für interne flags genutzt wird.

Das ganze ist jetzt als Beta mal in meinem Repo zu finden.

Zunächst solltet ihr die Strings tabelle über die index.php Seite unter Experteneinstellungen auf Version 002 aktualisieren.

Dann ist unter den experten Settings ein button upgrade data table zu sehen.

Hier wird eine Funktion gestartet, der den Data Table anpasst und 3 Spalten ergänzt. Danach setzt er für jeden Reset pro Spindel eine Recipe_ID und scrhreibt diese in die Tabelle.

Dann wird noch eine Archive Tabelle angelegt, wo die einzelnen Sude mit Recipe_ID, Name, Spindel und nun aktueller Kalibrierung pro Spindel angelegt werden.

Diese kann man dann im Archive.php file, dass man über die index Seite aufrufen kann auswählen. Derzeit geht nur der berechnete Extrakt. Aber da kommt noch mehr zur Auswahl.

Die Funktion Gärbeginn setzten legt nun auch in der Archive Tabelle eine neue Zeile für den ud mit einer steigenden Recipe ID an. Diese wird dann für den aktuellen sud auch in die Datentabelle über das python script geschrieben.

Wenn der Sud nun vergoren ist, kann man über die index.php das Gärende setzen und es wird ein flag in die Internal Spalte geschrieben. Im Archiv werden die Suda dann nur bis zu diesem Flag angezeigt. Wenn ihr also den nächstne Sud vergären wollt und die Spindel z.B. erst einmal verbindet und irgendwo zum 'Desinfizieren' reinlegt während sie bereits sendet, dann könnt ihr nach der Zugabe in den Gärbehälter den neuen Gärbegin setzen. Dann wird erst der neue Sud angelegt.

Einfach mal probierne.

ABER bitte erst ein Backup eurer Datentabelle durchführen. Das geht ja über die Settings page.
Braumeister 20 | Gärung: SS Brewtech 7 Gal BME | Speidel 30 Liter (Konus)
https://github.com/PiBrewing
https://openbrewing.gitbook.io/craftbeerpi4_support/
Benutzeravatar
McMelloW
Posting Junior
Posting Junior
Beiträge: 60
Registriert: Montag 30. Dezember 2019, 20:36
Wohnort: Harderwijk, Nederland

Re: iSpindel - Lokaler Server - iSpindle.py

#671

Beitrag von McMelloW »

Hello Alex,

Thank you for the upgrade. This is exact what I was looking for.

Today I tried the beta on my Raspberry. Override the whole folder with your code.

Code: Alles auswählen

git fetch --all
git reset --hard origin/master
After pressing the update button a screen appears with the line: Latest Version installed:2
The Strings tabel is Upgrade, because I see a record version 002 (New = 139 records Old = 118 records)
However the Data Table is not extended with 3 new columns and the Archive Table is not created.
When press the button Archiv Lade the line Table 'iSpindle.Archive' doesn't exist shows up.
Regards McMelloW
mrhyde
Posting Senior
Posting Senior
Beiträge: 468
Registriert: Mittwoch 7. Juni 2017, 14:16

Re: iSpindel - Lokaler Server - iSpindle.py

#672

Beitrag von mrhyde »

McMelloW hat geschrieben: Donnerstag 9. April 2020, 17:29 After pressing the update button a screen appears with the line: Latest Version installed:2
The Strings tabel is Upgrade, because I see a record version 002 (New = 139 records Old = 118 records)
However the Data Table is not extended with 3 new columns and the Archive Table is not created.
When press the button Archiv Lade the line Table 'iSpindle.Archive' doesn't exist shows up.
Once the strings table is upgraded you need to go into expert settings again and choose 'Upgrade data table'

There should be another button under expert settings as long as you have not upgraded the data table.
upgrade data table.PNG
Braumeister 20 | Gärung: SS Brewtech 7 Gal BME | Speidel 30 Liter (Konus)
https://github.com/PiBrewing
https://openbrewing.gitbook.io/craftbeerpi4_support/
Benutzeravatar
McMelloW
Posting Junior
Posting Junior
Beiträge: 60
Registriert: Montag 30. Dezember 2019, 20:36
Wohnort: Harderwijk, Nederland

Re: iSpindel - Lokaler Server - iSpindle.py

#673

Beitrag von McMelloW »

mrhyde hat geschrieben: Donnerstag 9. April 2020, 19:45 Once the strings table is upgraded you need to go into expert settings again and choose 'Upgrade data table'

There should be another button under expert settings as long as you have not upgraded the data table.
Problem solved.

I have use it at full screen, otherwise the upgrade button is on the same position as the word Hilfe. Then the button does not work.
After enlarge it to full screen it worked OK. Data table is extended with 3 columns and the Archive Table is created.

Clicking on the Load Archive Button shows a recipe fermented in January 2020. See printscreen below
Archive-1.png
This is a great improvement. I will 'dry' test it in the coming days with two different iSpindels and different recipes.
Looking forward for the other screens as well
Regards McMelloW
mrhyde
Posting Senior
Posting Senior
Beiträge: 468
Registriert: Mittwoch 7. Juni 2017, 14:16

Re: iSpindel - Lokaler Server - iSpindle.py

#674

Beitrag von mrhyde »

McMelloW hat geschrieben: Donnerstag 9. April 2020, 20:34
This is a great improvement. I will 'dry' test it in the coming days with two different iSpindels and different recipes.
Looking forward for the other screens as well
And there is more to come...
If you have unwanted data_points at the end of your selected fermentation archive like this since you did the reset a couple of days or weeks later:
archive_not_wanted_data_points.PNG
You will be able to select a datapoint in the diagram:
artchive_select_end.PNG
And send a flag to the database to show only the data of interest:
archive_with_end_flag.PNG
I will also add the possibility to add comments durning fermentation. They will be shown as annotation in the diagram. But these functions will take some time. The archive diagramm will also be more flexible to show also other data. This is just the starting point. I will also add the CSV export function that is alsready included in some other diagrams.

It is just the starting point. Please give me some time.

Stay healthy,
Alex
Braumeister 20 | Gärung: SS Brewtech 7 Gal BME | Speidel 30 Liter (Konus)
https://github.com/PiBrewing
https://openbrewing.gitbook.io/craftbeerpi4_support/
Benutzeravatar
McMelloW
Posting Junior
Posting Junior
Beiträge: 60
Registriert: Montag 30. Dezember 2019, 20:36
Wohnort: Harderwijk, Nederland

Re: iSpindel - Lokaler Server - iSpindle.py

#675

Beitrag von McMelloW »

Hi Alex,

It looks all great.

At this moment, I can not contact the iSpindels with my TCP-Server. Do not see any iSpindels active in the Home page or updates in the Data Table.
I guess I have overwritten iSpindle_config.ini & iSpindle_deafault.ini with the update. Are there any other place where the user-id/password is stored.
Regards McMelloW
mrhyde
Posting Senior
Posting Senior
Beiträge: 468
Registriert: Mittwoch 7. Juni 2017, 14:16

Re: iSpindel - Lokaler Server - iSpindle.py

#676

Beitrag von mrhyde »

McMelloW hat geschrieben: Donnerstag 9. April 2020, 21:57 Hi Alex,

It looks all great.

At this moment, I can not contact the iSpindels with my TCP-Server. Do not see any iSpindels active in the Home page or updates in the Data Table.
I guess I have overwritten iSpindle_config.ini & iSpindle_deafault.ini with the update. Are there any other place where the user-id/password is stored.
Typically, default configs will be overwritten. The individuals not. You also need to copy the new iSpndle.py script to the bin directory.

is the python script running?
Braumeister 20 | Gärung: SS Brewtech 7 Gal BME | Speidel 30 Liter (Konus)
https://github.com/PiBrewing
https://openbrewing.gitbook.io/craftbeerpi4_support/
Benutzeravatar
McMelloW
Posting Junior
Posting Junior
Beiträge: 60
Registriert: Montag 30. Dezember 2019, 20:36
Wohnort: Harderwijk, Nederland

Re: iSpindel - Lokaler Server - iSpindle.py

#677

Beitrag von McMelloW »

mrhyde hat geschrieben: Donnerstag 9. April 2020, 22:07
Typically, default configs will be overwritten. The individuals not. You also need to copy the new iSpndle.py script to the bin directory.

is the python script running?
I guess iSpindle.py is running. I am not sure how to check
ispindle-srv is running anyway

Code: Alles auswählen

pi@mcmellow-pi:~ $ sudo service ispindle-srv status
● ispindle-srv.service - LSB: iSpindle-genericTCP server and relay
   Loaded: loaded (/etc/init.d/ispindle-srv; generated)
   Active: active (running) since Thu 2020-04-09 22:17:01 CEST; 2min 3s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 309 ExecStart=/etc/init.d/ispindle-srv start (code=exited, status=0/SUCCESS)
    Tasks: 2 (limit: 2200)
   Memory: 12.8M
   CGroup: /system.slice/ispindle-srv.service
           └─375 python2.7 /usr/local/bin/iSpindle.py

Apr 09 22:17:00 mcmellow-pi systemd[1]: Starting LSB: iSpindle-genericTCP server and relay...
Apr 09 22:17:01 mcmellow-pi ispindle-srv[309]: Starting system ispindle-srv daemon:.
Apr 09 22:17:01 mcmellow-pi systemd[1]: Started LSB: iSpindle-genericTCP server and relay.
Did a reboot after the copy and the chmod of iSpindle.py script
So far no iSpindel in the RasPySpindel screen appears.
Regards McMelloW
mrhyde
Posting Senior
Posting Senior
Beiträge: 468
Registriert: Mittwoch 7. Juni 2017, 14:16

Re: iSpindel - Lokaler Server - iSpindle.py

#678

Beitrag von mrhyde »

McMelloW hat geschrieben: Donnerstag 9. April 2020, 22:25 Did a reboot after the copy and the chmod of iSpindle.py script
So far no iSpindel in the RasPySpindel screen appears.
you should start it manually und look what debug tells you.
Braumeister 20 | Gärung: SS Brewtech 7 Gal BME | Speidel 30 Liter (Konus)
https://github.com/PiBrewing
https://openbrewing.gitbook.io/craftbeerpi4_support/
Benutzeravatar
McMelloW
Posting Junior
Posting Junior
Beiträge: 60
Registriert: Montag 30. Dezember 2019, 20:36
Wohnort: Harderwijk, Nederland

Re: iSpindel - Lokaler Server - iSpindle.py

#679

Beitrag von McMelloW »

mrhyde hat geschrieben: Freitag 10. April 2020, 08:32 you should start it manually und look what debug tells you.
Thanks Alex. I did this and see what happens.

Code: Alles auswählen


pi@mcmellow-pi:~ $ python /usr/local/bin/iSpindle.py
waiting for connection... listening on port: 9501
...connected from: ('192.168.0.92', 38614)
waiting for connection... listening on port: 9501
6450943
Data for all Spindels is older than 3 days
...connected from: ('192.168.0.93', 62196)
waiting for connection... listening on port: 9501
('192.168.0.93', 62196) received:'{'
('192.168.0.93', 62196) Input Str is now:{
('192.168.0.93', 62196) received:'"name":"iSpindel-Zwart","ID":6450943,"token":"BBFF-PiYIGdh8CJAcswM4p2Xbggsv9kgq32","angle":80.73705,"temperature":24.1875,"temp_units":"C","battery":4.139729,"gravity":38.46389,"interval":20,"RSSI":-57}\r\n'
('192.168.0.93', 62196) Input Str is now:{"name":"iSpindel-Zwart","ID":6450943,"token":"BBFF-PiYIGdh8CJAcswM4p2Xbggsv9kgq32","angle":80.73705,"temperature":24.1875,"temp_units":"C","battery":4.139729,"gravity":38.46389,"interval":20,"RSSI":-57}
('192.168.0.93', 62196) Sent ACK.
('192.168.0.93', 62196) Time elapsed: 0.004165
('192.168.0.93', 62196) iSpindel-Zwart (ID:6450943) : Data Transfer OK.
('192.168.0.93', 62196) - closed connection
('192.168.0.93', 62196) Reading last recipe name for corresponding SpindeliSpindel-Zwart
Recipe Name: Done. SugarWash-20200109
('192.168.0.93', 62196) Reading last recipe_id value for corresponding SpindeliSpindel-Zwart
Recipe_ID: Done. 1
('192.168.0.93', 62196) - writing to database
('192.168.0.93', 62196) - key 'angle is not yet listed, adding it now...
('192.168.0.93', 62196) - key 'angle': adding to database.
('192.168.0.93', 62196) - key 'angle': exists. Consider adding it to defaults list if you want to keep it.
('192.168.0.93', 62196) - key 'name is not yet listed, adding it now...
('192.168.0.93', 62196) - key 'name': adding to database.
('192.168.0.93', 62196) - key 'name': exists. Consider adding it to defaults list if you want to keep it.
('192.168.0.93', 62196) - key 'battery is not yet listed, adding it now...
('192.168.0.93', 62196) - key 'battery': adding to database.
('192.168.0.93', 62196) - key 'battery': exists. Consider adding it to defaults list if you want to keep it.
('192.168.0.93', 62196) - key 'interval is not yet listed, adding it now...
('192.168.0.93', 62196) - key 'interval': adding to database.
('192.168.0.93', 62196) - key 'interval': Error: 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'interval double' at line 1
('192.168.0.93', 62196) - key 'gravity is not yet listed, adding it now...
('192.168.0.93', 62196) - key 'gravity': adding to database.
('192.168.0.93', 62196) - key 'gravity': exists. Consider adding it to defaults list if you want to keep it.
('192.168.0.93', 62196) - key 'token is not yet listed, adding it now...
('192.168.0.93', 62196) - key 'token': adding to database.
('192.168.0.93', 62196) - key 'token': exists. Consider adding it to defaults list if you want to keep it.
('192.168.0.93', 62196) - key 'temp_units is not yet listed, adding it now...
('192.168.0.93', 62196) - key 'temp_units': adding to database.
('192.168.0.93', 62196) - key 'temp_units': exists. Consider adding it to defaults list if you want to keep it.
('192.168.0.93', 62196) - key 'temperature is not yet listed, adding it now...
('192.168.0.93', 62196) - key 'temperature': adding to database.
('192.168.0.93', 62196) - key 'temperature': exists. Consider adding it to defaults list if you want to keep it.
('192.168.0.93', 62196) Database Error: 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'interval, gravity, token, temp_units, temperature) VALUES ('2020-04-10 11:56:53.' at line 1
Did you update your database?
6450943
Data for all Spindels is older than 3 days
^CTraceback (most recent call last):
  File "/usr/local/bin/iSpindle.py", line 844, in <module>
    main()
  File "/usr/local/bin/iSpindle.py", line 838, in main
    clientsock, addr = serversock.accept()
  File "/usr/lib/python2.7/socket.py", line 206, in accept
    sock, addr = self._sock.accept()
KeyboardInterrupt
pi@mcmellow-pi:~ $

Data from the iSpindel is comming in. But there is a problem with writing to my database. (I did made a Backupcopy of my data base.)
Regards McMelloW
mrhyde
Posting Senior
Posting Senior
Beiträge: 468
Registriert: Mittwoch 7. Juni 2017, 14:16

Re: iSpindel - Lokaler Server - iSpindle.py

#680

Beitrag von mrhyde »

McMelloW hat geschrieben: Freitag 10. April 2020, 12:11
Data from the iSpindel is comming in. But there is a problem with writing to my database. (I did made a Backupcopy of my data base.)
This is weired. How das the structure f your data table look like? (screenshot via phpmyadmin).

I am currently brewing and responses may take time....

Alex
Braumeister 20 | Gärung: SS Brewtech 7 Gal BME | Speidel 30 Liter (Konus)
https://github.com/PiBrewing
https://openbrewing.gitbook.io/craftbeerpi4_support/
Benutzeravatar
McMelloW
Posting Junior
Posting Junior
Beiträge: 60
Registriert: Montag 30. Dezember 2019, 20:36
Wohnort: Harderwijk, Nederland

Re: iSpindel - Lokaler Server - iSpindle.py

#681

Beitrag von McMelloW »

Happy Brewing, Alex.

This is the structure.
iSpindle-Structure.png
iSpindle-Structure.png (57.43 KiB) 111404 mal betrachtet
What i can do is delete this database and copy the backup and start over again.
Regards McMelloW
mrhyde
Posting Senior
Posting Senior
Beiträge: 468
Registriert: Mittwoch 7. Juni 2017, 14:16

Re: iSpindel - Lokaler Server - iSpindle.py

#682

Beitrag von mrhyde »

McMelloW hat geschrieben: Freitag 10. April 2020, 13:20 Happy Brewing, Alex.

This is the structure.
iSpindle-Structure.png

What i can do is delete this database and copy the backup and start over again.
Please click on the data table and have a look at the structure of that table. We need to see first the columns of that table. Something like i posted in #665

Alex
Braumeister 20 | Gärung: SS Brewtech 7 Gal BME | Speidel 30 Liter (Konus)
https://github.com/PiBrewing
https://openbrewing.gitbook.io/craftbeerpi4_support/
Benutzeravatar
McMelloW
Posting Junior
Posting Junior
Beiträge: 60
Registriert: Montag 30. Dezember 2019, 20:36
Wohnort: Harderwijk, Nederland

Re: iSpindel - Lokaler Server - iSpindle.py

#683

Beitrag von McMelloW »

Data-Structure.png
This the structure of the Data Table
Regards McMelloW
Benutzeravatar
McMelloW
Posting Junior
Posting Junior
Beiträge: 60
Registriert: Montag 30. Dezember 2019, 20:36
Wohnort: Harderwijk, Nederland

Re: iSpindel - Lokaler Server - iSpindle.py

#684

Beitrag von McMelloW »

This what you mean?
Data-Structure-01.png
Regards McMelloW
mrhyde
Posting Senior
Posting Senior
Beiträge: 468
Registriert: Mittwoch 7. Juni 2017, 14:16

Re: iSpindel - Lokaler Server - iSpindle.py

#685

Beitrag von mrhyde »

McMelloW hat geschrieben: Freitag 10. April 2020, 14:05 This what you mean?
Yes, and you are using obviously a different database since you have the columns 'token' and 'temp_units'.

Where do they come from? Are you using also other devices with the iSpindel Database?
Braumeister 20 | Gärung: SS Brewtech 7 Gal BME | Speidel 30 Liter (Konus)
https://github.com/PiBrewing
https://openbrewing.gitbook.io/craftbeerpi4_support/
Benutzeravatar
McMelloW
Posting Junior
Posting Junior
Beiträge: 60
Registriert: Montag 30. Dezember 2019, 20:36
Wohnort: Harderwijk, Nederland

Re: iSpindel - Lokaler Server - iSpindle.py

#686

Beitrag von McMelloW »

mrhyde hat geschrieben: Freitag 10. April 2020, 15:43
McMelloW hat geschrieben: Freitag 10. April 2020, 14:05 This what you mean?
Yes, and you are using obviously a different database since you have the columns 'token' and 'temp_units'.

Where do they come from? Are you using also other devices with the iSpindel Database?
This is the original Data Table Structure before the upgrade.
Data-Structure-Org.png
The columns 'token' and 'temp_units' are not there. Don't know where they come from.
Just take a new copy of my original iSpindle database and try the upgrade buttons again. Just let you know what happens
Regards McMelloW
mrhyde
Posting Senior
Posting Senior
Beiträge: 468
Registriert: Mittwoch 7. Juni 2017, 14:16

Re: iSpindel - Lokaler Server - iSpindle.py

#687

Beitrag von mrhyde »

McMelloW hat geschrieben: Freitag 10. April 2020, 16:10
This is the original Data Table Structure before the upgrade.
The columns 'token' and 'temp_units' are not there. Don't know where they come from.
Just take a new copy of my original iSpindle database and try the upgrade buttons again. Just let you know what happens
ok,

this is really weired. Please also remove the archive table before the migration.

EDIT: I am also not sure on why you are having all these pma_* tables in the iSpindle database...

Regards,
Alex
Braumeister 20 | Gärung: SS Brewtech 7 Gal BME | Speidel 30 Liter (Konus)
https://github.com/PiBrewing
https://openbrewing.gitbook.io/craftbeerpi4_support/
Benutzeravatar
McMelloW
Posting Junior
Posting Junior
Beiträge: 60
Registriert: Montag 30. Dezember 2019, 20:36
Wohnort: Harderwijk, Nederland

Re: iSpindel - Lokaler Server - iSpindle.py

#688

Beitrag von McMelloW »

mrhyde hat geschrieben: Freitag 10. April 2020, 15:43 Yes, and you are using obviously a different database since you have the columns 'token' and 'temp_units'.

Where do they come from? Are you using also other devices with the iSpindel Database?
Dear Alex,

After a long search and a reinstall of Mariadb and PHPMyAdmin, I finally found the cause of the trouble.
My iSpindles run on firmware 6.2.0 released at 17-11-2019 in the log below you can see the message what is coming from the iSpindle and that is meshing up the data table. They did work OK in the previous version before the database changes. Please have good look at the log below and see what the message from the iSpindle is doing with the Data Table. Special at 'token' and 'temp_units'

Code: Alles auswählen

pi@mcmellow-pi:/usr/local/bin $ python iSpindle.py
waiting for connection... listening on port: 9501
...connected from: ('192.168.99.92', 43706)
waiting for connection... listening on port: 9501
Data for all Spindels is older than 3 days
...connected from: ('192.168.99.93', 60800)
waiting for connection... listening on port: 9501
('192.168.99.93', 60800) received:'{'
('192.168.99.93', 60800) Input Str is now:{
('192.168.99.93', 60800) received:'"name":"iSpindel-Zwart","ID":6450943,"token":"BBFF-PiYIGdh8CJAcswM4p2Xbggsv9kgq32","angle":68.47326,"temperature":22.25,"temp_units":"C","battery":4.139729,"gravity":32.404,"interval":20,"RSSI":-52}\r\n'
('192.168.99.93', 60800) Input Str is now:{"name":"iSpindel-Zwart","ID":6450943,"token":"BBFF-PiYIGdh8CJAcswM4p2Xbggsv9kgq32","angle":68.47326,"temperature":22.25,"temp_units":"C","battery":4.139729,"gravity":32.404,"interval":20,"RSSI":-52}
('192.168.99.93', 60800) Sent ACK.
('192.168.99.93', 60800) Time elapsed: 0.002262
('192.168.99.93', 60800) iSpindel-Zwart (ID:6450943) : Data Transfer OK.
('192.168.99.93', 60800) - closed connection
('192.168.99.93', 60800) Reading last recipe name for corresponding SpindeliSpindel-Zwart
('192.168.99.93', 60800) Recipe Name not found - Database Error: 'NoneType' object has no attribute '__getitem__'
('192.168.99.93', 60800) Reading last recipe_id value for corresponding SpindeliSpindel-Zwart
Recipe_ID: Done. None
('192.168.99.93', 60800) - writing to database
('192.168.99.93', 60800) - key 'angle is not yet listed, adding it now...
('192.168.99.93', 60800) - key 'angle': adding to database.
('192.168.99.93', 60800) - key 'angle': exists. Consider adding it to defaults list if you want to keep it.
('192.168.99.93', 60800) - key 'name is not yet listed, adding it now...
('192.168.99.93', 60800) - key 'name': adding to database.
('192.168.99.93', 60800) - key 'name': exists. Consider adding it to defaults list if you want to keep it.
('192.168.99.93', 60800) - key 'battery is not yet listed, adding it now...
('192.168.99.93', 60800) - key 'battery': adding to database.
('192.168.99.93', 60800) - key 'battery': exists. Consider adding it to defaults list if you want to keep it.
('192.168.99.93', 60800) - key 'interval is not yet listed, adding it now...
('192.168.99.93', 60800) - key 'interval': adding to database.
('192.168.99.93', 60800) - key 'interval': Error: 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'interval double' at line 1
('192.168.99.93', 60800) - key 'gravity is not yet listed, adding it now...
('192.168.99.93', 60800) - key 'gravity': adding to database.
('192.168.99.93', 60800) - key 'gravity': exists. Consider adding it to defaults list if you want to keep it.
('192.168.99.93', 60800) - key 'token is not yet listed, adding it now...
('192.168.99.93', 60800) - key 'token': adding to database.
('192.168.99.93', 60800) - key 'token': exists. Consider adding it to defaults list if you want to keep it.
('192.168.99.93', 60800) - key 'temp_units is not yet listed, adding it now...
('192.168.99.93', 60800) - key 'temp_units': adding to database.
('192.168.99.93', 60800) - key 'temp_units': exists. Consider adding it to defaults list if you want to keep it.
('192.168.99.93', 60800) - key 'temperature is not yet listed, adding it now...
('192.168.99.93', 60800) - key 'temperature': adding to database.
('192.168.99.93', 60800) - key 'temperature': exists. Consider adding it to defaults list if you want to keep it.
('192.168.99.93', 60800) Database Error: 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'interval, gravity, token, temp_units, temperature) VALUES ('2020-04-10 22:42:32.' at line 1
Did you update your database?
Data for all Spindels is older than 3 days
^CTraceback (most recent call last):
  File "iSpindle.py", line 844, in <module>
    main()
  File "iSpindle.py", line 838, in main
    clientsock, addr = serversock.accept()
  File "/usr/lib/python2.7/socket.py", line 206, in accept
    sock, addr = self._sock.accept()
KeyboardInterrupt
pi@mcmellow-pi:/usr/local/bin $

I hope you can follow me. Can you tell me what firmware version your iSindle is at.
Regards McMelloW
mrhyde
Posting Senior
Posting Senior
Beiträge: 468
Registriert: Mittwoch 7. Juni 2017, 14:16

Re: iSpindel - Lokaler Server - iSpindle.py

#689

Beitrag von mrhyde »

McMelloW hat geschrieben: Freitag 10. April 2020, 23:47

Dear Alex,

After a long search and a reinstall of Mariadb and PHPMyAdmin, I finally found the cause of the trouble.
My iSpindles run on firmware 6.2.0 released at 17-11-2019 in the log below you can see the message what is coming from the iSpindle and that is meshing up the data table. They did work OK in the previous version before the database changes. Please have good look at the log below and see what the message from the iSpindle is doing with the Data Table. Special at 'token' and 'temp_units'

Code: Alles auswählen

pi@mcmellow-pi:/usr/local/bin $ python iSpindle.py
waiting for connection... listening on port: 9501
...connected from: ('192.168.99.92', 43706)
waiting for connection... listening on port: 9501
Data for all Spindels is older than 3 days
...connected from: ('192.168.99.93', 60800)
waiting for connection... listening on port: 9501
('192.168.99.93', 60800) received:'{'
('192.168.99.93', 60800) Input Str is now:{
('192.168.99.93', 60800) received:'"name":"iSpindel-Zwart","ID":6450943,"token":"BBFF-PiYIGdh8CJAcswM4p2Xbggsv9kgq32","angle":68.47326,"temperature":22.25,"temp_units":"C","battery":4.139729,"gravity":32.404,"interval":20,"RSSI":-52}\r\n'
('192.168.99.93', 60800) Input Str is now:{"name":"iSpindel-Zwart","ID":6450943,"token":"BBFF-PiYIGdh8CJAcswM4p2Xbggsv9kgq32","angle":68.47326,"temperature":22.25,"temp_units":"C","battery":4.139729,"gravity":32.404,"interval":20,"RSSI":-52}
('192.168.99.93', 60800) Sent ACK.
('192.168.99.93', 60800) Time elapsed: 0.002262
('192.168.99.93', 60800) iSpindel-Zwart (ID:6450943) : Data Transfer OK.
('192.168.99.93', 60800) - closed connection
('192.168.99.93', 60800) Reading last recipe name for corresponding SpindeliSpindel-Zwart
('192.168.99.93', 60800) Recipe Name not found - Database Error: 'NoneType' object has no attribute '__getitem__'
('192.168.99.93', 60800) Reading last recipe_id value for corresponding SpindeliSpindel-Zwart
Recipe_ID: Done. None
('192.168.99.93', 60800) - writing to database
('192.168.99.93', 60800) - key 'angle is not yet listed, adding it now...
('192.168.99.93', 60800) - key 'angle': adding to database.
('192.168.99.93', 60800) - key 'angle': exists. Consider adding it to defaults list if you want to keep it.
('192.168.99.93', 60800) - key 'name is not yet listed, adding it now...
('192.168.99.93', 60800) - key 'name': adding to database.
('192.168.99.93', 60800) - key 'name': exists. Consider adding it to defaults list if you want to keep it.
('192.168.99.93', 60800) - key 'battery is not yet listed, adding it now...
('192.168.99.93', 60800) - key 'battery': adding to database.
('192.168.99.93', 60800) - key 'battery': exists. Consider adding it to defaults list if you want to keep it.
('192.168.99.93', 60800) - key 'interval is not yet listed, adding it now...
('192.168.99.93', 60800) - key 'interval': adding to database.
('192.168.99.93', 60800) - key 'interval': Error: 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'interval double' at line 1
('192.168.99.93', 60800) - key 'gravity is not yet listed, adding it now...
('192.168.99.93', 60800) - key 'gravity': adding to database.
('192.168.99.93', 60800) - key 'gravity': exists. Consider adding it to defaults list if you want to keep it.
('192.168.99.93', 60800) - key 'token is not yet listed, adding it now...
('192.168.99.93', 60800) - key 'token': adding to database.
('192.168.99.93', 60800) - key 'token': exists. Consider adding it to defaults list if you want to keep it.
('192.168.99.93', 60800) - key 'temp_units is not yet listed, adding it now...
('192.168.99.93', 60800) - key 'temp_units': adding to database.
('192.168.99.93', 60800) - key 'temp_units': exists. Consider adding it to defaults list if you want to keep it.
('192.168.99.93', 60800) - key 'temperature is not yet listed, adding it now...
('192.168.99.93', 60800) - key 'temperature': adding to database.
('192.168.99.93', 60800) - key 'temperature': exists. Consider adding it to defaults list if you want to keep it.
('192.168.99.93', 60800) Database Error: 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'interval, gravity, token, temp_units, temperature) VALUES ('2020-04-10 22:42:32.' at line 1
Did you update your database?
Data for all Spindels is older than 3 days
^CTraceback (most recent call last):
  File "iSpindle.py", line 844, in <module>
    main()
  File "iSpindle.py", line 838, in main
    clientsock, addr = serversock.accept()
  File "/usr/lib/python2.7/socket.py", line 206, in accept
    sock, addr = self._sock.accept()
KeyboardInterrupt
pi@mcmellow-pi:/usr/local/bin $

I hope you can follow me. Can you tell me what firmware version your iSindle is at.
Based on tihs log it seems to me that you have set the 'ENABLE_ADDCOLS' to '1' in the settings (GLOBAL-> ADVANCED). Only n this case the iSpindle script trys to add columns to the data table. You need to set this to 0. I never used it.

In addition to that you should add a reset to your device and set a recipe name.
Braumeister 20 | Gärung: SS Brewtech 7 Gal BME | Speidel 30 Liter (Konus)
https://github.com/PiBrewing
https://openbrewing.gitbook.io/craftbeerpi4_support/
Benutzeravatar
McMelloW
Posting Junior
Posting Junior
Beiträge: 60
Registriert: Montag 30. Dezember 2019, 20:36
Wohnort: Harderwijk, Nederland

Re: iSpindel - Lokaler Server - iSpindle.py

#690

Beitrag von McMelloW »

mrhyde hat geschrieben: Samstag 11. April 2020, 08:49
Based on this log it seems to me that you have set the 'ENABLE_ADDCOLS' to '1' in the settings (GLOBAL-> ADVANCED). Only n this case the iSpindle script trys to add columns to the data table. You need to set this to 0. I never used it.

In addition to that you should add a reset to your device and set a recipe name.
For my understanding. After the update to alter some tables and the creation of the Archive Table. You have to set 'ENABLE_ADDCOLS'back to 0. It should be wise to mark this very clearly.

What do you mean by a reset to my device? On the iSpindle or in the software?

For now, I see or I can clean up the Data Table, remove the Archive Table and start again with the 'Upgrade Data Table' I hope this fix it all?
Regards McMelloW
mrhyde
Posting Senior
Posting Senior
Beiträge: 468
Registriert: Mittwoch 7. Juni 2017, 14:16

Re: iSpindel - Lokaler Server - iSpindle.py

#691

Beitrag von mrhyde »

McMelloW hat geschrieben: Samstag 11. April 2020, 12:41
For my understanding. After the update to alter some tables and the creation of the Archive Table. You have to set 'ENABLE_ADDCOLS'back to 0. It should be wise to mark this very clearly.

What do you mean by a reset to my device? On the iSpindle or in the software?

For now, I see or I can clean up the Data Table, remove the Archive Table and start again with the 'Upgrade Data Table' I hope this fix it all?
Not sure where you got this information. aboutt he 'ENABLE_ADDCOLS'. I did not mentione it and I did also not add it to the iSpindle.py. According to Tozzi, it is only for development pruposes. I never used it.

You should disable the 'ENABLE_ADDCOLS', delete the archive table and restore the backup of your data table.

Then just do the migration via the webinterface and it should work. I did this now several times on my system for testing and I do not have a problem.

With the reset I was just referring to the function to start a new fermentation 'Gärbeginn Zetpunkt setzen' and set a recipe name.

As mentioned, this is currently in Beta nad I will add a documentation, onc I have it there where I want it.

On my local system I already have more functions:
- Set end of fermntzation for the archive which is shown a few posts above
- Delete an old recipe from the database

Currently I am working on the annotations. But here I need to dig a little bit more into highcharts.

Regards,
Alex
Braumeister 20 | Gärung: SS Brewtech 7 Gal BME | Speidel 30 Liter (Konus)
https://github.com/PiBrewing
https://openbrewing.gitbook.io/craftbeerpi4_support/
Benutzeravatar
McMelloW
Posting Junior
Posting Junior
Beiträge: 60
Registriert: Montag 30. Dezember 2019, 20:36
Wohnort: Harderwijk, Nederland

Re: iSpindel - Lokaler Server - iSpindle.py

#692

Beitrag von McMelloW »

mrhyde hat geschrieben: Samstag 11. April 2020, 14:24 Not sure where you got this information. aboutt he 'ENABLE_ADDCOLS'. I did not mentione it and I did also not add it to the iSpindle.py. According to Tozzi, it is only for development pruposes. I never used it.
I think I switched it on to enter the expert mode. But it is not necessary for that.
You should disable the 'ENABLE_ADDCOLS', delete the archive table and restore the backup of your data table.
It is off now. I have seen now what is does. :Bigsmile
Then just do the migration via the webinterface and it should work. I did this now several times on my system for testing and I do not have a problem.
All done and it looks OK now.
With the reset I was just referring to the function to start a new fermentation 'Gärbeginn Zetpunkt setzen' and set a recipe name.
I can not find where to set this. TCP-Server is running. iSPindle.py is running, ISpindle is sending messages. But now records are added to the Data Table and the screen is still saying "No spindle data received in the past 7 days. Please connect Spindle to generate data."
This is the Data Table Structure after the update.
Data-Structure-New.png
And this is the log of an iSpindle message after the update.

Code: Alles auswählen

pi@mcmellow-pi:~ $ python /usr/local/bin/iSpindle.py
waiting for connection... listening on port: 9501
...connected from: ('192.168.99.92', 56646)
waiting for connection... listening on port: 9501
Data for all Spindels is older than 3 days
...connected from: ('192.168.99.94', 50688)
waiting for connection... listening on port: 9501
('192.168.99.94', 50688) received:'{'
('192.168.99.94', 50688) Input Str is now:{
('192.168.99.94', 50688) received:'"name":"iSpindel-Groen","ID":6549273,"token":"BBFF-C5IoFNG67sFHVB4jTHN1ykdzZl5BAD","angle":64.8624,"temperature":23,"temp_units":"C","battery":3.941606,"gravity":1.082502,"interval":20,"RSSI":-57}\r\n'
('192.168.99.94', 50688) Input Str is now:{"name":"iSpindel-Groen","ID":6549273,"token":"BBFF-C5IoFNG67sFHVB4jTHN1ykdzZl5BAD","angle":64.8624,"temperature":23,"temp_units":"C","battery":3.941606,"gravity":1.082502,"interval":20,"RSSI":-57}
('192.168.99.94', 50688) Sent ACK.
('192.168.99.94', 50688) Time elapsed: 0.002559
('192.168.99.94', 50688) iSpindel-Groen (ID:6549273) : Data Transfer OK.
('192.168.99.94', 50688) - closed connection
('192.168.99.94', 50688) Reading last recipe name for corresponding SpindeliSpindel-Groen
('192.168.99.94', 50688) Recipe Name not found - Database Error: 'NoneType' object has no attribute '__getitem__'
('192.168.99.94', 50688) Reading last recipe_id value for corresponding SpindeliSpindel-Groen
Recipe_ID: Done. None
('192.168.99.94', 50688) - writing to database
('192.168.99.94', 50688) Database Error: 1366 (22007): Incorrect integer value: 'None' for column `iSpindle`.`Data`.`Recipe_ID` at row 1
Did you update your database?
Data for all Spindels is older than 3 days
^X^CTraceback (most recent call last):
  File "/usr/local/bin/iSpindle.py", line 844, in <module>
    main()
  File "/usr/local/bin/iSpindle.py", line 838, in main
    clientsock, addr = serversock.accept()
  File "/usr/lib/python2.7/socket.py", line 206, in accept
    sock, addr = self._sock.accept()
KeyboardInterrupt

Where do I make my iSpindles know to the database? Studied all help-screens, but did not find anything.
Regards McMelloW
mrhyde
Posting Senior
Posting Senior
Beiträge: 468
Registriert: Mittwoch 7. Juni 2017, 14:16

Re: iSpindel - Lokaler Server - iSpindle.py

#693

Beitrag von mrhyde »

McMelloW hat geschrieben: Samstag 11. April 2020, 16:15 I can not find where to set this.
It's on the index page:
start fermentation.PNG
Braumeister 20 | Gärung: SS Brewtech 7 Gal BME | Speidel 30 Liter (Konus)
https://github.com/PiBrewing
https://openbrewing.gitbook.io/craftbeerpi4_support/
Benutzeravatar
McMelloW
Posting Junior
Posting Junior
Beiträge: 60
Registriert: Montag 30. Dezember 2019, 20:36
Wohnort: Harderwijk, Nederland

Re: iSpindel - Lokaler Server - iSpindle.py

#694

Beitrag von McMelloW »

This page does not exist. The Data Table contains no records at all. This is my home page
HomePage.png
Switching on an Ispindle does not change any thing. See the log in my previous posting. Data is not written to the Data Table
Regards McMelloW
mrhyde
Posting Senior
Posting Senior
Beiträge: 468
Registriert: Mittwoch 7. Juni 2017, 14:16

Re: iSpindel - Lokaler Server - iSpindle.py

#695

Beitrag von mrhyde »

McMelloW hat geschrieben: Samstag 11. April 2020, 17:45 This page does not exist. The Data Table contains no records at all. This is my home page

HomePage.png

Switching on an Ispindle does not change any thing. See the log in my previous posting. Data is not written to the Data Table
ok, but you can increase the number in days of history until you see the spindle you are currently using.

Otherwise you could also type

http://IP.of.Your.Server/iSpindle/reset ... ecipe=Test.

Alex
Braumeister 20 | Gärung: SS Brewtech 7 Gal BME | Speidel 30 Liter (Konus)
https://github.com/PiBrewing
https://openbrewing.gitbook.io/craftbeerpi4_support/
Benutzeravatar
McMelloW
Posting Junior
Posting Junior
Beiträge: 60
Registriert: Montag 30. Dezember 2019, 20:36
Wohnort: Harderwijk, Nederland

Re: iSpindel - Lokaler Server - iSpindle.py

#696

Beitrag von McMelloW »

Ales, thanks very much for all your support.
The link with rest_now.php works OK for me. Finally it all looks OK.
HomePage-02.png
Regards McMelloW
mrhyde
Posting Senior
Posting Senior
Beiträge: 468
Registriert: Mittwoch 7. Juni 2017, 14:16

Re: iSpindel - Lokaler Server - iSpindle.py

#697

Beitrag von mrhyde »

McMelloW hat geschrieben: Samstag 11. April 2020, 19:00 Ales, thanks very much for all your support.
The link with rest_now.php works OK for me. Finally it all looks OK.
Great,
This is good news.

I need to think about on how to avoid this issue in the python script. Thought it was covered, but this was a diferent situation when the recipe column was not in the table at all. I will find a solution.

Did a Hefeweizen yesterday and used some yeast from a bottle of my last brew for s astarter. The Wyeast 3068 is awesome fast. The spindle can#t measure that fast :-)
Braumeister 20 | Gärung: SS Brewtech 7 Gal BME | Speidel 30 Liter (Konus)
https://github.com/PiBrewing
https://openbrewing.gitbook.io/craftbeerpi4_support/
Benutzeravatar
McMelloW
Posting Junior
Posting Junior
Beiträge: 60
Registriert: Montag 30. Dezember 2019, 20:36
Wohnort: Harderwijk, Nederland

Re: iSpindel - Lokaler Server - iSpindle.py

#698

Beitrag von McMelloW »

I did started with a complete empty database iSpindle. The TCP-Server software is expecting a some records. Perhaps some dummy basic records in a script to fill the new database after it is created.

It would be very nice when you change the interval online, without going into the configuratie mode. That would be a very nice and handy future.
Regards McMelloW
Benutzeravatar
Tozzi
Moderator
Moderator
Beiträge: 4768
Registriert: Montag 22. Februar 2016, 23:17
Wohnort: Fasano (BR) - Puglia - IT

Re: iSpindel - Lokaler Server - iSpindle.py

#699

Beitrag von Tozzi »

ENABLE_ADDCOLS shouldn't hurt, but it can cover up other problems easily, especially firmware/database mismatches.
It was originally a feature that Sam wanted to have in order to be able to test newer firmware versions.
So, unless your name is Sam, you should keep that one at the default of disabled (0). :Wink
McMelloW hat geschrieben: Samstag 11. April 2020, 21:05 it would be very nice when you change the interval online, without going into the configuratie mode. That would be a very nice and handy future.
The script does actually support that; however the firmware unfortunately still doesn't, AFAIK.
Viele Grüße aus Fasano
Stephan
mrhyde
Posting Senior
Posting Senior
Beiträge: 468
Registriert: Mittwoch 7. Juni 2017, 14:16

Re: iSpindel - Lokaler Server - iSpindle.py

#700

Beitrag von mrhyde »

Tozzi hat geschrieben: Sonntag 12. April 2020, 00:28 The script does actually support that; however the firmware unfortunately still doesn't, AFAIK.
Right,

there is currently nothing we can do on the server side.
Braumeister 20 | Gärung: SS Brewtech 7 Gal BME | Speidel 30 Liter (Konus)
https://github.com/PiBrewing
https://openbrewing.gitbook.io/craftbeerpi4_support/
Antworten