Jump to content

photron

Administrators
  • Gesamte Inhalte

    3.055
  • Benutzer seit

  • Letzter Besuch

  • Tagessiege

    40

Alle erstellten Inhalte von photron

  1. Noch eine Frage: Hast du am HAT Zero Brick irgendetwas angeschlossen? Falls ja hilft es alles vom HAT abzustecken?
  2. Das ist interessant, dazu muss ich @photron mal befragen. Das war in 2.4.1 der Fall, das ist in 2.4.2 behoben und in 2.4.3 nicht mehr relevant, da dort die CS Pins im Normalfall nicht mehr durch sysfs gesteuert werden. Das sollte kein Problem sein, du hast ja ein HAT Zero, das hat sowieso keine RTC an Bord. brickd selbst greift nicht auf diese Datei zu, das ist vermutlich irgendwas in glibc oder libusb. Das kannst du ignorieren. Ich glaube nicht, dass das hier mit dem "Message checksum error" Problem zusammenhängt, dass Superb hat, wie @rtrbt vermutet. brickd 2.4.1 meldet diese Fehler auf Debug Level, was standardmäßig nicht sichtbar ist. Die Debug Logauszüge sehen aber gut aus. Komisch. Komisch ist dann auch, dass es mit brickd 2.4.1 nicht hilft, die core Clock auf 250MHz zu setzen. Für brickd 2.4.3 ist das setzen von core_freq auf 250 nicht mehr notwendig, da diese Version mit abweichenden core Clock Frequenzen um gehen kann. Vielleicht ist die BCM2835 Library ein Problem, die wird in brickd 2.4.3 standardmäßig verwenden, in Zusammenhang mit deinem Custom Linux Builds ein Problem. Brickd 2.4.1 verwendet stattdessen spidev und sysfs. Teste mal bitte folgendes: Installiere wieder brickd 2.4.3 und setze in /etc/brickd.conf die bricklet.spi.driver Option auf spidev: bricklet.spi.driver = spidev Du solltest dann in der Logausgabe Using spidev backend for Bricklets (forced by config) anstelle von Using BCM2835 backend for Bricklets (Raspberry Pi detected) stehen. Hilft das? Wenn das nicht hilft, dann teste bitte mal mit einem Standard Raspbian und Standard brickd 2.4.3 anstelle deines Custom Linux Builds. Nicht das hier ein Hardwaredefekt an HAT oder Raspberry Pi vorliegt. Ist beides schon vorgekommen. Hast du noch ein anderes Raspberry Pi zur Hand u das testen zu können?
  3. Downgrading to brickd 2.4.1 will "hide" these messages, because before brickd 2.4.2 these messages where logged on debug level, which is not visible by default. Do you actually have issue with the LCD 128x64 Bricklets functionality? Or are you just seeing these messages in the brickd.log file, but the Bricklet works fine regardless? What else do you have connected to the HAT Brick?
  4. @bugra_s Welche brickd Version ist auf dem Raspberry Pi installiert? Wenn es nicht 2.4.3 ist, dann test bitte zuerst mal brickd 2.4.3 zu installieren.
  5. Tinkerforge::DEVICE_DISPLAY_NAMES is internal for error message purposes. What you're looking for is a device factory. The Ruby bindings don't have that. That's not a bad idea at all, that basically how Brick Viewer solves this problem. But instead of doing a linear search, Brick Viewer builds a dictionary that maps device identifier to device class and then uses that dictionary to do the lookup efficiently. What are you trying to build that requires a device factory?
  6. Das Brick Daemon Debian Package ist jetzt auch für arm64 verfügbar.
  7. The Brick Daemon Debian package is now also available for arm64 architecture.
  8. Brick Daemon 2.4.3 Fix SPI clock for HAT (Zero) Brick on Linux, if core_freq differs from 250 MHz Add config option to override SPI backend detection Downloads: Windows, Linux (amd64, i386, armhf, arm64), macOS
  9. Brick Daemon 2.4.3 SPI-Clock für HAT (Zero) Brick auf Linux korrigiert, falls core_freq von 250 MHz abweicht Config-Option zur Überstimmung der SPI Backend-Bestimmung hinzugefügt Downloads: Windows, Linux (amd64, i386, armhf, arm64), macOS
  10. Wie in der Doku beschrieben kommt ein Enumerate-Connected unaufgefordert durch Starten oder Resetten der Hardware. Ein Enumerate-Available kommt durch Anforderung über die enumerate() Funktion. Ich erwarte, dass bei den beiden Enumerate-Callbacks einer ein Connected- und einer ein Available-Callback ist. Alternativ hast du noch ein anderes Programm laufen, dass auch enumerate() aufruft. Enumerate Callback die von einem Programm ausgelöst werden kommen auch an allen Programmen an die zur gleichen Adresse verbunden sind. Anstatt die Toten die Lebenden finden. Den Fall, dass die onewire Liste leer ist muss nicht extra behandelt werden. Wenn die Liste leer ist, dann wird die for Schleife nicht betreten, found bleibt False. if device_identifier == BrickletOneWire.DEVICE_IDENTIFIER: self.sensors.stop_auto_reading() alive = [] found = False for i in self.onewire: try: if i.get_identity().uid == uid: found = True except: pass # ignoring non-responding Bricklet else: alive.append(i) if not found: alive.append(BrickletOneWire(uid, self.ipcon)) self.onewire = alive self.sensors.add_onewire(self.onewire) Weil das Device Object keinen relevanten Zustand hält außer die Response-Expected-Einstellungen. Daher muss es nicht neu angelegt, wenn sich das Bricklet enumeriert, denn es ändert sich durch das Enumerieren aus der Sicht des Device Object nichts.
  11. Nein. Ja. Schaust du auf den enumerate_type und unterscheidest Connected und Available Enumerate Callbacks? Zu der "Device has been replaced" Fehlermeldung: Die IPConnection hält intern eine Liste von UID auf Device Object. Wenn du für eine UID ein neues Device Object anlegst, dann wird das alte Device Object ersetzt. Wenn du dann auf dem alten Device Object Funktionen aufrufst, dann bekommst du den "Device has been replaced" Fehler. Das ganze kommt durch die "i = BrickletOneWire(uid, self.ipcon)" Zeile. Das ersetzt nicht den Eintrag in der onewire Liste, sondern du änderst nur die lokale Variable i, ersetzt aber in er IPConnection das alte BrickletOneWire Object durch das neue, das dann aber nicht in der onewire Liste landet. Dadurch verwendest du später das alte BrickletOneWire Object wieder. Es ist aber an der Stelle auch nicht notwendig das BrickletOneWire Object neu anzulegen. Sprich wenn du die Zeile löscht löst sich dadurch dein Problem.
  12. Ja, das wird in 2.4.3 drin sein. Ich denke das kommt noch heute oder morgen raus.
  13. Das funktioniert auf dem Raspberry Pi 4 auch nur zufällig, weil der CPU Governor dort die Core Clock bei wenig Last runter skaliert. Auf dem Raspberry Pi Zero läuft die Core Clock aber auf volle Pulle und dadurch ist die SPI Kommunikation zu schnell, weil brickd die falsch berechnet. Dadurch verstehen die Bricklets das dann nicht. Teste mal bitte die angehängte brickd Version. brickd_2.4.2+snapshot~b4e01c3_armhf.deb
  14. Ich glaube wir haben dich erfolgreich verwirrt! Die API des RED Brick selbst wird von Brick Viewer verwendet um z.B. Programme auf den RED Brick zu laden und zu verwalten. Wenn du auf dem RED Brick ein Java Programm ausführen willst, das an den RED Brick angeschlossene Bricks und Bricklets verwendet, dann hast du mit der API des RED Bricks nichts zu tun. Du würdest dein Programm entwickeln und dann über den Brick Viewer auf den RED Brick laden und ausführen lassen. Daher hast du in dem Fall auch mit nichts zu tun was du dort im Beispiel siehst. Dieses Beispiel zeigt nicht, wie du ein Programm schreibst, das auf dem RED Brick läuft. Dieses Beispiel existiert, weil mal ein Kunde danach gefragt hat, wie man aus einem Programm A heraus ein Programm B auf dem RED Brick manuell starten kann. Das ist aber ein Spezialfall. Der Normalfall ist, dass du dein Programm auf den RED Brick lädst und es dann durch den RED Brick automatisch starten lässt. Kurz zu deinen Fragen: Das ist der Identifier aus dem Program Wizard für das Programm das manuell gestartet werden soll. Das ist nicht der Identifier für dieses Beispiel Programm. Mit der startProgram Funktion der RED Brick API kann ein vorher hochgeladenes Programm manuell gestartet werden. Der restlich Code davor dient dazu das zu startende Programm anhand seines Identifiers zu finden. Dort wird keine Klasse instantiiert weil das Beispiel möglichst einfach sein soll, keine Objektorientierung nötig in diesem Beispiel. Dein Programm basiert nicht auf Ableiten einer Basisklasse oder Implementieren eines Interfaces oder diesem Beispiel überhaupt. Außer wenn du wirklich Brick Viewer Aufgaben in deinem Programm selbst umsetzen willst, hast du nie etwas mit der RED Brick API oder den Dingen in diesem Beispiel zu tun. Beispiel: Du hast auf dem RED Brick einen Master Brick, daran ein Temperature Bricklet 2.0 und willst mit einem Program auf dem RED Brick die Temperaturwerte aufzeichnen. Dann könntest du z.B. das Temperature Bricklet 2.0 Java Callback Bespiel nehmen, die UID auf die deines Temperature Bricklet 2.0 setzen, das Programm kompilieren und über Brick Viewer auf den RED Brick landen und ausführen lassen. Die Standardeinstellungen des Program Wizards sind so, dass die Ausgaben des Programms in einer Logdatei auf dem RED Brick aufgezeichnet werden, die du über Brick Viewer einsehen kannst. Fertig ist ein simpler Temperatur Logger. https://www.tinkerforge.com/de/doc/Software/Bricklets/TemperatureV2_Bricklet_Java.html#callback
  15. Did the PTC problem occur once or is it reproducible? What kind of power supply do you use to feed the black power input on the HAT Brick? Could the system be underpowered?
  16. Do you run Raspberry Pi OS or Ubuntu at the moment? The -246.88 is the value you get if the sensor input on the PTC Bricklet 2.0 is shorted.
  17. I tested Raspberry Pi 4 with Raspberry Pi OS with brickd 2.4.2 and "stress -c 4". I can see that the SPI clock is 2x faster than expected and there are errors in the brickd.log, but the error rate is still low enough that the error recovery mechanisms in brickd can deal with it. But this is not a recommended setup, it's barely working and on the edge to failing.
  18. Yes, with brickd 2.4.2 the SPI frequency setting is broken in brickd and it might work for you under certain conditions, but might just fail under other conditions. Please test the attached snapshot versions of brickd in the post above. These have the SPI frequency setting logic fixed. In my tests here this works without problems with Ubuntu on Raspberry Pi 4. The original 2.4.2 version doesn't work there because the SPI frequency is way too high there because of a bug in brickd.
  19. I've found the difference between Raspberry Pi OS and Ubuntu. Raspberry Pi OS scales down the core frequency to 200 if there is not much load on the CPU. Ubuntu keeps the core frequency at 500 all the time, resulting the SPI clock being to fast all the time.
  20. Please test the attached brickd version with Ubuntu. The arm64 variant is for Ubuntu, the armhf variant is for Raspberry Pi OS. This version fixes the Problem for me with Raspberry Pi 4 and Ubuntu. There is no need to modify core_freq or anything else. This should work with an unmodified OS image. With this version you should not see these kinds of messages in the log file anymore: 2020-11-19 18:07:15.845333 <E> <bricklet_stack.c:396> Frame error (port: I, count: 33) 2020-11-19 18:07:15.853887 <E> <bricklet_stack.c:478> Message checksum error (port: I, count: 12) brickd_2.4.2+snapshot~7af86f9_armhf.deb brickd_2.4.2+snapshot~7af86f9_arm64.deb
  21. Okay, the whole core_freq situation is way more complex. That it works for you with Raspberry Pi Os is just luck I think. Sorry, for the mess, I working on improving this situation. On RPi 4 core_freq can be 500, 550 or 360 depending on the TV-Out and HDMI config. The core_freq_min can be 250 or 275. The kernel will dynamically change the actual core frequency depending on the load. On RPi 1 and 2 core_freq and core_freq_min are fixed 250, no problem there. On RPi 0/W and 3A/B+ core_freq is 400 and core_freq_min is 250. In brickd 2.4.2 we switched to a new backend for SPI communication with the HAT (Zero) Brick. It seems that the old backend dealt correctly with this dynamic and higher core frequency, but the new one just assumes it to be fixed at 250 and fails in cases where core_freq is higher than 250.
  22. Brick Daemon expects the Raspberry Pi core_freq to be 250, but with the Raspberry Pi 4 core_freq is 500 by default. The SPI clock is based on the core_freq. With a core_freq twice as fast as expected the SPI clock is also twice as fast. This is too fast for the Bricklets. This is a somewhat known problem. But our documentation doesn't cover this well. You can try forcing the core_freq to 250 in Ubuntu by editing /boot/firmware/config.txt and adding, but the Raspberry Pi documentation warns about doing this on a Raspberry Pi 4, as it might result in boot problems: core_freq=250 But this might affect other things that expect the core_freq to be 500. I'll fix this in brickd, to not assume the core_freq to be 250 when calculating the SPI clock, but read the actual core_freq value.
  23. About the extra 5 seconds of data: From the output file it seems that there are full zero output line every full second when the fusion mode is changed. The extra 5 seconds of data don't have that. Also the recorded data has the expected sample timing of 10 milliseconds. To get this extra 5 seconds would require that the ipcon.disconnect() call is delayed by 5 seconds. But I don't see how that should happen. Could you record the value of the callbackTimer directly before and after the ipcon.disconnect() call to see when it's called and how long it takes in relation to the extra 5 seconds of data? Is this fixed 5 seconds of extra data, or is this times 2 of extra data? Could you replace the pause(1) calls with pause(2) calls to see if this gives you 15 or 20 seconds of recorded data in total?
  24. Das Problem ist mit der aktuellen Brick Daemon Version 2.4.2 behoben und es sollten keine Workaround mehr notwendig sein. Die beste Lösung ist natürlich weiterhin die Firmware des HAT Bricks auf 2.0.2 oder neuer zu aktualisieren. Aber bei der Kombination Kernel 5.4, HAT Brick Firmware < 2.0.2 und Brick Daemon 2.4.2 tritt das Problem nicht mehr auf.
  25. Brick Daemon 2.4.2 Properly shutdown subsystems on Ctrl+C instead of abruptly exiting on Windows Rotate persistent log file on Windows and limit its total size to 25 MB Add commandline options to override log and config file location on Windows Colorize Log Viewer live log messages on Windows Reword Log Viewer messages to be less ambiguous on Windows Add build option to work without a device file manager such as udevd on Linux Allow to handle more then 6 USB devices on Windows Use BCM2835 library for SPI connected Bricklets on Raspberry Pi to improve performance and work around SPI chip select conflict between Linux kernel 5.4 and HAT Brick firmware < 2.0.2 Improve log messages related to HAT (Zero) Brick on Linux Fix SPI hardware chip select usage on Linux Allow to fully static link brickd for Docker container usage on Linux Switch Debian package build to debhelper and drop SysV init support Improve USB transfer error logging and stall error recovery Downloads: Windows, Linux (amd64, i386, armhf, arm64), macOS
×
×
  • Neu erstellen...